ProductStore is a microservices-based application designed to manage products, clients, and sales. It leverages a combination of Java Spring Boot services and a Next.js frontend, orchestrated using Docker Compose for seamless development and deployment.
To demonstrate security, the first user created can perfor CRUD operations while the rest of the users can just buy products.
- product-service: Handles product-related operations.
- client-service: Manages client information and interactions.
- sale-service: Processes sales transactions and related logic.
- next-products-app: Frontend application built with Next.js.
- docker-compose.yml: Defines and manages multi-container Docker applications.
Ensure you have the following installed on your system:
-
Clone the repository:
git clone https://github.com/ChrystianMSC/ProductStore.git cd ProductStore -
Build and start the services:
docker-compose up --build
This command will build the Docker images and start all the services defined in the docker-compose.yml file.
Them you can move to the next-products-app directory in another terminal and run:
npm i
npm run dev-
Access the application:
- Frontend (Next.js app): http://localhost:3000
- Product Service API: http://localhost:8081
- Client Service API: http://localhost:8082
- Sale Service API: http://localhost:8083
Ensure these ports are not occupied by other applications.
To work on individual services:
-
Navigate to the desired service directory:
cd product-service -
Run the service locally:
./mvnw spring-boot:run
Repeat the above steps for client-service and sale-service as needed.
-
For the frontend application:
cd next-products-app npm install npm run dev
This will start the Next.js development server on http://localhost:3000.
Each service includes its own set of tests. To run tests for a specific service:
-
Navigate to the service directory:
cd product-service -
Execute the tests:
./mvnw test
Repeat for other services as needed.