A modern short-term apartment rental booking platform built with Node.js, TypeScript, and Express.
- User Management: Registration, authentication with JWT
- Apartment Listings: CRUD operations for apartment management
- Booking System: Create and manage apartment bookings
- Rate Limiting: Built-in API rate limiting for security
- Caching: Redis-powered caching for optimal performance
- Queue Processing: Background job processing with BullMQ
- API Documentation: Interactive Swagger/OpenAPI documentation
- Security: Comprehensive security headers and CORS configuration
- Runtime: Node.js >= 20.0.0
- Language: TypeScript
- Framework: Express.js
- Database: PostgreSQL with Sequelize ORM
- Cache: Redis
- Queue: BullMQ
- Authentication: JWT
- Documentation: TSOA (TypeScript OpenAPI)
- Monitoring: Grafana + Loki + Alloy
- Testing: Mocha + Supertest
- Container: Docker & Docker Compose
- Node.js >= 20.0.0
- npm >= 10.0.0 (or pnpm recommended)
- Docker & Docker Compose
- PostgreSQL (if running locally without Docker)
- Redis (if running locally without Docker)
-
Clone the repository
git clone https://github.com/Jendorski/booklet.git cd booklet -
Install dependencies
pnpm install # or npm install -
Environment setup
cp .env.example .env # Edit .env with your configuration -
Start services with Docker
# Start all services (backend, redis, monitoring) docker compose up -d # For development with hot reload docker compose -f docker-compose-dev.yml up
-
Run database migrations
pnpm migrate
-
Access the application
-
Start PostgreSQL and Redis services
-
Build the application
pnpm build
-
Start the server
pnpm start
-
Development mode with hot reload
pnpm build:test:watch
The project uses Mocha as the testing framework with Supertest for API testing.
# Run all tests once
pnpm test
# Run tests in watch mode for development
pnpm build:test:watch- Integration Tests: API endpoint testing with
.ispec.tsfiles - Service Tests: Business logic testing with
.ispec.tsfiles - Test Database: Separate test environment with Docker
Tests follow the pattern:
- Controllers:
*.controller.ispec.ts(integration tests) - Services:
*.service.ispec.ts(integration tests)
pnpm build # Build TypeScript to JavaScript
pnpm start # Start production server
pnpm migrate # Run database migrations
pnpm swagger # Generate Swagger/OpenAPI specs
pnpm lint # Run ESLint
pnpm tsc # Type check without emittingInteractive API documentation is available at /docs when the server is running:
- Swagger UI: https://cloud-run-source-deploy-264795560183.europe-west1.run.app/docs
- Health Check: https://cloud-run-source-deploy-264795560183.europe-west1.run.app/api/v1/health
src/
├── modules/ # Feature modules
│ ├── apartment/ # Apartment management
│ ├── booking/ # Booking system
│ └── user/ # User management
├── shared/ # Shared utilities
│ ├── config/ # Configuration
│ ├── middlewares/ # Express middlewares
│ ├── jwt/ # JWT utilities
│ └── logger/ # Logging setup
├── database/ # Database setup
│ ├── models/ # Sequelize models
│ └── migrations/ # Database migrations
└── cache/ # Redis caching
- Fork the repository
- Create a feature branch (
git checkout -b feat/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feat/new-feature) - Create a Pull Request
This project is licensed under the CC0-1.0 License - see the LICENSE file for details.