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-projectCLI 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 PostsQuick Start
Navigate to your project:
bashcd my-projectConfigure your database in
lucent.config.ts:typescriptimport { defineConfig } from "@lucent/core"; export default defineConfig({ database: { type: "postgres", connectionString: process.env.DATABASE_URL, }, });Define your collections in
src/collections/:typescriptimport { 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 }, }, });Start the development server:
bashbun 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.jsonNext Steps
- Configuration Guide - Learn about all configuration options
- Collections - Define your data models
- Fields - Available field types
- Authentication - Set up user authentication