Gahez is a comprehensive restaurant management system built with ASP.NET Core 8.0, designed to streamline restaurant operations including order management, table reservations, kitchen operations, and payment processing.
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
-
Clone the repository:
git clone <repository-url> cd OrdrMate # Swith to dev branch git checkout dev
-
Start the application with Docker Compose:
docker-compose up -d
This command will:
- Build the OrdrMate API from the Dockerfile
- Start a PostgreSQL database container
- Set up networking between containers
- Expose the API on port 5126
-
Verify the application is running:
- API: http://localhost:5126
- API Documentation (Swagger): http://localhost:5126/swagger
- Database: localhost:5432 (accessible with credentials below)
The docker-compose.yml defines the following services:
- Image: Built from the local Dockerfile
- Port: 5126 (mapped to container port 5126)
- Environment: Development mode with database connection
- Volumes:
./OrdrMateβ/app/OrdrMate(live code reloading)./logsβ/app/logs(application logs)
- Image: PostgreSQL 15
- Port: 5432 (accessible externally)
- Database:
appdb - Credentials:
- Username:
postgres - Password:
postgres
- Username:
- Data Persistence: Uses Docker volume
postgres_data
# Start all services in background
docker-compose up -d
# Start and view logs
docker-compose up
# Stop all services
docker-compose down
# Stop and remove volumes (β οΈ This will delete database data)
docker-compose down -v
# View service logs
docker-compose logs backend
docker-compose logs db
# Rebuild and restart services
docker-compose up --build
# Access backend container shell
docker-compose exec backend bash
# Access database container
docker-compose exec db psql -U postgres -d appdbThe backend service is configured with volume mounting for live code reloading:
- Changes to files in
./OrdrMateare immediately reflected in the container - No need to rebuild the Docker image for code changes
- The application automatically restarts when files change
# Run database migrations
docker-compose exec backend dotnet ef database update
# View database tables
docker-compose exec db psql -U postgres -d appdb -c "\dt"
# Access database shell
docker-compose exec db psql -U postgres -d appdb# Backend application logs
docker-compose logs -f backend
# Database logs
docker-compose logs -f db
# All services logs
docker-compose logs -f- Backend: ASP.NET Core 8.0 Web API
- Database: PostgreSQL 15
- ORM: Entity Framework Core
- Authentication: JWT with Google OAuth
- Real-time: WebSocket/SignalR
- Payment: Paymob integration
- Storage: AWS S3 for file uploads
- Notifications: Firebase Cloud Messaging
- Order Management: Complete order lifecycle with real-time updates
- Table Reservations: Queue management with waiting time estimates
- Kitchen Operations: Multi-station workflow with parallel processing
- Payment Processing: Secure payment gateway integration
- User Management: Role-based authentication (Customer, Manager, Owner, Admin)
- Real-time Updates: WebSocket integration for live notifications
The application uses the following environment variables (configured in docker-compose.yml):
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Host=db;Port=5432;Database=appdb;Username=postgres;Password=postgresappsettings.json- Production configurationappsettings.Development.json- Development overridesOrdrMate.http- HTTP client test requests
The application uses Entity Framework Core with code-first migrations. Key entities include:
- Users: Customer and staff authentication
- Restaurants: Restaurant information and settings
- Branches: Multiple locations per restaurant
- Items: Menu items with categories and pricing
- Orders: Order processing and status tracking
- Tables: Table management and reservations
- Payments: Payment processing and history
- Kitchens: Kitchen stations and workflow management
The database will be automatically created when the application starts. To run migrations manually:
# Apply pending migrations
docker-compose exec backend dotnet ef database update
# Create a new migration (after model changes)
docker-compose exec backend dotnet ef migrations add "MigrationName"The API uses JWT authentication with the following endpoints:
POST /api/customer/google-login- Google OAuth login
- Public: Registration, login, payment webhooks
- Customer: Place orders, view order history
- Branch Manager: Manage branch operations, kitchen workflow
- Restaurant Owner: Full restaurant management
- System Admin: System-wide administration
Visit http://localhost:5126/swagger to explore and test API endpoints interactively.
# Register a new user
curl -X POST http://localhost:5126/api/customer/register \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"Password123","firstName":"John","lastName":"Doe"}'
# Login
curl -X POST http://localhost:5126/api/customer/login \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"Password123"}'
# Get restaurants (requires authentication)
curl -X GET http://localhost:5126/api/restaurant \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Logs are written to the ./logs directory and are accessible both from the host and container:
# View logs from host
tail -f ./logs/app.log
# View logs from container
docker-compose exec backend tail -f /app/logs/app.log# Backend application logs
docker-compose logs -f backend
# Database logs for troubleshooting
docker-compose logs -f db- Technical Documentation: See
/docsfolder for detailed system architecture - API Documentation: Available at http://localhost:5126/swagger when running
- Mermaid Diagrams: Complete system diagrams in
/docsfolder
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test with Docker:
docker-compose up --build - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
OrdrMate - Streamlining restaurant operations with modern technology π½οΈ