Skip to content

In the Trivelum app, you can buy tickets for tours and trips departing from a chosen starting location by selecting what best matches your interests.

License

Notifications You must be signed in to change notification settings

alexandrebeato/trivelum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trivelum logo

Architecture

Overview

Components & Responsibilities

Component Tech Responsibility Evidence
API ASP.NET Core, MediatR HTTP endpoints, auth, domain orchestration server/src/API/Startup.cs
Data MongoDB Persistence for domains and Hangfire storage server/src/API/appsettings.json, server/src/Agencias/Agencias.Infra.Data/Repository/Repository.cs
Cache Redis Distributed cache and health checks server/src/API/Configurations/CacheConfiguration.cs, server/src/API/appsettings.json
Background Jobs Hangfire Recurring jobs (orders check) and dashboard server/src/API/Configurations/HangfireConfiguration.cs
Logging EnterpriseLog over Rabbit/ELK Centralized structured logging server/src/API/Configurations/LoggerConfiguration.cs, server/src/API/appsettings.json
File Storage Amazon S3 / MinIO (dev) Media storage, demo endpoints server/src/API/appsettings.json, server/docker-compose.dev.yml
Payments PagarMe Receiver and card handling server/src/API/appsettings.json
Email Amazon SES / SMTP fallback Transactional emails server/src/API/Configurations/DependencyInjectionConfiguration.cs, server/src/API/appsettings.json
Social Login Facebook/Google/Apple OAuth integrations server/src/API/appsettings.json
Web Client Angular 8 Management SPA client/web/management/angular.json
Mobile – Agents Flutter Agent-facing app client/mobile/agents/pubspec.yaml
Mobile – Customers Flutter Customer-facing app client/mobile/customers/pubspec.yaml

Folder Structure

  • server/src/API: API host, middleware, security, caching, logging, health checks, Hangfire, DI wiring.
  • server/src/: Bounded contexts (Agencias, Turistas, Ingressos, etc.) split into Commands, CommandStack (handlers/events), Domain (entities/validations), Infra.CrossCutting (IoC), Infra.Data (repositories).
  • server/tests: Automated tests per bounded context.
  • client/web/management: Angular SPA sources and build config.
  • client/mobile/agents and client/mobile/customers: Flutter apps and assets.
  • resources/: shared assets (e.g., logo used above).

Key Patterns

Pattern Where Used Evidence
CQRS with MediatR Command handlers + notification handlers per bounded context server/src/Agencias/Agencias.CommandStack/Agencias/Handlers/AgenciaCommandHandler.cs, server/src/Agencias/Agencias.CommandStack/Agencias/Handlers/AgenciaEventHandler.cs
Repository (Mongo) Generic repository + concrete collections server/src/Agencias/Agencias.Infra.Data/Repository/Repository.cs, server/src/Agencias/Agencias.Infra.Data/Repository/AgenciaRepository.cs
Domain Events / Notifications Event handlers trigger side effects and error propagation server/src/Agencias/Agencias.CommandStack/Agencias/Handlers/AgenciaEventHandler.cs, server/src/API/Configurations/DependencyInjectionConfiguration.cs
Dependency Injection (modular IoC) Bootstrappers per bounded context server/src/API/Configurations/DependencyInjectionConfiguration.cs
JWT Auth + Policies Role-based authorization claims server/src/API/Configurations/ApiSecurityConfiguration.cs
Caching Redis via StackExchange server/src/API/Configurations/CacheConfiguration.cs
Background Jobs Hangfire recurring job server/src/API/Configurations/HangfireConfiguration.cs
Health Checks Redis/Mongo probes + UI server/src/API/Configurations/HealthCheckConfiguration.cs
Logging EnterpriseLog middleware and settings server/src/API/Configurations/LoggerConfiguration.cs

Runtime / Deployment

  • Local API run: open the solution and run the API project; configuration defaults in server/src/API/appsettings.json (Mongo at 127.0.0.1:27017, Redis at 127.0.0.1:6379).
  • Containers (full dev stack): docker-compose -f server/docker-compose.dev.yml up --build brings API on port 5000 plus Mongo, Redis, and MinIO (environment variables for AWS/PagarMe/SES injected there).
  • Dependencies only: docker-compose -f server/docker-compose.yml up starts Mongo and Redis for local development.
  • Swagger UI exposed by the API (configured in server/src/API/Startup.cs) when running.
  • Angular management SPA: npm install then npm start in client/web/management; targets the API configured in src/environments (see client/web/management/angular.json).
  • Flutter apps: flutter pub get then flutter run inside each app folder (client/mobile/agents, client/mobile/customers).

Data Flow

flowchart LR
  A[Angular SPA] -->|HTTPS| B(API)
  A2[Flutter Customers] -->|HTTPS| B
  A3[Flutter Agents] -->|HTTPS| B
  B -->|Read/Write| M[(MongoDB)]
  B -->|Cache| R[(Redis)]
  B -->|Jobs| H[Hangfire]
  H -->|Schedule/Run| B
  B -->|Media| S[S3 / MinIO]
  B -->|Payments| P[PagarMe]
  B -->|Email| E[SES/SMTP]
  B -->|Social Auth| O[Facebook/Google/Apple]
Loading

Observability

About

In the Trivelum app, you can buy tickets for tours and trips departing from a chosen starting location by selecting what best matches your interests.

Resources

License

Stars

Watchers

Forks