Skip to content

Spring Security project with roles. Athentication with JWT. Uses our own Spring API . Frontend built with Vite-JS.

Notifications You must be signed in to change notification settings

cfrank3N/web-shop-aaa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Web Shop – Java Spring Boot Project

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.


πŸ“‹ Project Overview

  • 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.

βœ… Features (Pass / Grade G Requirements)

  • 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.


⭐ Additional Features (Distinction / Grade VG Requirements)

  • 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.

πŸ› οΈ Technologies Used

  • Java 17
  • Spring Boot
  • Spring Data JPA / Hibernate
  • Spring Security
  • Vite
  • JavaScript
  • HTML5
  • BootStrap
  • MySQL
  • JUnit for testing
  • Gradle

πŸ“‚ Project Structure

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

πŸš€ Getting Started

  1. Clone the repository:

    git clone https://github.com/cfrank3N/web-shop-aaa.git
    cd web-shop-aaa
  2. Configure the database:
    Update application.properties with your database connection settings.

  3. Build and run the backend:

    ./gradlew bootRun
  4. Build and run the Frontend

    Navigate to the frontend folder:

     cd frontend

    Install dependencies:

     npm install

    Start the Vite dev server:

     npm run dev
  5. Access the app:
    Open the app in your browser at http://localhost:5173


πŸ‘₯ Contributors

This project was developed as part of a course assignment.
Contributors:


About

Spring Security project with roles. Athentication with JWT. Uses our own Spring API . Frontend built with Vite-JS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •