Skip to content

DessimA/delivery_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delivery System

Java Spring Boot PostgreSQL Vue.js Docker

Author: Jose Anderson da Silva Costa Repository: github.com/DessimA/delivery-system


Quick Start

Prerequisites: Docker Engine 24+ and Docker Compose v2 only. No local Java, Maven, Node, or npm required.

cp .env.example .env
cd infra
docker compose up -d
Service URL Credentials
Frontend http://localhost:5173 -
Backend API http://localhost:8080 -
Swagger UI http://localhost:8080/swagger-ui.html -
pgAdmin http://localhost:5050 admin@delivery.com / admin

Sample users (dev profile only): Create a new account via /register or use the admin account admin@fakedata.com.


VSCode Dev Container

  1. Open the project folder in VSCode
  2. Ctrl+Shift+P -> "Dev Containers: Reopen in Container"
  3. The container provides Java 21, Maven, Node 20, and Docker CLI
  4. Run cd infra && docker compose up -d inside the container terminal

Environment Variables

All configuration is centralized in .env at the project root. Copy .env.example and adjust:

cp .env.example .env

Key variables: DATABASE_URL, JWT_SECRET, CORS_ORIGINS, VITE_APP_API_BASE_URL. See .env.example for the full list with descriptions.


Hot Reload

  • Backend: Edit .java files, inotifywait detects changes, mvn compile + DevTools restart (~1-2s)
  • Frontend: Edit .vue/.js/.css files, Vite HMR updates the browser instantly

Project Structure

backend/                # Spring Boot 3.4.1 / Java 21
  src/main/java/
    config/             # Security, WebSocket, DataLoader
    controller/         # REST endpoints
    domain/valueobject/ # Cpf, Email (immutable, self-validating)
    dto/                # Java Records for API contracts
    exception/          # RestExceptionHandler, ApiError
    mapper/             # MapStruct interfaces
    model/              # JPA entities
    repository/         # Spring Data JPA
    service/            # Business logic layer
  src/main/resources/
    application.properties
    application-dev.properties
    application-prod.properties
    db/migration/       # Flyway migrations
frontend/               # Vue 3 / Vite / Pinia
  src/
    components/base/    # BaseButton, BaseInput, BaseModal, LoadingSpinner
    components/features/# Cart, Delivery, Product, Order
    composables/        # useApi, useAuth, useNotifications, useWebSocket
    config/             # env.js (centralized API URL)
    plugins/            # Axios config with interceptors
    router/             # Vue Router with auth guards
    services/           # API service layer (user, product, order, etc.)
    stores/             # Pinia stores (auth, cart)
    views/              # AppLogin, AppRegister, AppHome, AppOrders, etc.
infra/
  docker-compose.yml        # Development (default)
  docker-compose.prod.yml   # Production
  docker/
    backend/                # Dockerfile + Dockerfile.dev
    frontend/               # Dockerfile + Dockerfile.dev

Commands

# Start all services
cd infra && docker compose up -d

# Rebuild and restart a service
docker compose build backend
docker compose up -d backend

# View logs
docker compose logs -f backend

# Run tests
docker compose exec backend mvn test
docker compose exec frontend npm run test

# Full restart
docker compose down && docker compose up -d

# Reset database (deletes all data)
docker compose down -v && docker compose up -d

# Production mode
docker compose -f docker-compose.prod.yml up -d

Technology Stack

Tier Technology
Backend Java 21 (Virtual Threads), Spring Boot 3.4.1, Spring Security, Spring Data JPA
Frontend Vue 3 (Composition API), Vite, Pinia, Axios
Database PostgreSQL 16, Flyway migrations
Real-time WebSocket, STOMP, SockJS
Mapping MapStruct
Auth Stateless JWT (Bearer)
Storage Local filesystem (FileStorageService interface, swappable to S3/Cloudinary)

Documentation

Document Description
Architecture Layered architecture, DDD, data flow
Standards Naming conventions, DTO strategy, component library
Testing Testing pyramid, backend/frontend patterns
Setup Guide Docker setup, commands, architecture diagram

Module Documentation

Module Description
Payment Simulated PIX payment flow via QR Code and confirmation link
Order Order creation with item quantities and price snapshots
User Registration, profile update, CPF/email uniqueness
Establishment CRUD with active filter, restaurant ownership
Security JWT auth, WebSocket authentication, authorization rules
Delivery Delivery lifecycle, status transitions, N+1 prevention
Frontend Services API service layer, Axios interceptors, data flow

About

Delivery platform with Spring Boot 3.4 / Vue 3 / PostgreSQL. Docker-only dev with hot-reload and VSCode devcontainer.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors