REST API for the Miles room booking system. Part of the Miles Booking monorepo.
From the api/ directory:
# Install dependencies
npm install
# Set up environment
cp .env.example .env
# Edit .env with your database credentials
# Run migrations
npm run prisma:generate
npm run prisma:migrate
# Seed database
npm run prisma:seed
# Start development server
npm run devAPI will be available at http://localhost:3000
Interactive API documentation: http://localhost:3000/api-docs
- JWT authentication
- Role-based access control (Admin, Manager, User)
- Multi-location office management
- Room booking with conflict detection
- iCal calendar feed generation
- PostgreSQL database with Prisma ORM
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run start- Run production buildnpm run prisma:generate- Generate Prisma Clientnpm run prisma:migrate- Run database migrationsnpm run prisma:studio- Open Prisma Studio GUInpm run prisma:seed- Seed database with sample data
api/
├── src/
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Auth, authorization, error handling
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── types/ # TypeScript types
│ ├── utils/ # Utilities (JWT, password, Prisma)
│ ├── app.ts # Express app configuration
│ └── index.ts # Server entry point
├── prisma/
│ ├── schema.prisma # Database schema
│ └── seed.ts # Seed data
├── openapi.yaml # OpenAPI 3.0 specification
└── package.json
See the root README.md for the complete monorepo overview.