Skip to content

ecomera-ecosystem/ecomera-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

178 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ecomera Backend

Backend CI Qodana Docker Release codecov

Modern e-commerce platform backend built with Spring Boot 3, featuring JWT authentication, comprehensive API documentation, automated CI/CD, and production-ready infrastructure.


πŸ“‹ Table of Contents


✨ Features

Core Functionality

  • πŸ” JWT Authentication - Secure user registration and login with access/refresh tokens
  • πŸ›οΈ Product Catalog - CRUD operations, search, filtering, and pagination
  • πŸ“¦ Order Management - Complete order lifecycle with status tracking
  • πŸ’³ Payment Processing - Multiple payment methods (PayPal, Credit Card, Bank Transfer)
  • πŸ‘€ User Profiles - Profile management with last login tracking

Infrastructure & DevOps

  • πŸš€ CI/CD Pipeline - Automated testing, building, and Docker image publishing via GitHub Actions
  • 🐳 Docker Support - Multi-stage Dockerfile and Docker Compose for local development
  • πŸ“Š Code Quality - Qodana static analysis and JaCoCo code coverage
  • πŸ” Security Scanning - CodeQL vulnerability detection
  • πŸ“ Database Versioning - Liquibase migrations for schema management
  • πŸ•°οΈ Audit Trail - Hibernate Envers for entity change tracking

Developer Experience

  • πŸ“– Interactive API Docs - Swagger/OpenAPI 3.0 with try-it-out functionality
  • 🎯 Exception Handling - Global error handling with consistent JSON responses
  • βœ… Input Validation - Bean validation with detailed error messages
  • πŸ”„ Hot Reload - Spring Boot DevTools for rapid development

πŸ›  Technology Stack

Core Framework

  • Java 17 - LTS version with modern language features
  • Spring Boot 3.5.9 - Latest Spring Boot 3 with native support
  • Spring Security 6 - OAuth2 resource server with JWT

Database & Persistence

  • PostgreSQL 16 - Primary database (production)
  • H2 Database - In-memory database (testing)
  • Spring Data JPA - Data access with Hibernate 6
  • Liquibase - Database migration management
  • Hibernate Envers - Entity auditing and versioning

Caching & Performance

  • Redis 7 - Distributed caching (planned)
  • HikariCP - High-performance JDBC connection pooling

Testing

  • JUnit 5 - Unit testing framework
  • Mockito - Mocking framework for isolated tests
  • Testcontainers - Integration testing with real databases
  • JaCoCo - Code coverage analysis

Documentation & Code Quality

  • Swagger/OpenAPI 3.0 - Interactive API documentation
  • MapStruct - Type-safe bean mapping
  • Lombok - Boilerplate code reduction
  • Qodana - JetBrains code quality analysis

DevOps & Deployment

  • Docker - Containerization with multi-stage builds
  • Docker Compose - Local multi-service orchestration
  • GitHub Actions - CI/CD automation
  • Maven - Dependency management and build tool

πŸ— Architecture

High-Level Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Client Applications                      β”‚
β”‚          (Web Browser, Mobile App, Third-party)             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ HTTPS
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    API Gateway (Future)                      β”‚
β”‚              Load Balancer + Rate Limiting                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Spring Boot Backend                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚ Controllers  β”‚  β”‚  Services    β”‚  β”‚ Repositories β”‚      β”‚
β”‚  β”‚  (REST API)  β”‚β†’ β”‚ (Business    β”‚β†’ β”‚  (Data       β”‚      β”‚
β”‚  β”‚              β”‚  β”‚  Logic)      β”‚  β”‚   Access)    β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚         β”‚                  β”‚                   β”‚             β”‚
β”‚         β–Ό                  β–Ό                   β–Ό             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚          Spring Security (JWT Filter)            β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚               β”‚               β”‚
         β–Ό               β–Ό               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PostgreSQL  β”‚  β”‚   Redis     β”‚  β”‚  External    β”‚
β”‚  Database   β”‚  β”‚  (Cache)    β”‚  β”‚  Payment     β”‚
β”‚             β”‚  β”‚             β”‚  β”‚  Gateway     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Entity-Relationship Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    User     β”‚         β”‚    Order     β”‚         β”‚   Payment   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€         β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€         β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ id (UUID)   │────────<β”‚ user_id      │────────>β”‚ order_id    β”‚
β”‚ email       β”‚    1:N  β”‚ id (UUID)    β”‚   1:1   β”‚ id (UUID)   β”‚
β”‚ password    β”‚         β”‚ status       β”‚         β”‚ amount      β”‚
β”‚ firstName   β”‚         β”‚ totalPrice   β”‚         β”‚ method      β”‚
β”‚ lastName    β”‚         β”‚ orderDate    β”‚         β”‚ status      β”‚
β”‚ role        β”‚         β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚ txnId       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                       β”‚
       β”‚                       β”‚ 1:N
       β”‚ 1:N                   β–Ό
       β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚              β”‚  OrderItem   β”‚
       β”‚              β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
       β”‚              β”‚ order_id     β”‚
       β”‚              β”‚ product_id   │───┐
       β”‚              β”‚ quantity     β”‚   β”‚
       β”‚              β”‚ unitPrice    β”‚   β”‚ N:1
       β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
       β”‚                                 β”‚
       β–Ό                                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Token    β”‚                 β”‚   Product    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                 β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ user_id     β”‚                 β”‚ id (UUID)    β”‚
β”‚ token       β”‚                 β”‚ title        β”‚
β”‚ type        β”‚                 β”‚ description  β”‚
β”‚ expired     β”‚                 β”‚ price        β”‚
β”‚ revoked     β”‚                 β”‚ stock        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚ category     β”‚
                                β”‚ imageUrl     β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Request Flow

1. Client Request
   β”‚
   β–Ό
2. JWT Authentication Filter
   β”‚
   β”œβ”€ Valid Token? ─> Yes ─> Extract User ─┐
   β”‚                                        β”‚
   └─ No ─> Return 401 Unauthorized         β”‚
                                            β–Ό
3. Controller (REST Endpoint)
   β”‚
   β”œβ”€ @Valid Request? ─> Yes ─> Continue ──┐
   β”‚                                        β”‚
   └─ No ─> Return 400 Bad Request          β”‚
                                            β–Ό
4. Service Layer (Business Logic)
   β”‚
   β”œβ”€ Business Rules OK? ─> Yes ─> Continue ─┐
   β”‚                                          β”‚
   └─ No ─> Throw BusinessException           β”‚
                                              β–Ό
5. Repository Layer (Data Access)
   β”‚
   β”œβ”€ Entity Found? ─> Yes ─> Return Data ───┐
   β”‚                                          β”‚
   └─ No ─> Throw ResourceNotFoundException   β”‚
                                              β–Ό
6. Mapper (DTO Conversion)
   β”‚
   β–Ό
7. Response to Client (JSON)

πŸ“¦ Prerequisites

Before you begin, ensure you have the following installed:

Optional:

  • PostgreSQL 16 (if running without Docker)
  • Redis 7 (for caching, planned feature)
  • IntelliJ IDEA or VS Code with Java extensions

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/ecomera-ecosystem/ecomera-backend.git
cd ecomera-backend

2. Run with Docker Compose (Recommended)

# Copy environment template
cp .env.docker.example .env.docker

# Edit .env.docker with your values (database password, JWT secret, etc.)
nano .env.docker

# Start all services (PostgreSQL, Redis, pgAdmin, Backend)
docker-compose up --build

# Or run in background
docker-compose up -d --build

Access the application:

3. Run Locally (Without Docker)

# Install dependencies and build
mvn clean install

# Run the application
mvn spring-boot:run

# Or run the JAR
java -jar target/ecomera-0.1.0.jar

Default configuration uses H2 in-memory database - perfect for quick testing!


🐳 Docker Setup

Using Makefile Commands

# Start all services
make up

# Start in background
make up-d

# View logs
make logs

# Stop all services
make down

# Restart everything
make restart

# Clean up (remove volumes)
make clean

# Database shell
make db-shell

# Redis CLI
make redis-cli

# Backend container shell
make backend-shell

Manual Docker Commands

# Build and start
docker-compose up --build

# Stop services
docker-compose down

# View running containers
docker-compose ps

# View logs
docker-compose logs -f backend

# Execute command in backend container
docker exec -it ecomera-backend sh

Environment Variables

Create .env.docker from template:

# Database
DB_URL=jdbc:postgresql://postgres:5432/ecomera
DB_USER=postgres
DB_PASS=your_secure_password

# JWT
JWT_SECRET_KEY=your_base64_secret_key
JWT_EXPIRATION_TIME=3600000
REFRESH_EXPIRATION_TIME=604800000

# Redis
REDIS_HOST=redis
REDIS_PORT=6379

πŸ“– API Documentation

Swagger UI (Interactive)

Open your browser and navigate to:

http://localhost:8080/swagger-ui/index.html

Authentication Flow

  1. Register a new user:
   POST /api/v1/auth/register
   Content-Type: application/json

   {
     "firstname": "John",
     "lastname": "Doe",
     "email": "john.doe@example.com",
     "password": "SecurePass123!",
     "role": "USER"
   }
  1. Login to get JWT token:
   POST /api/v1/auth/authenticate
   Content-Type: application/json

   {
     "email": "john.doe@example.com",
     "password": "SecurePass123!"
   }

Response:

   {
     "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
     "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
   }
  1. Use token in subsequent requests:
   GET /api/v1/auth/me
   Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

API Endpoints Summary

Method Endpoint Description Auth Required
Authentication
POST /api/v1/auth/register Register new user ❌
POST /api/v1/auth/authenticate Login user ❌
GET /api/v1/auth/me Get current user βœ…
POST /api/v1/auth/refresh-token Refresh access token βœ…
Products
GET /api/v1/products List all products ❌
GET /api/v1/products/{id} Get product by ID ❌
POST /api/v1/products Create product βœ… Admin
PUT /api/v1/products/{id} Update product βœ… Admin
DELETE /api/v1/products/{id} Delete product βœ… Admin
GET /api/v1/products/search Search products ❌
GET /api/v1/products/category/{category} Filter by category ❌
Orders
POST /api/v1/orders Create order βœ…
GET /api/v1/orders List all orders βœ… Admin
GET /api/v1/orders/{id} Get order details βœ…
GET /api/v1/orders/user/{userId} Get user orders βœ…
PUT /api/v1/orders/{id}/status Update order status βœ… Admin
Payments
POST /api/v1/payments Create payment βœ…
GET /api/v1/payments/{id} Get payment details βœ…
PUT /api/v1/payments/{id} Update payment βœ… Admin

πŸ’» Development

Running the Application

# Development mode with hot reload
mvn spring-boot:run

# With custom profile
mvn spring-boot:run -Dspring-boot.run.profiles=dev

# Debug mode
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

Building the Project

# Clean and build
mvn clean install

# Skip tests
mvn clean install -DskipTests

# Build Docker image
docker build -t ecomera-backend:latest .

Code Formatting

# Format code (if using Spotless)
mvn spotless:apply

# Check formatting
mvn spotless:check

πŸ§ͺ Testing

Run All Tests

# Unit + Integration tests
mvn test

# With coverage report
mvn clean verify

# View coverage report
open target/site/jacoco/index.html

Test Categories

Unit Tests:

# Run only unit tests
mvn test -Dtest="*Test"

Integration Tests:

# Run only integration tests
mvn test -Dtest="*IT"

Code Coverage:

  • Target: 70% line coverage
  • Current: ~0% (work in progress)
  • Tool: JaCoCo + Codecov

πŸ—„ Database Migrations

Liquibase Commands

# Apply pending migrations
mvn liquibase:update

# Rollback last changeset
mvn liquibase:rollback -Dliquibase.rollbackCount=1

# View migration history
mvn liquibase:history

# Generate database documentation
mvn liquibase:dbDoc
open target/liquibase-docs/index.html

# Validate changelogs
mvn liquibase:validate

# Tag current state
mvn liquibase:tag -Dliquibase.tag=v0.1.0

# Rollback to tag
mvn liquibase:rollback -Dliquibase.rollbackTag=v0.1.0

Migration Files

Located in src/main/resources/db/changelog/changes/

changes/
└── v0.1.0/
    β”œβ”€β”€ 001-create-users-table.xml
    β”œβ”€β”€ 002-create-tokens-table.xml
    β”œβ”€β”€ 003-create-products-table.xml
    β”œβ”€β”€ 004-create-orders-table.xml
    β”œβ”€β”€ 005-create-order-items-table.xml
    └── 006-create-payments-table.xml

πŸ”„ CI/CD Pipeline

GitHub Actions Workflows

Backend CI (backend-ci.yml)

  • Triggers: Push/PR to master or development
  • Steps:
    1. Checkout code
    2. Set up JDK 17
    3. Build with Maven
    4. Run tests
    5. Upload coverage to Codecov
    6. Upload test results

Qodana Code Quality (qodana.yml)

  • Static code analysis
  • Code quality checks
  • Security vulnerability scanning
  • Coverage thresholds (50% fresh, 40% total)

