A Flask-based e-commerce platform with automated CI/CD pipeline and AWS deployment.
-
User Authentication and Authorization
- User registration and login
- Admin dashboard
- Role-based access control
-
Product Management
- Product catalog with search
- Stock management
- Category organization
-
Shopping Cart
- Add/remove items
- Update quantities
- Persistent cart storage
-
Order Processing
- Secure checkout
- Order history
- Order status tracking
-
Admin Features
- Sales dashboard
- Order management
- Product inventory
- User management
- Backend: Flask 2.x
- Database: SQLAlchemy with SQLite
- Frontend: Bootstrap 5
- Testing: pytest
- CI/CD: GitHub Actions
- Deployment: AWS EC2, Nginx, Gunicorn
- OS: Amazon Linux 2
- Clone the repository:
git clone https://github.com/NirajanMahara/devops-ecommerce-application.git
cd devops-ecommerce-application
- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env
# Edit .env with your configurations
- Run the application:
python run.py
Run the test suite:
pytest
The application is deployed on AWS EC2 with:
- Amazon Linux 2
- Python 3.9
- Nginx as reverse proxy
- Gunicorn as application server
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION (ca-central-1)
- EC2_SSH_KEY
- EC2_HOST
- EC2_USER (ec2-user)
- Push to main branch
- GitHub Actions runs tests
- If tests pass, deploys to EC2
- Sets up Python environment
- Configures Nginx and Gunicorn
- Starts the application
ecommerce-app/
├── app/
│ ├── models/ # Database models
│ ├── routes/ # Route handlers
│ ├── templates/ # HTML templates
│ └── static/ # Static files
├── deployment/ # Deployment configurations
├── tests/ # Test files
├── .github/ # GitHub Actions workflow
└── requirements.txt # Python dependencies
- Email: [email protected]
- Password: Admin@123
- View application logs:
sudo journalctl -u ecommerce
- Restart application:
sudo systemctl restart ecommerce
- Check Nginx status:
sudo systemctl status nginx
- Password hashing with bcrypt
- CSRF protection
- Secure session handling
- Role-based access control
- Input validation and sanitization
Nirajan Mahara Santosh Khanal Kshitij Chaudhary
MIT License