This is a monorepo containing both the client and server components of our Elysia-based application.
client/ - React frontend built with Viteserver/ - Elysia backend using Bun runtime# Install all dependencies (root + workspaces)
bun run install:all
# In the server directory
cp .env.example .env
# Fill in your environment variables
# In the client directory
cp .env.example .env
# Fill in your environment variables
# In the server directory
bun run db:migrate
bun run db:seed
To run both the client and server in development mode:
bun run dev
To run just the client or server:
bun run dev:client
# or
bun run dev:server
To run all tests:
bun run test
Or run server tests only:
bun run test:server
To build all workspaces:
bun run build
Or build specific workspaces:
bun run build:client
# or
bun run build:server
This project uses Turborepo to manage the monorepo. Key features:
# Run with verbose logging
bunx turbo dev --verbose
# Run without cache
bunx turbo dev --no-cache
# Generate a dependency graph
bunx turbo run build --graph=dependency-graph.png
# Prune the cache
bunx turbo prune
MIT
server/.env:CLERK_SECRET_KEY=your_clerk_secret_key
client/.env:VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
The server exposes the following API endpoints:
GET /api/notes - Get all public notesPOST /api/notes - Create a public note (anonymous)PUT /api/private-notes - Create a private note (requires authentication)GET /api/private-notes - Get all private notes for the authenticated userInstall dependencies:
npm install
Start the server:
npm start
For development with auto-restart:
npm run dev
The server runs on port 3000 by default.
GET /versions - Retrieve version information about the APIGET /api/notes/user - Retrieve notes for the authenticated userGET /api/notes/admin - Retrieve all notes (admin access required)POST /api/notes - Create a new note{ "title": "Note Title", "content": "Note content", "isPublic": false }PUT /api/notes/:id - Update an existing noteDELETE /api/notes/:id - Delete a noteGET /api/public-notes - Retrieve all public notes (no authentication required)POST /api/public-notes - Create a new anonymous public note{ "content": "Note content" }PUT /api/public-notes/:id - Update an existing public noteGET /api/private-notes - Retrieve private notes for the authenticated userPUT /api/private-notes - Create a new private note{ "data": "Private note content" }DELETE /api/private-notes/:id - Delete a private noteGET /api-key-example - Validate admin API keyAuthentication is handled via Clerk integration. Admin operations require the x-api-key header with the correct admin API key.
GET http://localhost:3000/api/public-notes
POST http://localhost:3000/api/notes
Content-Type: application/json
{
"title": "My Note",
"content": "This is my note content",
"isPublic": false
}
DELETE http://localhost:3000/api/notes/123
x-api-key: your-admin-api-key