A modern admin dashboard built with:
- Edge-first architecture using Cloudflare Workers
- Neon Serverless Postgres for database
- Clerk for authentication
- Drizzle ORM for type-safe database operations
- Hono for API routing
- React + Vite for frontend
- Project structure setup
- Database schema design
- Neon + Drizzle integration
- Basic user model implementation
- Clerk webhook integration
- Health check endpoint
- Type-safe schema validation with Zod
- User metadata storage
- Transaction-free database operations for Neon HTTP
- Structured logging implementation
- Webhook payload validation
- User lifecycle event handling (create/update/delete)
- Frontend implementation
- User management UI
- Role-based access control
- API documentation
- E2E testing setup
/api/health- Health check endpoint/api/webhooks/clerk- Clerk webhook endpoint for user sync
Currently implemented tables:
users- Stores user information synced from Clerk- Basic fields: id, clerkId, email, firstName, lastName
- Timestamps: createdAt, updatedAt
user_data- Stores user metadata- Flexible key-value storage
- Used for signup tracking and name history
- Clerk handles user authentication
- Webhook integration for user sync:
- User creation with metadata
- User updates with change tracking
- User deletion with cleanup
- All database operations are transaction-free for Neon HTTP compatibility
- To be implemented
- Will use React Query for data fetching
- Material UI for components
- Type-safe API client
- Environment Variables:
# Neon Database
NEON_DATABASE_URL=
# Clerk
CLERK_SECRET_KEY=
CLERK_WEBHOOK_SECRET=
# Cloudflare
CLOUDFLARE_API_TOKEN=
CLOUDFLARE_ACCOUNT_ID=- Development Commands:
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Run database migrations
pnpm db:migrate- Implement user search and filtering
- Add user profile management
- Set up frontend project structure
- Implement role-based access control
- Add API documentation
- Set up testing infrastructure