A full-stack enterprise-style platform for monitoring, evaluating, and comparing the operational performance of maritime ports and dry ports.
The project combines a .NET 8 Web API, a React + Vite + TypeScript frontend, PostgreSQL, and JWT authentication in a clean, layered architecture designed for maintainability, extensibility, and real-world portfolio presentation.
Port Performance Analyzer helps administrators and analysts manage ports, define performance indicators, record operational measurements, calculate weighted scores, rank ports by period, and visualize results through dashboards and comparison charts.
It is built as a structured, enterprise-oriented application with a strong focus on:
- clear separation of concerns
- practical analytics workflows
- role-based access control
- clean API/frontend integration
- JWT-based authentication and role-based authorization
- User roles: Admin, Analyst, Viewer
- CRUD management for ports
- CRUD management for performance indicators
- CRUD management for measurements
- Weighted performance score calculation by period
- Port ranking and comparison by selected period
- Dashboard with KPIs and charts
- Seeded sample data for quick local evaluation
- Swagger/OpenAPI support for API exploration
- Frontend language support with French UI translation
- Docker support included, while remaining fully runnable locally without Docker
The solution follows a layered architecture inspired by Clean Architecture principles.
- PortPerformanceAnalyzer.Api
- API entry point, controllers, middleware, configuration, Swagger, authentication wiring
- PortPerformanceAnalyzer.Application
- DTOs, interfaces, mappings, shared application contracts
- PortPerformanceAnalyzer.Domain
- Core entities, enums, and domain primitives
- PortPerformanceAnalyzer.Infrastructure
- EF Core, PostgreSQL integration, migrations, seed data, authentication helpers, service implementations
- api: HTTP client configuration
- components: reusable UI and chart components
- context: auth, toast, and i18n state
- hooks: custom React hooks
- layouts: application layout and sidebar
- pages: feature pages
- services: API wrappers by domain
- types: shared frontend types
- utils: formatting and helper utilities
port_performance_analyzer
├── backend
│ ├── PortPerformanceAnalyzer.Api
│ │ ├── Controllers
│ │ ├── Extensions
│ │ ├── Middleware
│ │ ├── Properties
│ │ ├── Program.cs
│ │ └── appsettings.json
│ ├── PortPerformanceAnalyzer.Application
│ │ ├── Common
│ │ ├── DTOs
│ │ ├── Interfaces
│ │ ├── Mappings
│ │ └── Validators
│ ├── PortPerformanceAnalyzer.Domain
│ │ ├── Common
│ │ ├── Entities
│ │ └── Enums
│ └── PortPerformanceAnalyzer.Infrastructure
│ ├── Auth
│ ├── Data
│ │ └── Migrations
│ └── Services
├── frontend
│ ├── public
│ ├── src
│ │ ├── api
│ │ ├── components
│ │ ├── context
│ │ ├── hooks
│ │ ├── layouts
│ │ ├── pages
│ │ ├── services
│ │ ├── types
│ │ └── utils
│ ├── package.json
│ └── vite.config.ts
├── docker-compose.yml
├── NuGet.Config
└── README.md
- ASP.NET Core Web API (.NET 8)
- Entity Framework Core
- Npgsql Entity Framework Core Provider
- JWT Bearer Authentication
- BCrypt password hashing
- Swagger / OpenAPI
- React
- Vite
- TypeScript
- Tailwind CSS
- Recharts
- Axios
- PostgreSQL
- Docker / Docker Compose
Before running the project locally, make sure you have:
- .NET SDK 8+
- Node.js 20+
- npm
- PostgreSQL 16+
- Docker Desktop (optional)
git clone <your-repository-url>
cd port_performance_analyzerCreate a local PostgreSQL database named:
port_performance_analyzer
Make sure you know the local PostgreSQL username and password you want to use.
cd D:\Oks\port_performance_analyzer
$env:DOTNET_ROLL_FORWARD="Major"
$env:ConnectionStrings__DefaultConnection="Host=localhost;Port=5432;Database=port_performance_analyzer;Username=postgres;Password=YOUR_PASSWORD;Include Error Detail=true"
$env:Jwt__Issuer="PortPerformanceAnalyzer"
$env:Jwt__Audience="PortPerformanceAnalyzer.Client"
$env:Jwt__SecretKey="CHANGE_THIS_TO_A_LONG_RANDOM_SECRET_KEY_2026"
dotnet restore .\backend\PortPerformanceAnalyzer.Api\PortPerformanceAnalyzer.Api.csproj --configfile .\NuGet.Config
dotnet build .\backend\PortPerformanceAnalyzer.Api\PortPerformanceAnalyzer.Api.csprojdotnet ef database update --project .\backend\PortPerformanceAnalyzer.Infrastructure --startup-project .\backend\PortPerformanceAnalyzer.Apidotnet run --project .\backend\PortPerformanceAnalyzer.ApiBackend URL:
http://localhost:8080
In a separate terminal:
cd D:\Oks\port_performance_analyzer\frontend
$env:VITE_API_BASE_URL="http://localhost:8080/api"
npm.cmd install
npm.cmd run devFrontend URL:
http://localhost:5173
The application seeds a few accounts for local testing.
| Role | Password | |
|---|---|---|
| Admin | admin@portanalyzer.local |
Admin@123 |
| Analyst | analyst@portanalyzer.local |
Analyst@123 |
| Viewer | viewer@portanalyzer.local |
Viewer@123 |
Swagger is enabled in development.
Open:
http://localhost:8080/swagger
You can use it to:
- authenticate
- inspect available endpoints
- test protected routes
- validate request/response payloads
POST /api/auth/register
POST /api/auth/login
GET /api/ports
POST /api/ports
GET /api/indicators
POST /api/indicators
GET /api/measurements
POST /api/measurements
POST /api/scores/calculate/{portId}?period=2026-Q1
GET /api/reports/rankings?period=2026-Q1
GET /api/dashboard/summary?period=2026-Q1Indicators define the performance dimensions used to evaluate a port.
Examples include:
- cargo throughput
- average vessel turnaround time
- berth / terminal utilization
- on-time dispatch rate
Each indicator has:
- a name and description
- a unit
- a weight
- a direction rule:
- higher is better
- lower is better
Measurements are the raw operational values recorded for a specific:
- port
- indicator
- period
- measurement date
They represent the underlying operational data that feeds the analytics layer.
Scores are calculated from recorded measurements using weighted normalization rules.
The current scoring implementation:
- uses indicator weights
- handles both positive and inverse indicators
- calculates a global score for a selected period
- stores score history for ranking and dashboard use
Rankings order ports by calculated score for a given period.
They are used to:
- compare ports quickly
- identify stronger and weaker performers
- support dashboard analytics and reporting views
The project supports practical testing across backend, frontend, and full user workflows.
The main business flows can be tested through the UI and Swagger:
- login
- port creation
- indicator creation
- measurement recording
- score calculation
- ranking updates
- dashboard visualization
A typical end-to-end local workflow is:
- start PostgreSQL
- run
dotnet ef database update - run
dotnet run - run
npm run dev - sign in with a seeded user
- add measurements
- calculate a score
- verify ranking and dashboard results
Authentication can be validated through:
POST /api/auth/login- JWT-protected Swagger routes
- role-based UI access and permissions
The API includes request validation for:
- required fields
- numeric constraints
- paging parameters
- domain-specific request formats such as periods
The current codebase has been validated with:
dotnet buildnpm run build
Docker support is included, although the project is fully runnable without Docker.
Run the full stack with:
docker compose up --buildDefault container endpoints:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:8080 - PostgreSQL:
localhost:5432
If Docker is not installed on your machine, use the Local Setup section above.
- Export reports (Excel / PDF)
- Advanced analytics
- Real-time data ingestion
- Multi-tenant support
- CI/CD pipeline
Project maintained by the repository owner.
No license has been specified yet. If this project is intended for public reuse, adding an explicit license such as MIT is recommended.
Développement d'une version simplifiée de la plateforme d'évaluation de performance des ports secs/maritimes
c69c9b08dba7f1bd1c6654478b71460a70edb8a1