A simple Fast-Food Restaurant Backend API built with Java Spring Boot and MongoDB. This project simulates a burger shop ordering system with menus, ingredients, and order calculations.
-
Ingredient Management
- Store ingredients with category and price
- Retrieve ingredient list from MongoDB
-
Menu Management
- Create menus containing multiple ingredients
- Each ingredient has a specific amount
-
Menu Price Calculation
- Automatically calculates total menu cost from ingredient prices
- Uses MongoDB aggregation
-
Order API
- Accepts menu orders
- Calculates total order price
-
Swagger API Documentation
- Interactive API testing UI
- Java 25 – Backend language
- Spring Boot – REST API framework
- MongoDB – NoSQL database
- Maven – Dependency management
- Swagger / OpenAPI – API documentation
- Docker – Containerized deployment
src/main/java/com/codeburger/codeburgerapi
├── controller # REST API endpoints
├── service # Business logic
├── repository # MongoDB repositories
├── entity # Database models
├── dto # Request / Response objects
└── CodeBurgerApiApplication.javagit clone https://github.com/nnewtrp/CodeBurgerApi.git
cd CodeBurgerApi./mvnw clean installCreate application.properties inside:
src/main/resources/Example configuration:
spring.data.mongodb.uri=mongodb://localhost:27017/codeburger
server.port=5000
server.servlet.contextPath=/api./mvnw spring-boot:runor
java -jar target/CodeBurgerApi-0.0.1-SNAPSHOT.jarSwagger UI will be available at:
http://localhost:5000/api/swagger-ui.htmlYou can test all API endpoints directly from the browser.
Build the image:
docker build -t codeburger-api .Run the container:
docker run -p 5000:5000 codeburger-apiThis project can be deployed on platforms like:
- Railway
- Render
- Amazon Web Services
Example Railway configuration:
Build command:
./mvnw clean package -DskipTestsStart command:
java -jar target/*.jarFor more information about the technologies used:
- Spring Boot – https://spring.io/projects/spring-boot
- MongoDB – https://www.mongodb.com/docs/
- Swagger / OpenAPI – https://swagger.io/docs/
- Docker – https://docs.docker.com/
⭐ If you find this project useful, feel free to star the repository!