CodeQL Security (codeql.yml)

  • Security vulnerability detection
  • Automatic PR comments on issues
  • Sarif report generation

Docker Release (docker-release.yml)

  • Triggers: Push to master, tags v*.*.*
  • Steps:
    1. Build multi-stage Docker image
    2. Tag with version and latest
    3. Push to Docker Hub
    4. Cache layers for faster builds

Auto Labeler (labeler.yml)

  • Automatically labels PRs/issues
  • Based on file patterns and keywords
  • Syncs label definitions

Build Status

Check current build status:


πŸ“ Project Structure

ecomera-backend/
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/          # GitHub Actions CI/CD
β”‚   β”œβ”€β”€ labels.yml          # Label definitions
β”‚   └── labeler.yml         # Auto-labeling rules
β”œβ”€β”€ docs/                   # Documentation
β”‚   └── LIQUIBASE.md       # Database migration guide
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ java/com/youssef/ecomera/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/               # Authentication module
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ controller/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ dto/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ entity/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ repository/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ security/       # JWT, filters
β”‚   β”‚   β”‚   β”‚   └── service/
β”‚   β”‚   β”‚   β”œβ”€β”€ common/             # Shared components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ audit/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ entity/         # BaseEntity
β”‚   β”‚   β”‚   β”‚   └── exception/      # Global exception handling
β”‚   β”‚   β”‚   β”œβ”€β”€ config/             # Spring configuration
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OpenApiConfig.java
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SecurityConfig.java
β”‚   β”‚   β”‚   β”‚   └── AuditConfig.java
β”‚   β”‚   β”‚   β”œβ”€β”€ domain/             # Business domains
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ order/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ payment/
β”‚   β”‚   β”‚   β”‚   └── product/
β”‚   β”‚   β”‚   └── user/               # User module
β”‚   β”‚   └── resources/
β”‚   β”‚       β”œβ”€β”€ db/changelog/       # Liquibase migrations
β”‚   β”‚       β”œβ”€β”€ application.properties
β”‚   β”‚       └── liquibase.properties.template
β”‚   └── test/                       # Test files
β”œβ”€β”€ target/                         # Build output
β”œβ”€β”€ .env.docker.example            # Docker environment template
β”œβ”€β”€ .gitignore
β”œβ”€β”€ docker-compose.yml             # Multi-service orchestration
β”œβ”€β”€ Dockerfile                     # Multi-stage build
β”œβ”€β”€ Makefile                       # Development shortcuts
β”œβ”€β”€ pom.xml                        # Maven configuration
└── README.md

🀝 Contributing

We welcome contributions! Please follow these guidelines:

Getting Started

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

Commit Convention

We follow Conventional Commits:

feat(auth): add user profile endpoint
fix(jwt): resolve expiration bug
docs(api): update API documentation
refactor(order): simplify service logic
test(payment): add unit tests
chore(deps): update dependencies

Code Style

  • Follow Google Java Style Guide
  • Use Lombok for boilerplate reduction
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation

Pull Request Checklist

  • Tests pass locally (mvn test)
  • Code follows project style
  • Documentation updated
  • No merge conflicts
  • Meaningful commit messages
  • Swagger annotations added for new endpoints

πŸ“„ License

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

MIT License

Copyright (c) 2026 Youssef Ammari

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

πŸ“ž Contact & Support

Author: Youssef Ammari
Email: youssef.ammari.795@gmail.com
GitHub: @Ammari-Youssef

Getting Help


🎯 Roadmap

Sprint 1 (Code Quality & Features)

  • Refactor mappers with BaseMapper pattern
  • Add DTO validation across all controllers
  • Enable Redis caching for product catalog
  • Fix Qodana code quality warnings
  • Increase test coverage to 70%

Sprint 2 (Testing & Features)

  • Add Cart & CartItem entities
  • Implement checkout workflow
  • Write integration tests
  • Add product search with Elasticsearch

Sprint 3 (Production Ready)

  • Add monitoring (Prometheus + Grafana)
  • Implement rate limiting
  • Add API versioning
  • Performance optimization

Future

  • Migrate to microservices architecture
  • Add Kafka for event-driven communication
  • Kubernetes deployment
  • GraphQL API alongside REST

πŸ™ Acknowledgments


⭐ If you find this project helpful, please consider giving it a star!


Built with ❀️ by Youssef Ammari

About

Spring Boot backend service for the Ecomera Ecosystem secure, scalable APIs with CI/CD and Docker support.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages