A comprehensive full-stack application designed to facilitate the exchange of books between users. This platform features a robust Java Spring Boot backend and a dynamic React frontend, ensuring a seamless user experience.
- Backend: Java 17, Spring Boot 3.2.5, Spring Security, JWT, Spring Data JPA
- Frontend: React 18, Material UI (MUI), Redux, Axios
- Database: MySQL
- Build Tools: Maven (Backend), npm (Frontend)
Ensure you have the following installed on your machine:
- Java Development Kit (JDK) 17 or higher.
- Node.js (LTS recommended) and npm.
- MySQL Server.
- Open your MySQL Workbench or Command Line.
- Create a new database named
mf_suger_uat(this is the default name configured in the application).CREATE DATABASE mf_suger_uat;
- Import the provided SQL dump file
BookExchange_SQL_Dump.sql(located in the root directory) into this new database.- Command Line:
mysql -u root -p mf_suger_uat < BookExchange_SQL_Dump.sql - Workbench: Server -> Data Import -> Import from Self-Contained File.
- Command Line:
-
Navigate to the backend directory:
cd Book_Exchange_Platform_Backend -
Configuration: Open
src/main/resources/application.propertiesand verify the database configuration matches your local setup:spring.datasource.url=jdbc:mysql://localhost:3306/mf_suger_uat spring.datasource.username=root spring.datasource.password=root server.port=6464
- Note: Update the username and password if your local MySQL credentials are different.
- Note: Check
spring.mvc.cors.allowed-originsand update it tohttp://localhost:3000to allow requests from your local frontend.
-
Run the Application: You can run the application using the Maven wrapper included in the project:
- Windows:
./mvnw.cmd spring-boot:run
- Mac/Linux:
./mvnw spring-boot:run
- Alternatively, if you have Maven installed globally:
mvn spring-boot:run
The backend server will start on port
6464. - Windows:
-
Open a new terminal and navigate to the UI directory:
cd Book_Exchange_Platform_UI -
Install Dependencies:
npm install
- If you encounter dependency conflicts, try:
npm install --legacy-peer-depsornpm install --force
- If you encounter dependency conflicts, try:
-
Run the Application:
npm start
The application will launch in your default browser at
http://localhost:3000.
To deploy this application for production:
- Generate the JAR file:
./mvnw clean package
- The executable JAR will be created in the
targetdirectory (e.g.,BookExchange-0.0.1-SNAPSHOT.jar). - Run the JAR on your server:
java -jar target/BookExchange-0.0.1-SNAPSHOT.jar
- Create a production build:
npm run build
- This will create a
buildfolder with static assets. - Serve these static files using a web server like Nginx, Apache, or deploy them to a static site host (Netlify, Vercel, S3).
- Note: Ensure the frontend API calls point to your production backend URL.
- Ensure both Backend and Database are running.
- Open
http://localhost:3000in your web browser. - Register a new account or log in with existing credentials (if provided in the SQL dump).