Skip to content

nnewtrp/CodeBurgerApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍔 CodeBurger API

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.


✨ Features

  • 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

🛠️ Tech Stack

  • Java 25 – Backend language
  • Spring Boot – REST API framework
  • MongoDB – NoSQL database
  • Maven – Dependency management
  • Swagger / OpenAPI – API documentation
  • Docker – Containerized deployment

📂 Project Structure

src/main/java/com/codeburger/codeburgerapi

├── controller      # REST API endpoints
├── service         # Business logic
├── repository      # MongoDB repositories
├── entity          # Database models
├── dto             # Request / Response objects
└── CodeBurgerApiApplication.java

🚀 Getting Started

1️⃣ Clone the repository

git clone https://github.com/nnewtrp/CodeBurgerApi.git
cd CodeBurgerApi

2️⃣ Install Dependencies

./mvnw clean install

3️⃣ Configure MongoDB

Create application.properties inside:

src/main/resources/

Example configuration:

spring.data.mongodb.uri=mongodb://localhost:27017/codeburger
server.port=5000
server.servlet.contextPath=/api

4️⃣ Run the Application

./mvnw spring-boot:run

or

java -jar target/CodeBurgerApi-0.0.1-SNAPSHOT.jar

📖 API Documentation

Swagger UI will be available at:

http://localhost:5000/api/swagger-ui.html

You can test all API endpoints directly from the browser.


🐳 Docker Deployment

Build the image:

docker build -t codeburger-api .

Run the container:

docker run -p 5000:5000 codeburger-api

☁️ Cloud Deployment

This project can be deployed on platforms like:

  • Railway
  • Render
  • Amazon Web Services

Example Railway configuration:

Build command:

./mvnw clean package -DskipTests

Start command:

java -jar target/*.jar

📜 Learn More

For more information about the technologies used:


⭐ If you find this project useful, feel free to star the repository!

About

A simple Fast-Food Restaurant API built with Spring Boot and MongoDB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors