Multi-tenant SaaS platform for Umroh travel agencies
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your database credentials
# Run database migrations
npm run migration:run
# Start development server
npm run start:devRun the entire stack (Database, Redis, Backend, Frontend) with a single command:
# Make script executable (first time only)
chmod +x start-local.sh
# Start everything
./start-local.shRequirements: Docker and Docker Compose must be installed. This script will:
- Start Postgres & Redis in Docker
- Run Database Migrations
- Start the Backend API
- Start the Frontend Application
- Swagger UI: http://localhost:3000/api/docs
- Base URL: http://localhost:3000/api/v1
travel-umroh/
├── src/
│ ├── roles/ # Epic 3: Role-based access control
│ ├── whatsapp/ # Epic 9: WhatsApp stub (Phase 2)
│ ├── landing-pages/ # Epic 10: Agent landing pages (core)
│ ├── leads/ # Epic 10: Lead capture
│ ├── users/ # Epic 10: Agent branding
│ ├── app.module.ts # Main application module
│ └── main.ts # Application entry point
├── docs/
│ ├── integrations/ # Phase 2 integration guides
│ │ ├── whatsapp.md # WhatsApp Business API guide
│ │ └── chatbot.md # AI Chatbot integration guide
│ └── frontend-tasks/ # Frontend implementation specs
└── database/
└── migrations/ # Database schema migrations
- Multi-level agent hierarchy (max 3 levels)
- Granular data access control with RLS
- Agent-jamaah assignment system
- Redis caching for performance
- WhatsApp Business API stub endpoints (returns 501)
- AI Chatbot frontend specification
- Comprehensive integration documentation
- Landing page domain models and entities
- Lead capture domain models and entities
- Agent branding domain models and entities
- Template renderer service with Handlebars
- 3 responsive templates (Modern, Classic, Minimal)
- Pending: Controllers, Services, DTOs, Migration
# Development
npm run start:dev # Start with hot-reload
npm run start:debug # Start with debugger
# Production
npm run build # Build for production
npm run start:prod # Start production server
# Database
npm run migration:run # Run pending migrations
npm run migration:revert # Revert last migration
# Testing
npm run test # Run unit tests
npm run test:e2e # Run E2E tests
npm run test:cov # Generate coverage report
# Code Quality
npm run lint # Lint code
npm run format # Format code with Prettier# Create database
createdb travel_umroh
# Create user (optional)
createuser -P travel_umroh_user
# Grant permissions
psql -d travel_umroh -c "GRANT ALL PRIVILEGES ON DATABASE travel_umroh TO travel_umroh_user;"npm run migration:runFrom Epic 3:
agent_hierarchies- Multi-level agent relationshipsjamaah_assignments- Agent-jamaah access control
Copy .env.example to .env and configure:
# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=your_password
DATABASE_NAME=travel_umroh
# JWT
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=1d
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379# Assign agent to hierarchy
POST /api/v1/agents/:id/hierarchy
{
"uplineId": "uuid",
"level": 1
}
# Get agent hierarchy
GET /api/v1/agents/:id/hierarchy
# Remove from hierarchy
DELETE /api/v1/agents/:id/hierarchy# Get integration status
GET /api/v1/whatsapp/status
# Returns 501 with planned features
# Register for launch notification
POST /api/v1/whatsapp/notify-me
{
"email": "user@example.com",
"feature": "whatsapp"
}
# Returns 200 - Actually works!
# Other endpoints return 501
POST /api/v1/whatsapp/send
POST /api/v1/whatsapp/broadcast
GET /api/v1/whatsapp/conversations/:id- Bidirectional messaging
- Automated payment reminders
- Broadcast messages
- Template message system
- Full documentation:
docs/integrations/whatsapp.md
- 3 modes: Public, Agent, Admin
- Natural language understanding
- Knowledge base sync
- Lead capture and routing
- Full documentation:
docs/integrations/chatbot.md
# Run all tests
npm test
# Run with coverage
npm run test:cov
# Run E2E tests
npm run test:e2e- Epic 9 Summary:
EPIC_9_SUMMARY.md - Implementation Summary:
IMPLEMENTATION_SUMMARY.md - Developer Guide:
DEVELOPER_GUIDE.md - Files Created:
FILES_CREATED.md - WhatsApp Integration:
docs/integrations/whatsapp.md - AI Chatbot:
docs/integrations/chatbot.md - Frontend Tasks:
docs/frontend-tasks/
- Domain-Driven Design (DDD) - Clean separation of concerns
- Multi-Tenancy - Row-Level Security (RLS) for data isolation
- CQRS - Command-Query Responsibility Segregation
- Repository Pattern - Data access abstraction
- Framework: NestJS 10+
- ORM: TypeORM 0.3+
- Database: PostgreSQL 14+
- Cache: Redis 7+
- Authentication: JWT
- Documentation: Swagger/OpenAPI
- Validation: class-validator
- Row-Level Security (RLS) at database level
- JWT-based authentication
- Role-based authorization
- Input validation with class-validator
- SQL injection prevention (TypeORM)
- CORS configuration
- Environment-based secrets
GET /api/v1/healthGET /api/docs- Epic 1: Database & Multi-Tenancy
- Epic 2: Authentication & Authorization
- Epic 3: Role-Based Access Control
- Epic 4: Jamaah Management
- Epic 5: Package Management
- Epic 6: Booking System
- Epic 7: Payment Gateway
- Epic 8: Real-Time Communication
- Epic 9: Phase 2 Placeholders
- Epic 10: Agent Landing Pages
- WhatsApp Business API Integration
- AI-Powered Chatbot (3 modes)
- Advanced Reporting & Analytics
- Mobile App (React Native)
- Follow NestJS best practices
- Use TypeScript strict mode
- Write JSDoc comments for public APIs
- Include unit tests for new features
# Create feature branch
git checkout -b feature/epic-X-story-Y
# Commit with descriptive messages
git commit -m "feat(epic-X): implement story Y.Z"
# Push and create PR
git push origin feature/epic-X-story-YUNLICENSED - Proprietary software for Travel Umroh platform
For questions or issues:
- Review documentation in
docs/folder - Check
DEVELOPER_GUIDE.mdfor common issues - Review Swagger API docs at
/api/docs
Current Status: Epic 3 + Epic 9 (Stubs) Implemented Next Steps: Implement Epic 4 (Jamaah Management) Last Updated: 2025-12-22