Skip to content

jacob-majesty/ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ E-Commerce Platform

E-Commerce App Logo

A full-stack e-commerce application built with modern technologies, featuring secure authentication, payment processing, and cloud deployment capabilities.

πŸ—οΈ Architecture Overview

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

πŸ› οΈ Technology Stack

Frontend

  • 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

Backend

  • 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

Infrastructure

  • 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

πŸ“ Project Structure

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

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 18+ (for local frontend development)
  • Java 17+ (for local backend development)
  • MySQL (if running locally without Docker)

Running with Docker (Recommended)

  1. Clone the repository:
git clone https://github.com/jacob-majesty/ecommerce.git
cd ecommerce
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
  1. Start the application:
docker-compose up --build
  1. Access the application:

Local Development

Backend Development

cd backend
./mvnw spring-boot:run

Frontend Development

cd frontend
npm install
ng serve

πŸ”§ Configuration

Environment Variables

Create 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_...

Database Setup

The application uses Flyway for database migrations. Migrations are located in:

  • Backend: backend/src/main/resources/db/migration/

πŸ“š API Documentation

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 & Security

  • 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)

πŸ’³ Payment Integration

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)

πŸš€ Deployment

AWS Lightsail Deployment

  1. Build and push containers:
docker-compose -f docker-compose.prod.yml build
docker-compose -f docker-compose.prod.yml push
  1. Deploy to Lightsail:
  • Use AWS Lightsail container service
  • Configure environment variables
  • Set up SSL certificates with Let's Encrypt
  • Configure domain and DNS

CI/CD Pipeline

The project includes GitHub Actions workflows for:

  • Automated testing on pull requests
  • Docker image building and pushing
  • Deployment to staging/production environments

πŸ§ͺ Testing

Backend Tests

cd backend
./mvnw test

Frontend Tests

cd frontend
npm test

πŸ“– Architecture Decision Records

Detailed architectural decisions are documented in the docs/adr/ directory:

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

For issues and questions:

About

Full-Stack E-commerce Platform - Monorepo with Spring Boot backend and Angular frontend. Complete with Docker, CI/CD, and production-ready features.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors