This project was developed as a backend and frontend assignment using Spring Boot, Javascript, and integration with the Fake Store API.
The purpose was to build a simple web shop application with product management, authentication, and order handling.
- Fetches product data from the Fake Store API and stores it in a local SQL database.
- Provides a web frontend to display all products.
- Implements a layered architecture: Controller β Service β Repository.
- Includes integration tests for API validation.
- For higher grade (VG), the project extends functionality with login, roles, and order management.
-
Fake Store API Integration
Fetch all products from the external API and save them to the database. -
Database Persistence
Store products in a local SQL database. -
Frontend
Display products in a web interface. -
Architecture
Code is structured in multiple layers: Controller β Service β Repository. -
Integration Test
Tests verifies that products returned from the Fake Store API include all relevant attributes.
-
Authentication & Authorization
Implemented with Spring Security.- USER role: Can purchase products.
- ADMIN role: Can view and delete orders.
-
User Registration
Registration page allows creating accounts with USER or ADMIN roles. -
Database Sync
On application startup, the database synchronizes with the Fake Store API:- Products removed from API are deleted from the database.
- New products are added.
-
Order Management
- USER can place an order.
- ADMIN can view and manage all orders.
- Java 17
- Spring Boot
- Spring Data JPA / Hibernate
- Spring Security
- Vite
- JavaScript
- HTML5
- BootStrap
- MySQL
- JUnit for testing
- Gradle
web-shop-aaa/
βββ backend/ # Spring Boot backend service
β βββ src/ # Java source code (controllers, services, repositories, entities)
β βββ build.gradle # Gradle configuration
β βββ ...
βββ frontend/ # Vanilla JS frontend (Vite)
β βββ index.html # App entry point
β βββ main.js # Main JS file
β βββ package.json # Frontend dependencies
β βββ ...
βββ README.md # Project documentation
-
Clone the repository:
git clone https://github.com/cfrank3N/web-shop-aaa.git cd web-shop-aaa -
Configure the database:
Updateapplication.propertieswith your database connection settings. -
Build and run the backend:
./gradlew bootRun
-
Build and run the Frontend
Navigate to the frontend folder:
cd frontendInstall dependencies:
npm install
Start the Vite dev server:
npm run dev
-
Access the app:
Open the app in your browser at http://localhost:5173
This project was developed as part of a course assignment.
Contributors: