v2/examples/05-swarm-apps/rest-api-advanced/IMPLEMENTATION-SUMMARY.md
This advanced REST API example demonstrates a production-ready e-commerce backend with comprehensive features, security, and best practices.
/api-docsrest-api-advanced/
├── src/
│ ├── config/ # Database and Redis configuration
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Custom middleware
│ ├── models/ # MongoDB schemas
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── utils/ # Utilities and helpers
│ └── validators/ # Request validation
├── tests/
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── docs/ # API documentation
├── scripts/ # Utility scripts
└── server.js # Application entry point
# Navigate to the project
cd /workspaces/claude-code-flow/examples/05-swarm-apps/rest-api-advanced
# Run the quick start script
./scripts/quick-start.sh
# Or manually:
# 1. Copy environment variables
cp .env.example .env
# 2. Install dependencies
npm install
# 3. Start services with Docker
docker-compose up -d
# 4. Seed the database
npm run seed
# 5. Start the development server
npm run dev
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test suite
npm test auth.test.js
# Run in watch mode
npm run test:watch
POST /api/v1/auth/register - User registrationPOST /api/v1/auth/login - User loginPOST /api/v1/auth/logout - User logoutPOST /api/v1/auth/refresh - Refresh tokensPOST /api/v1/auth/forgot-password - Password reset requestPOST /api/v1/auth/reset-password - Reset passwordGET /api/v1/products - List products with filtersPOST /api/v1/products - Create product (admin)GET /api/v1/products/:id - Get product detailsPUT /api/v1/products/:id - Update product (admin)DELETE /api/v1/products/:id - Delete product (admin)POST /api/v1/products/:id/reviews - Add reviewPOST /api/v1/orders - Create orderGET /api/v1/orders - List user ordersGET /api/v1/orders/:id - Get order detailsPUT /api/v1/orders/:id/cancel - Cancel orderPOST /api/v1/orders/:id/refund - Request refunddocs/README-AUTH.mddocs/API.mddocs/README-PRODUCTS-ORDERS.mddocs/postman-collection.jsontests/ directoryThis is an example project designed to demonstrate best practices. Feel free to:
This example is part of the Claude Code Flow project and follows the same license terms.