This is a lightweight and high-performance backend built with Bun and Elysia.js, utilizing Drizzle ORM for database management and Turso as the hosted libSQL database. The project is written in TypeScript.
- Bun - Fast JavaScript runtime
- Elysia.js - Modern and efficient web framework
- Drizzle ORM - TypeScript-first ORM for SQL databases
- Turso - libSQL cloud-hosted database
- TypeScript
Ensure you have Bun installed:
curl -fsSL https://bun.sh/install | bashgit clone https://github.com/Avestair/cmsbackend.git
cd cmsbackendbun installCreate a .env file in the root of the project and add your Turso Database URL:
TURSO_CONNECTION_URL=<your_turso_database_url>
TURSO_AUTH_TOKEN=<your_turso_database_auth_token>
Start the development server:
bun run devOr run in production mode:
bun run start📦 your-repo/
┣ 📂 src/
┃ ┣ 📂 routes/ # API route handlers
┃ ┣ 📂 services/ # Business logic services
┃ ┣ 📂 drizzle/ # Drizzle ORM queries and Schemas
┃ ┣ 📂 lib/ # Utils and Schemas
┃ ┣ 📂 DTOS/ # DTOs
┃ ┣ 📜 index.ts # Entry point
┣ 📜 .env # Environment variables
┣ 📜 bun.lockb # Bun lock file
┣ 📜 README.md # Project documentation
| Method | Endpoint | Description |
|---|---|---|
| POST | /user/register |
Register a new user |
| POST | /user/login |
User login |
| POST | /post/ |
Create a new post |
| GET | /post/ |
Retrieve all posts |
| GET | /post/:id |
Get a single post |
| PUT | /post/:id |
Update a post |
| DELETE | /post/:id |
Delete a post |