Before diving into the backend development, let's overview the simple architecture for our backend app. Here's a breakdown of how the components will interact and function:
Frontend Application (Shareholder)
Backend Services
Equity Service: This is the core business logic of our application. It will respond to four events:
Database
MongoDB: Simple database to store shareholder and company data. We will have two main collections:
To proceed with development, we need to add MongoDB as a dependency to our service. We have two ways to run MongoDB:
We will use Docker to run MongoDB. Here's a step-by-step guide to setting it up:
Create a Docker Compose File:
Configuration Details:
Run Docker Compose:
Additional Setup:
To run the MongoDB container:
docker-compose up
command.docker ps
.By following these steps, we now have a Docker setup for a MongoDB instance ready to support the backend services. This setup ensures our backend app can handle business logic efficiently while maintaining data integrity and persistence.