A comprehensive full-stack microservices application designed for managing product pricing, promotions, and upgrade rules. Originally developed as an internal tool, this project has been modernized into a robust, containerized solution demonstrating professional software engineering practices.
The Price Dashboard serves as a central hub for pricing strategy management. It allows administrators to:
- Visualize current and upcoming promotions.
- Calculate complex product pricing based on user history and upgrade paths.
- Manage pricing rules dynamically.
The system is built on a microservices architecture, ensuring scalability and separation of concerns.
The application is composed of several decoupled services:
- Web Service: A React-based frontend application.
- User Service: Handles authentication and user management (OAuth 2.0).
- Prices Service: Manages base product prices.
- Promotions Service: Handles promotional logic and scheduling.
- Upgrade Rules Service: Calculates pricing based on product upgrade paths.
- Infrastructure:
- Nginx: Acts as a reverse proxy and static file server.
- Redis: Provides caching for high-performance data retrieval.
- MongoDB Atlas: Cloud-hosted NoSQL database for persistence.
- Core: React 16, Redux (Module Pattern), React Router 4
- Build Tools: Webpack 4, Babel 7
- Styling: SCSS, Styled Components
- State Management: Redux Thunk, Context API
- Quality: ESLint, Prettier, Husky
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (Mongoose ODM)
- Caching: Redis
- Authentication: Google OAuth 2.0
- Containerization: Docker, Docker Compose
- CI/CD: Travis CI
- Cloud: AWS (ECS, EKS ready), Terraform
- Orchestration: Kubernetes (k8s scripts included)
Ensure you have the following installed:
- Node.js: v10.16.0 or higher (v14+ recommended for local dev outside Docker)
- npm: v6.9+
- Docker: v19.03+
- Docker Compose: v1.25+
The recommended way to run the application is via Docker Compose, which orchestrates all services and dependencies automatically.
-
Clone the repository
git clone https://github.com/DanielLin9406/fullstack-priceDashboard.git cd fullstack-priceDashboard -
Configure Environment Variables Ensure
.envfiles are set up in each service directory (services/*/). See the Environment Configuration section below. -
Start the Application
docker-compose -f docker-compose-dev.yml up
-
Access the Dashboard Open your browser and navigate to http://localhost:3050.
For individual service development, you can run services locally.
-
Install Dependencies
# Root dependencies npm install # Service dependencies npm install --prefix services/web npm install --prefix services/prices # ... repeat for other services
-
Start Redis
redis-server
-
Start Services
npm start
This will use
concurrentlyto start all services. Access the web app at http://localhost:8080.
Each service requires specific environment variables. Create a .env file in the respective service directories:
Web Service (services/web/.env)
GOOGLE_CLIENT_ID=<Your Google OAuth Client ID>
API_HOST_PRICES=http://localhost
API_PORT_PRICES=5000
# ... (see .env.example if available)Backend Services (services/prices/.env, etc.)
PORT=5000
DATABASE_URL_DEV=<Your MongoDB Atlas Connection String>
REDIS_HOST_DEV=127.0.0.1
AUTH_HOST_DEV=localhostTo run the production version locally:
docker-compose -f docker-compose-stage.yml upThis serves the optimized React build via Nginx. Access at http://localhost:3060.
- Unit Tests: Jest + Enzyme/React Testing Library
- Integration Tests: Supertest for APIs
- E2E: Cypress or Puppeteer
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
