Skip to content

Getting Started

Welcome to Lucent, a modern CMS framework for TypeScript applications.

Installation

Create a new Lucent project using the CLI:

bash
# Initialize a new project
bun create lucent my-project

# Or use the lucent CLI directly if installed
lucent init my-project

CLI Commands

The lucent CLI provides several commands to manage your project:

bash
# Start development server with hot reload
lucent dev

# Generate TypeScript types from your config
lucent typegen

# Run database migrations
lucent migrate

# Scaffold a new collection
lucent collection Posts

Quick Start

  1. Navigate to your project:

    bash
    cd my-project
  2. Configure your database in lucent.config.ts:

    typescript
    import { defineConfig } from "@lucent/core";
    
    export default defineConfig({
      database: {
        type: "postgres",
        connectionString: process.env.DATABASE_URL,
      },
    });
  3. Define your collections in src/collections/:

    typescript
    import { defineCollection } from "@lucent/core";
    
    export const users = defineCollection({
      name: "users",
      fields: {
        email: { type: "string", required: true, unique: true },
        name: { type: "string" },
        password: { type: "string", required: true, hidden: true },
      },
    });
  4. Start the development server:

    bash
    bun run dev

Project Structure

my-project/
├── src/
│   ├── collections/    # Define your data collections
│   ├── endpoints/      # Custom API endpoints
│   ├── hooks.ts        # Global hooks
│   ├── index.ts        # Entry point
│   └── lucent.config.ts # Configuration
├── package.json
└── tsconfig.json

Next Steps

Released under the MIT License.