Lover Shop is a full-stack e-commerce web application built using React with Vite for the frontend, Spring Boot for the backend, and MongoDB as the database. This setup leverages Docker to containerize each service, simplifying deployment and development with isolated environments.
- Project Overview
- Tech Stack
- Prerequisites
- Setup Instructions
- Docker Configuration
- Common Docker Commands
- Troubleshooting
Lover Shop provides a user-friendly platform for users to browse and purchase products. It utilizes Docker for streamlined development and deployment, ensuring that all services are containerized and can be run in any environment that supports Docker.
- Frontend: React with Vite (development server and hot-reloading).
- Backend: Spring Boot (Java) for REST APIs.
- Database: MongoDB (hosted).
- Containerization: Docker and Docker Compose.
Make sure the following tools are installed on your system:
git clone <repository-url>
cd <project-directory>Create a .env file in the root directory of the project to store sensitive information and required configurations.
SPRING_DATA_MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net-SPRING_DATA_MONGODB_DATABASE=LoverShopUse Docker Compose to build and start all services in detached mode:
docker-compose up --build -d- The frontend service will be accessible at: http://localhost:5173
- The backend service will be accessible at: http://localhost:8080
Start the Containers
docker-compose upBuild the Containers
docker-compose up --build-
MongoDB Connection Errors:Ensure your MongoDB URI and credentials in the .env file are correct. Verify that MongoDB Atlas allows connections from your IP address.
-
Frontend Not Loading: Make sure the frontend service is running on http://localhost:5173. Check for any network issues or blocked ports.
-
Backend API Not Responding: Ensure the backend service is running and reachable on http://localhost:8080. Check Docker logs for any error messages in the backend container.