Skip to content

eliastrk/food-fast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FoodFast

Version française

FoodFast is a Java prototype of a meal delivery platform developed as part of a component-oriented programming project.

The project combines several standard backend concerns:

  • object-oriented modeling of business entities
  • application logic around orders
  • collection-based search operations in Java
  • error handling with a custom exception
  • concurrency with ExecutorService and ConcurrentHashMap
  • PostgreSQL persistence through JDBC and PreparedStatement

Features

  • create customers, dishes, and orders
  • compute the total price of an order
  • manage the lifecycle of an order with OrderStatus
  • add orders to a delivery platform
  • search by identifier, customer, or status
  • simulate restaurant preparation with a possible failure
  • basic logging through a singleton logger
  • store orders in PostgreSQL

Structure

src/main/java/
  Application.java
  customer/
  delivery/
  dish/
  exceptions/
  logger/
  order/
  restaurant/
  util/

src/test/java/
  DeliveryPlatformTest.java
  DishTest.java
  FoodFastUtilsTest.java
  OrderTest.java

db/
  init.sql

Technologies

  • Java
  • Maven
  • JUnit 5
  • PostgreSQL
  • Docker Compose

Start the Database

docker-compose up -d

The local PostgreSQL database is initialized automatically with the schema defined in db/init.sql.

Inspect the Database

To check the orders stored in the database:

docker exec -it foodfast-db psql -U postgres -d foodfast -c "SELECT * FROM orders;"

Build and Run

mvn clean package
mvn exec:java -Dexec.mainClass=Application

Run the Tests

mvn test

Database Connection Variables

The project uses the following defaults:

  • FOODFAST_DB_URL=jdbc:postgresql://localhost:5432/foodfast
  • FOODFAST_DB_USER=postgres
  • FOODFAST_DB_PASS=postgres

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages