This project is a backend system for an e-commerce platform, consisting of multiple microservices built using Flask and SQLAlchemy. It includes microservices for user authentication (auth_service
), order management (order_service
), and product management (product_service
).
- Clone the repository:
git clone https://github.com/SHIV000000/e_commerce_backend.git
cd e_commerce_backend
pip install -r requirements.txt
Install PostgreSQL and create a database for each microservice.
Update the database URIs in the config.py files of each microservice (e.g., auth_service/config.py, order_service/config.py, product_service/config.py).
Create a .env file in the root directory. Add environment variables for secret keys, database URIs, etc. For example:
SECRET_KEY=your_secret_key
SQLALCHEMY_DATABASE_URI=postgresql://username:password@localhost/ecommerce_db
Run each microservice:
cd auth_service
python app.py
cd order_service
python app.py
cd product_service
python app.py
Access the APIs at the following endpoints:
Authentication Service: http://localhost:5000 Order Service: http://localhost:5001 Product Service: http://localhost:5002
Run tests for each microservice:
cd auth_service/tests
python -m unittest discover -s . -p 'test_*.py'
cd order_service/tests
python -m unittest discover -s . -p 'test_*.py'
cd product_service/tests
python -m unittest discover -s . -p 'test_*.py'