This repository contains the Spring Boot backend and two Vite/React front-end portals (employee and vendor) for managing reservations for a book fair.
book_fair_backend/– Spring Boot REST API and persistence layer.bookfair-employee/– Employee-facing React application.bookfair-vendor/– Vendor-facing React application.
Make sure the following tools are installed locally:
- Java 21 and Maven (the project ships with the Maven wrapper so a global Maven install is optional).
- Node.js 18+ and npm for the React front-ends.
- PostgreSQL running locally with a database that matches your configuration.
- Copy
book_fair_backend/src/main/resources/application.ymland update the database connection, mail, and other environment-specific properties as needed (defaults point at a local PostgreSQL database namedbook_fair). - Ensure the configured PostgreSQL database is running and accessible.
- From the
book_fair_backenddirectory, start the API:On Windows, usecd book_fair_backend ./mvnw spring-boot:runmvnw.cmd spring-boot:run. - The backend will listen on
http://localhost:8080by default.
Both front-ends are Vite applications that expect the API base URL to be provided through the VITE_API_BASE_URL environment variable.
- Install dependencies (only required the first time):
cd bookfair-employee npm install - Provide the API base URL, e.g. create a
.env.localfile containingVITE_API_BASE_URL=http://localhost:8080/api/v1. - Start the development server:
npm run dev
- Vite will print the local URL (typically
http://localhost:5173) where you can access the employee portal.
- Install dependencies:
cd bookfair-vendor npm install - Provide the API base URL (for example via
.env.localwithVITE_API_BASE_URL=http://localhost:8080/api/v1). - Launch the development server:
npm run dev
- Access the vendor portal at the Vite URL shown in the terminal (defaults to
http://localhost:5173, or another free port if already in use).
To produce optimized assets run npm run build inside each front-end directory. The backend can be packaged with ./mvnw clean package which generates a runnable JAR in book_fair_backend/target.
Employee self-signup has been disabled. Four operational accounts are provisioned automatically when the backend starts (see book_fair_backend/src/main/resources/application.yml). Use the following credentials to access the employee portal:
| Team | Password | Phone | |
|---|---|---|---|
| Operations Desk A | ops-a@bookfair.lk |
OpsDesk@2024 |
+94 770 000 101 |
| Operations Desk B | ops-b@bookfair.lk |
OpsDesk@2024 |
+94 770 000 102 |
| Finance Review | finance@bookfair.lk |
Finance@2024 |
+94 770 000 103 |
| Floor Supervisor | floor@bookfair.lk |
Floor@2024 |
+94 770 000 104 |
- Edit the
bookfair.employee-seed.accountslist insidebook_fair_backend/src/main/resources/application.yml. Each entry requiresbusinessName,contactNumber,email, andpasswordfields. - Restart the backend. Any account whose email is not already present in the
userstable will be created automatically with the EMPLOYEE role. - Rotate credentials by updating the password in the YAML file and deleting the matching user row from the database (or adjust it manually) before restarting the service.
git logs