Quick Start Guide
This guide will walk you through creating your first Express.js project with Cepress Generator. You'll have a fully functional API with authentication and documentation in under 5 minutes.
Step 1: Create Your Project
Run the Cepress Generator command and follow the interactive prompts:
npx create-cepress-app my-api Interactive Configuration
You'll be asked several questions to configure your project:
- • SQLite (default — quick setup)
- • PostgreSQL (production ready)
- • MySQL (popular choice)
Type-safe database client (recommended for PostgreSQL/MySQL)
- • Tanpa Auth
- • JWT Auth (Register/Login with password hashing)
- • Tidak pakai Swagger
- • Swagger (OpenAPI 3.0 docs)
- • User + Post (with relationships)
- • Kosong (blank project)
Step 2: Install Dependencies
Navigate to your project directory and install the dependencies:
cd my-api
npm install Step 3: Configure Environment
Copy the example environment file and configure your settings:
cp .env.example .env Edit the .env file with your configuration:
# Server Configuration
PORT=3000
NODE_ENV=development
# Database (SQLite example)
DATABASE_URL=file:./dev.db
# JWT Secret (change this!)
JWT_SECRET=your-super-secret-jwt-key
# For Prisma (if selected)
# DATABASE_URL="postgresql://user:password@localhost:5432/mydb" Step 4: Set Up Database (If Using Prisma)
If you selected Prisma, run the initial migration:
npx prisma migrate dev --name init Step 5: Start Development Server
Start your API server:
npm run dev Your API will be available at http://localhost:3000
Step 6: Test Your API
✅ Basic Endpoints
GET /- Welcome messageGET /health- Health checkGET /api- API info
🔐 Auth Endpoints (if enabled)
POST /api/auth/registerPOST /api/auth/loginGET /api/auth/profile
Test with curl
# Test basic endpoint
curl http://localhost:3000/
# Test API info
curl http://localhost:3000/api
# Register a new user (if auth is enabled)
curl -X POST http://localhost:3000/api/auth/register -H "Content-Type: application/json" -d '{"email": "test@example.com", "password": "password123"}' Step 7: Explore API Documentation
If you enabled Swagger documentation, visit:
📚 Swagger UI
http://localhost:3000/api-docs
Interactive API documentation where you can test endpoints directly in the browser.
Next Steps
🏗️ Build Your Models
Add custom models to src/models/ and create corresponding routes in src/routes/.
🔒 Secure Your API
Add middleware for rate limiting, CORS configuration, and request validation.
🚀 Deploy
Deploy to Heroku, Vercel, Railway, or any Node.js hosting platform.
Congratulations!
You now have a production-ready Express.js API with modern tooling. Explore the generated code to understand the project structure and customize it for your needs.