Demo credentials (all with password Password1234$
):
Username | Role |
admin |
Administrator (full access) |
manager |
Manager (reporting and management) |
worker |
Staff (day-to-day operations) |
The Table Talk backend is a Spring Boot application that provides a robust API for managing restaurant operations. It features real-time communication through WebSockets, secure authentication, and a comprehensive set of REST endpoints for table, order, menu, and product management.
- RESTful API: Complete set of endpoints for managing all aspects of the restaurant
- WebSocket Support: Real-time updates for kitchen and table order management
- Authentication & Authorization: Secure user authentication and role-based access control
- Database Integration: Persistent storage with PostgreSQL
- Data Validation: Comprehensive input validation and error handling
- Printing Support: Integration with receipt and kitchen printers
- Framework: Spring Boot 3.x
- Language: Java 17
- Database: PostgreSQL
- ORM: Spring Data JPA
- API Documentation: Swagger/OpenAPI
- Security: Spring Security with JWT
- Real-time Communication: WebSocket (STOMP)
- Build Tool: Maven
- Containerization: Docker
- JDK 17+
- Maven
- PostgreSQL (or Docker)
-
Clone the repository:
git clone https://gitlab.com/goromigue/tt-bar-manager.git cd tt-bar-manager/tt-spring
-
Configure database in
application.properties
:FRONTEND_URL=http://localhost:5173 SPRING_DATASOURCE_URL=jdbc:postgresql://postgres-db:5432/tabletalk SPRING_DATASOURCE_USERNAME=user SPRING_DATASOURCE_PASSWORD=tableuser SPRING_JPA_HIBERNATE_DDL_AUTO=update SPRING_JPA_SHOW_SQL=false JWT_SECRET=yourStrongSecretKeyHere JWT_EXPIRATION_MS=86400000
-
Build the application:
mvn clean install
-
Run the application:
mvn spring-boot:run
-
The API will be available at http://localhost:8080
The backend follows a layered architecture with the following components:
- REST controllers that handle HTTP requests
- WebSocket message handlers
- Business logic implementation
- Transaction management
- JPA repositories for database operations
- Entity mappings
- Objects for data exchange with clients
- Separation from internal entities
- Conversion between entities and DTOs
- Using MapStruct for efficient mapping
The backend exposes several endpoints for different aspects of the application:
- /auth: Authentication endpoints
- /menu: Menu and category management
- /products: Product information and stock management
- /orders: Order creation and management
- /tables: Table management
- /map: Restaurant layout management
- /kitchen: Kitchen-specific endpoints
- /invoice: Invoice generation and management
- /print: Printing service integration
For detailed API documentation, refer to the API Documentation.
The application includes different types of tests:
# Run unit tests
mvn test
# Run integration tests
mvn verify -P integration-test
Database schema is managed through JPA entity definitions with Hibernate DDL:
spring.jpa.hibernate.ddl-auto=update
For production, it's recommended to use a proper database migration tool like Flyway or Liquibase.
This project is licensed under the MIT License - see the LICENSE file for details.