Skip to content

Delivery system with microservices architecture and a Flutter mobile app. Integrates with Azure Service Bus and Azure Functions for asynchronous and scalable communication between services, as well as real-time order tracking, automatic email sending, and push notifications.

Notifications You must be signed in to change notification settings

oarthurfc/delivery-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

190 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Delivery System

A complete delivery management system developed as an academic project at PUC Minas, implementing a modern architecture with a Flutter mobile app, backend microservices, and serverless cloud infrastructure.

πŸŽ₯ Demonstration

πŸ“‚ Demonstration videos are organized in the docs/videos folder of this repository.

Complete System Demo

Watch on YouTube

🎬 Complete Demo: Mobile + Microservices + Serverless

Video demonstrating all integrated system features

πŸš€ Overview

The Delivery project is a complete solution for delivery management and tracking, providing dedicated interfaces for customers and drivers. The system was developed following modern architecture principles, focusing on scalability, performance, and user experience.

Key features:

  • πŸ“± Hybrid mobile app developed with Flutter
  • πŸ”§ Microservices architecture for the backend
  • ☁️ Azure Functions integration for serverless processing
  • πŸ“ Real-time tracking with geolocation
  • πŸ”” Push notifications and email system
  • πŸ“Έ Photo capture for delivery confirmation
  • 🐰 Asynchronous communication via RabbitMQ

πŸ—οΈ Architecture Preview

System Architecture

More architecture details are available in the Backend documentation: backend/README.md

πŸ“ Project Structure

delivery/
β”œβ”€β”€ mobile/                   # Flutter mobile app
β”‚   β”œβ”€β”€ lib/                  # Dart source code
β”‚   β”œβ”€β”€ android/              # Android configuration
β”‚   β”œβ”€β”€ ios/                  # iOS configuration
β”‚   └── pubspec.yaml          # Flutter dependencies
β”‚
β”œβ”€β”€ backend/                  # Microservices and API Gateway
β”‚   β”œβ”€β”€ docker-compose.yml    # Service orchestration
β”‚   β”œβ”€β”€ api-gateway/          # API Gateway (Spring Cloud Gateway)
β”‚   β”œβ”€β”€ auth-service/         # Authentication service (Node.js)
β”‚   β”œβ”€β”€ order-service/        # Order service (Java 21)
β”‚   β”œβ”€β”€ tracking-service/     # Tracking service (Node.js)
β”‚   β”œβ”€β”€ setup-all.sh/.bat     # Auto-setup scripts
β”‚   β”œβ”€β”€ .env.example          # Example environment variables
β”‚   └── README.md             # Backend documentation
β”‚
β”œβ”€β”€ cloud/                    # Cloud infrastructure
β”‚   └── functions/            # Azure Functions serverless
β”‚       β”œβ”€β”€ src/              # Functions source code
β”‚       β”œβ”€β”€ package.json      # Node.js dependencies
β”‚       └── host.json         # Azure Functions config
β”‚
└── docs/                     # Project documentation
  β”œβ”€β”€ diagramas/              # Architecture diagrams
  β”œβ”€β”€ especificacoes_entregas/# Delivery specifications
  └── videos/                 # Demo videos

πŸ—οΈ Development Phases

Phase 1: Mobile Development - Docs

The first phase focused on building the Flutter mobile app, implementing separate interfaces for customers and drivers. Features include real-time tracking, order history, photo capture with geolocation for delivery proof, and offline storage with SQLite. Push notifications, preferences via Shared Preferences, and robust error handling (connectivity issues, denied permissions) were also implemented.

Phase 2: Microservices Architecture - Docs

In the second phase, the backend was developed using a microservices architecture, creating independent services for authentication (JWT), order management (full CRUD), real-time tracking, and notifications. Communication between services is both synchronous (REST) and asynchronous (messaging), with an API Gateway centralizing routing and authentication. This ensures scalability, maintainability, and fault isolation.

Phase 3: Serverless Infrastructure - Docs

The final phase integrated serverless components into the existing architecture, complementing traditional microservices with Azure Functions. This includes a robust notification system using serverless functions, integration between RabbitMQ and Azure Functions for asynchronous email and push processing, and real-time event management. The result is a hybrid infrastructure combining microservices reliability with serverless scalability and low operational cost.

πŸš€ Running the Project

