Author: Jose Anderson da Silva Costa Repository: github.com/DessimA/delivery-system
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.
- Open the project folder in VSCode
Ctrl+Shift+P-> "Dev Containers: Reopen in Container"- The container provides Java 21, Maven, Node 20, and Docker CLI
- Run
cd infra && docker compose up -dinside the container terminal
All configuration is centralized in .env at the project root.
Copy .env.example and adjust:
cp .env.example .envKey variables: DATABASE_URL, JWT_SECRET, CORS_ORIGINS, VITE_APP_API_BASE_URL.
See .env.example for the full list with descriptions.
- Backend: Edit
.javafiles,inotifywaitdetects changes,mvn compile+ DevTools restart (~1-2s) - Frontend: Edit
.vue/.js/.cssfiles, Vite HMR updates the browser instantly
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
# 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| 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) |
| 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 | 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 |