Comprehensive management system designed specifically for restaurants, bars, and food service establishments. Sailor provides complete control over daily operations including point of sale (POS), table management, kitchen operations, inventory, invoicing, cash register closure, reservations, and analytical reports.
- Table Management (Floor Plan): Visual table administration with real-time status (available, occupied, reserved)
- Point of Sale (POS): Complete order system with product catalog, quantities, and notes
- Kitchen Operations: Specialized view for kitchen staff with order status tracking (Pending, Preparation, Ready, Delivered)
- Inventory Management: Ingredient control with current stock, minimum levels, movements (PURCHASE, ADJUSTMENT, CONSUMPTION), and product recipes
- Invoicing: Invoice generation from orders with multiple payment support (Cash, Card)
- Cash Register Closure: Daily sales summary, comparison between expected and actual balance, closure history
- Reservations: Table reservation management by time slot with availability validation
- Reports: Daily sales analysis, sales by product, orders by status, ingredient consumption, and reservations
- Staff Management (RBAC): Role-based access control (ADMIN, MESERO, COCINA, CAJA, INVENTARIO, GERENCIA)
- Secure Authentication: JWT system with access tokens (15 min) and refresh tokens (7 days)
- Language: Java 21
- Framework: Spring Boot 3.3.0
- Database: MySQL 8
- ORM: Hibernate JPA
- Security: Spring Security + JWT (JJWT 0.12.3)
- Build Tool: Maven
- Framework: React 18
- Bundler: Vite
- Routing: React Router DOM
- State Management: Context API (AuthContext)
- Styling: Custom CSS
- Orchestration: Docker + Docker Compose
- Reverse Proxy: Nginx with HTTPS support
- Certificates: Self-signed SSL/TLS (development)
- Hot Reload: Vite HMR with WebSocket enabled
┌─────────────────────────────────────────┐
│ Nginx (Reverse Proxy) │
│ HTTP (80) → HTTPS (443) │
│ /api/* → backend:8080 │
│ /* → frontend:5173 │
└─────────────────────────────────────────┘
↓ ↓
┌──────────────────┐ ┌──────────────────┐
│ Backend (API) │ │ Frontend (Web) │
│ Spring Boot │ │ React + Vite │
│ Port: 8080 │ │ Port: 5173 │
└──────────────────┘ └──────────────────┘
↓
┌──────────────────┐
│ MySQL DB │
│ Port: 3306 │
│ (3307 host) │
└──────────────────┘
- Docker 20.10+
- Docker Compose 2.0+
- Java JDK 21
- Maven 3.8+
- Node.js 18+ (with npm)
- MySQL 8.0+
This is the fastest and easiest way to run the complete stack.
-
Clone the repository
git clone https://github.com/AArCh95/Sailor.git cd Sailor -
Start all services
docker compose up -d --build
-
Access the application
- HTTPS (production): https://localhost
- HTTP: http://localhost (automatically redirects to HTTPS)
- Direct API: http://localhost:8080
- Direct frontend: http://localhost:5173
-
Ports used
80: HTTP (redirects to HTTPS)443: HTTPS (Nginx)8080: Backend API (Spring Boot)5173: Frontend Dev Server (Vite)3307: MySQL (port exposed on host)
-
Default users
- Admin:
[email protected]/admin123 - User:
[email protected]/user123
- Admin:
-
Stop services
docker compose down
-
Remove volumes (reset database)
docker compose down -v
-
Configure local MySQL
- Create database:
sailor - User:
sailor/ Password:sailor123 - Port:
3307(or3306depending on your installation)
- Create database:
-
Update configuration (if needed)
Edit
backend/src/main/resources/application.yml:spring: datasource: url: jdbc:mysql://localhost:3307/sailor
-
Build and run
cd backend mvn clean package mvn spring-boot:runOr run directly:
mvn clean package java -jar target/sailor-0.0.1-SNAPSHOT.jar
-
Access the API
-
Install dependencies
cd frontend npm install -
Configure proxy (if needed)
Verify
frontend/vite.config.js:server: { proxy: { '/api': { target: 'http://localhost:8080', changeOrigin: true } } }
-
Run development server
npm run dev
-
Access the application
-
Build for production
npm run build
Sailor/
├── backend/ # Spring Boot Backend
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/sailor/
│ │ │ │ ├── config/ # Configuration (Security, CORS, DataInitializer)
│ │ │ │ ├── controller/ # REST Controllers
│ │ │ │ ├── dto/ # Data Transfer Objects
│ │ │ │ ├── entity/ # JPA Entities
│ │ │ │ ├── repository/ # Spring Data Repositories
│ │ │ │ ├── service/ # Business Logic
│ │ │ │ └── SailorApplication.java
│ │ │ └── resources/
│ │ │ └── application.yml
│ │ └── test/
│ ├── Dockerfile
│ └── pom.xml
│
├── frontend/ # React + Vite Frontend
│ ├── src/
│ │ ├── App.jsx # Main component and router
│ │ ├── AuthContext.jsx # Authentication context
│ │ ├── HomePage.jsx
│ │ ├── LoginPage.jsx
│ │ ├── MesasPage.jsx
│ │ ├── ProductosPage.jsx
│ │ ├── PedidosPage.jsx
│ │ ├── CocinaPage.jsx
│ │ ├── FacturasPage.jsx
│ │ ├── InventarioPage.jsx
│ │ ├── ReservasPage.jsx
│ │ ├── ReportesPage.jsx
│ │ ├── StaffPage.jsx
│ │ ├── CierreCajaPage.jsx
│ │ └── index.css
│ ├── Dockerfile
│ ├── vite.config.js
│ └── package.json
│
├── nginx/ # Nginx Configuration
│ ├── nginx.conf
│ └── certs/ # Self-signed SSL certificates
│
├── docker-compose.yml # Container orchestration
├── .gitignore
├── README.md
├── CLAUDE.md # Claude Code instructions
├── CONTRIBUTING.md # Contributor guide
└── SETUP.md # Detailed setup guide
GET /health- Health checkPOST /auth/login- LoginPOST /auth/refresh- Refresh access token
- Tables:
GET /mesas,POST /mesas - Products:
GET /productos,POST /productos - Orders:
GET /pedidos,POST /pedidos,GET /pedidos/{id} - Invoices:
GET /facturas,POST /facturas - Payments:
POST /pagos - Ingredients:
GET /insumos,POST /insumos,PUT /insumos/{id} - Movements:
GET /insumos/movimientos,POST /insumos/movimientos - Recipes:
GET /recetas,POST /recetas - Reservations:
GET /reservas,POST /reservas,POST /reservas/{id}/cancelar - Reports:
GET /reportes/* - Users (ADMIN only):
GET /usuarios,POST /usuarios,PUT /usuarios/{id}/rol,DELETE /usuarios/{id} - Cash Register:
GET /cierre-caja,POST /cierre-caja,GET /cierre-caja/resumen-dia
This project uses a Git-based workflow with feature branches and Pull Requests.
-
Clone the repository (if you haven't already)
git clone https://github.com/AArCh95/Sailor.git cd Sailor -
Update your local copy
git checkout main git pull origin main
-
Create a new branch
git checkout -b feature/your-feature-name
Branch naming conventions:
feature/- New functionalityfix/- Bug fixesui/- Interface improvementsrefactor/- Code refactoringdocs/- Documentation
-
Make your changes and commit
git add . git commit -m "Clear description of changes"
-
Push your branch
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub targeting the
mainbranch
- Use descriptive commit messages in English
- Be specific about what changed and why
- Examples:
- ✅ "Add stock validation to order creation"
- ✅ "Fix cash register closure difference calculation"
- ❌ "Fix bug"
- ❌ "Update"
-
Ensure the code compiles without errors
# Backend cd backend && mvn clean package # Frontend cd frontend && npm run build
-
Test your changes with Docker Compose
docker compose up --build
-
Verify you haven't included sensitive files (
.env, credentials, etc.)
For more details, see CONTRIBUTING.md.
- NEVER commit
.envfiles to the repository - NEVER include credentials, API keys, or secrets in code
- Use environment variables for sensitive configuration
- Certificates in
nginx/certs/are self-signed and for development only - In production, use valid certificates (Let's Encrypt, etc.)
- JWT secret key is in
application.ymlfor development - In production, use environment variables or secret management services
- Default credentials are for local development only
- In production, use strong passwords and rotate periodically
This project is licensed under the MIT License - see the LICENSE file for details.
To report security vulnerabilities, see our Security Policy.
- Change all default credentials (database, users, JWT secret)
- Use valid SSL/TLS certificates (not the included self-signed ones)
- Configure environment variables for secrets (see
.env.example) - Review the Security Policy for best practices
This software is provided "as is", without warranty of any kind. See the MIT LICENSE for more information.
Contributions are welcome! Please see CONTRIBUTING.md for the process.
Built with ❤️ for the food service industry