A TypeScript-based project using Drizzle ORM for database operations with PostgreSQL.
- PostgreSQL database with Drizzle ORM
- Type-safe database operations
- RESTful API endpoints for Posts and Users
- Role-based user system
- Post categories and status management
- Fields: id, username, email, role (admin/user/guest), status, timestamps
- Indexed fields for optimized queries
- Built-in role and status management
- Fields: id, title, content, authorId, status, timestamps
- Categories: news, tutorial, review, other
- Foreign key relationship with Users
- Indexed fields for better performance
GET /
: Get all postsPOST /
: Create a new postGET /:id
: Get post by ID
GET /users
: Get all usersPOST /users
: Create a new user
- Clone the repository
- Install dependencies:
npm install
- Set up your PostgreSQL database
- Configure your database connection in
drizzle.config.ts
- Run migrations:
npm run db:migrate
- Start the development server:
npm run dev
- TypeScript
- Drizzle ORM
- PostgreSQL
- Nitro