A full-stack e-commerce application built with modern technologies, featuring secure authentication, payment processing, and cloud deployment capabilities.
This project follows a modular monolith architecture with clear separation between frontend and backend services:
- Frontend: Angular 17 + TypeScript + Bootstrap
- Backend: Spring Boot 3.2 + Java 17 + MySQL
- Authentication: Auth0 OAuth2/OIDC
- Payments: Stripe integration
- Deployment: AWS Lightsail with Docker containers
- Framework: Angular 17.3.0 with TypeScript 5.4
- UI Library: Bootstrap 5.3.8 with ng-bootstrap
- Authentication: Auth0 Angular SDK
- Payment Processing: Stripe.js
- Icons: Font Awesome
- Development: Angular CLI with Jasmine/Karma testing
- Framework: Spring Boot 3.2.5 with Java 17
- Database: MySQL with Spring Data JPA + Hibernate
- Security: Spring Security with OAuth2 Resource Server
- API: RESTful APIs with Spring Data REST
- Payments: Stripe Java SDK
- Database Migrations: Flyway
- Build Tool: Maven
- Containerization: Docker with multi-stage builds
- Web Server: Nginx (frontend serving)
- Application Server: Embedded Tomcat (Spring Boot)
- Cloud Provider: AWS Lightsail
- Database: MySQL managed instance
- SSL/TLS: Let's Encrypt certificates
ecommerce/
βββ .github/workflows/ # CI/CD pipelines
βββ docs/adr/ # Architecture Decision Records
βββ backend/ # Spring Boot application
β βββ src/main/java/ # Java source code
β βββ src/main/resources/ # Configuration & migrations
β βββ docs/adr/ # Backend-specific ADRs
β βββ Dockerfile # Backend container build
βββ frontend/ # Angular application
β βββ src/app/ # Angular source code
β βββ docs/adr/ # Frontend-specific ADRs
β βββ Dockerfile # Frontend container build
βββ docker-compose.yml # Local development environment
βββ docker-compose.dev.yml # Development configuration
βββ README.md # This file
- Docker and Docker Compose
- Node.js 18+ (for local frontend development)
- Java 17+ (for local backend development)
- MySQL (if running locally without Docker)
- Clone the repository:
git clone https://github.com/jacob-majesty/ecommerce.git
cd ecommerce- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Start the application:
docker-compose up --build- Access the application:
- Frontend: http://localhost:80
- Backend API: http://localhost:8080
- API Documentation: http://localhost:8080/api
cd backend
./mvnw spring-boot:runcd frontend
npm install
ng serveCreate a .env file in the root directory:
# Database Configuration
MYSQL_DATABASE=ecommerce
MYSQL_USER=your_username
MYSQL_ROOT_PASSWORD=your_password
# Auth0 Configuration
AUTH0_DOMAIN=your-auth0-domain
AUTH0_CLIENT_ID=your-auth0-client-id
AUTH0_REDIRECT_URI=http://localhost:80
AUTH0_AUDIENCE=http://localhost:8080
# Stripe Configuration
STRIPE_SECRET_KEY=sk_test_...
STRIPE_PUBLISHABLE_KEY=pk_test_...The application uses Flyway for database migrations. Migrations are located in:
- Backend:
backend/src/main/resources/db/migration/
The backend exposes RESTful APIs at /api endpoint. Key endpoints include:
- Products:
/api/products - Orders:
/api/orders - Users:
/api/users - Payments: Integrated via Stripe
- Authentication: Auth0 OAuth2/OIDC integration
- Authorization: JWT tokens with role-based access
- API Security: Spring Security with resource server configuration
- Payment Security: Stripe handles all payment data (PCI compliant)
The application integrates with Stripe for payment processing:
- Frontend: Stripe.js for secure payment forms
- Backend: Stripe Java SDK for payment processing
- Security: Card data never touches our servers (Stripe Elements)
- Build and push containers:
docker-compose -f docker-compose.prod.yml build
docker-compose -f docker-compose.prod.yml push- Deploy to Lightsail:
- Use AWS Lightsail container service
- Configure environment variables
- Set up SSL certificates with Let's Encrypt
- Configure domain and DNS
The project includes GitHub Actions workflows for:
- Automated testing on pull requests
- Docker image building and pushing
- Deployment to staging/production environments
cd backend
./mvnw testcd frontend
npm testDetailed architectural decisions are documented in the docs/adr/ directory:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Check the Architecture Decision Records for technical decisions
- Review the API documentation when running locally
- Open an issue for bug reports or feature requests