Prerequisites

  • Flutter SDK (3.0+)
  • Dart SDK
  • Android Studio / Xcode (for mobile development)
  • Docker (for microservices)
  • Node.js 20+ (for Node.js services)
  • Java 21 JDK (for Java services)
  • Maven (included in project wrappers)
  • Azure account (for serverless functions)

Running the Mobile App

cd mobile/
flutter pub get
flutter run

Running the Microservices

  1. Go to the backend folder:
cd backend/
  1. Set up environment variables:
cp .env.example .env
# Edit .env as needed
  1. Run the automatic setup:

Windows:

./setup-all.bat

Linux/Mac:

chmod +x setup-all.sh
./setup-all.sh

Or manually:

docker-compose up --build -d

Services that will start:

  • API Gateway (port 8000): Single entry point for all APIs
  • Auth Service (port 3000): Manages authentication and JWT
  • Order Service (port 8080): Order management
  • Tracking Service (port 8081): Real-time tracking
  • MongoDB: Database for authentication
  • PostgreSQL: Databases for orders and tracking
  • RabbitMQ: Messaging system

Deploying Serverless (Azure Functions)

  1. Go to the functions folder:
cd functions-sb/
  1. Install dependencies:
npm install
  1. Configure Azure environment variables:
# Configure according to your Azure account
  1. Deploy to Azure:
func azure functionapp publish <function-app-name>

🌐 Service URLs

After successful startup, services are available at:

Service URL Description
🌐 API Gateway http://localhost:8000 Main entry point
πŸ” Auth Service http://localhost:3000 Authentication & authorization
πŸ“¦ Order Service http://localhost:8080 Order management
πŸ“ Tracking Service http://localhost:8081 Real-time tracking
πŸ“– Tracking Docs http://localhost:8081/api/docs Swagger documentation
🐰 RabbitMQ http://localhost:15672 Management UI

Databases

Database Host Port User Password
PostgreSQL (Orders) localhost 5432 delivery_user delivery_pass
PostgreSQL (Tracking) localhost 5433 root root
MongoDB localhost 27017 root rootpassword

πŸ§ͺ Testing the System

Quick Health Check

# Health check for all services
curl http://localhost:3000/health       # Auth
curl http://localhost:8080/health       # Orders  
curl http://localhost:8081/api/tracking/health  # Tracking
curl http://localhost:8000/health       # Gateway

Test via API Gateway

# All requests go through the gateway
curl http://localhost:8000/api/auth/health
curl http://localhost:8000/api/orders/health
curl http://localhost:8000/api/tracking/health

πŸ”§ Useful Commands

# View logs for all services
docker-compose logs -f

# View logs for a specific service
docker-compose logs -f tracking-service

# Stop all services
docker-compose down

# Rebuild and restart everything
docker-compose down && docker-compose up --build -d

# Check container status
docker-compose ps

πŸ“š Documentation

For detailed information about architecture, APIs, and deployment, see:

πŸ› οΈ Technologies Used

  • Mobile: Flutter, Dart, SQLite, GPS, Camera
  • Backend: Spring Boot, Node.js, PostgreSQL, MongoDB, RabbitMQ
  • Cloud: Azure Functions, Azure Service Bus
  • DevOps: Docker, Docker Compose, Maven
  • Documentation: Swagger/OpenAPI

πŸ“ˆ System Features

πŸ”’ Security

  • βœ… JWT authentication shared between services
  • βœ… Isolated Docker networks
  • βœ… API data validation
  • βœ… Input sanitization

πŸ“Š Scalability

  • βœ… Independent microservices architecture
  • βœ… Asynchronous communication via RabbitMQ
  • βœ… Serverless functions for demand spikes
  • βœ… Domain-specific databases

πŸ” Observability

  • βœ… Health checks for all services
  • βœ… Structured, centralized logs
  • βœ… Interactive Swagger documentation
  • βœ… Resource monitoring

πŸš€ DevOps

  • βœ… Full containerization with Docker
  • βœ… Orchestration via Docker Compose
  • βœ… Automated setup scripts
  • βœ… Serverless deployment via Azure Functions

About

Delivery system with microservices architecture and a Flutter mobile app. Integrates with Azure Service Bus and Azure Functions for asynchronous and scalable communication between services, as well as real-time order tracking, automatic email sending, and push notifications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •