This project consists of two main components:
- quick-commerce-backend: A Spring Boot application for backend services.
- quick-commerce-client: A React frontend application built with Vite.
Ensure you have the following installed on your system:
- Java 21
- Node.js 20
- MySQL (or any preferred database)
- Docker and Docker Compose
-
Navigate to the backend directory:
cd quick-commerce-backend -
Create an
application.ymlfile insidesrc/main/resourcesand configure your database:server: port: 8080 servlet: logging: request-details: true spring: application: name: QUICK-COMMERCE-SERVER datasource: url: jdbc:mysql://localhost:3306/quick_commerce username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver jpa: hibernate: ddl-auto: update show-sql: true security: enabled: false devtools: restart: enabled: true web: resources: add-mappings: false logging: level: root: INFO org.springframework.web: DEBUG com.roshan798: TRACE org.springframework.security: DEBUG jwt: secret: <your_jwt_secret> # eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMTIzIiwiaWF0IjoxNjkxMjM0NT Y3LCJleHAiOjE3MjEyMzQ1Njd9.Gh1ZMzGkxflF3UQwzK79uVf5_TLpDhH_4hzlP4FJbW8
-
Build the project:
./mvnw clean install
-
Run the backend:
./mvnw spring-boot:run
- Navigate to the client directory:
cd quick-commerce-client - Install dependencies:
npm install
- Create a
.envfile in the root directory and set up your API URL:VITE_API_URL=http://localhost:8080/api
- Start the frontend application:
npm run dev
- Add the following property in your application.yml file:
datasource:
# url: jdbc:mysql://localhost:3306/quick_commerce
url: jdbc:mysql://mysql:3306/quick_commerce # for docker container- Ensure Docker and Docker Compose are installed on your system.
- Build and start the application using Docker Compose:
docker-compose -f docker-compose.yml up --build- To stop the containers, run:
docker-compose down- To rebuild the containers without using the cache:
docker-compose build --no-cacheFeel free to fork the repository and create pull requests for improvements.