1. Project Goals
The goal of this project is to modernize and simplify the Internet Health Report (IHR) API by replacing its outdated Django 2.2.27 implementation with FastAPI, a lightweight, high-performance, asynchronous framework that provides built-in interactive API documentation via Swagger UI.
This migration will:
-
Migrate all API endpoints from Django to FastAPI.
-
Remove deprecated and unused code to reduce complexity and improve maintainability.
-
Containerize the application with Docker to ensure a consistent and portable runtime environment across various deployment setups.
By implementing these architectural changes, the project aims to improve performance, simplify maintenance, and provide a cleaner, more modular codebase for future development.
2. Implementation
This project follows a Controller-Service-Repository architecture for modularity, scalability, and maintainability. The layers are clearly separated for cleaner code and easier testing.

- Controller Layer : Handles HTTP requests, calls services, and returns structured responses.
- Service Layer : Encapsulates business logic, enforces rules, and delegates data access to repositories, keeping controllers decoupled from domain logic.
- Repository Layer : Abstracts database interactions, providing structured and reusable data access methods.
- DTOs : Define and validate data formats between layers, ensuring consistent API requests/responses and isolating models from external communication.
- Model Layer : Defines database schemas, relationships, field types, and constraints, mapping directly to tables and integrating with repositories.
2.1. API Endpoints Migration
Migrated the following endpoints from Django to FastAPI:
/networks/
/countries/
/disco/events/
/hegemony/
/hegemony/alarms/
/hegemony/countries/
/hegemony/prefixes/
/hegemony/cones/
/network_delay/
/network_delay/locations/
/network_delay/alarms/
/metis/atlas/selection/
/metis/atlas/deployment/
/tr_hegemony/
2.2. Dockerization
Containerized the application with Docker to provide a consistent, portable runtime environment for all deployment setups.
3. Merged Pull Requests
The merged pull requests that contain my work:
- PR #33 – Added data migration steps
- PR #32 – Updated allowed CORS origins
- PR #31 – Return recent results when timebin fields are not provided
- PR #30 – Added page size to .env file
- PR #29 – Added /hegemony, /hegemony/countries and /hegemony/prefixes endpoints
- PR #22 – Added /disco/events, /tr_hegemony and /hegemony/alarms endpoints
- PR #17 – Added network delay and metis endpoints and removed link endpoints
- PR #15 – Added /network_delay/locations endpoint
- PR #13 – Added link forwarding endpoint
- PR #11 – Added /link/delay endpoint
- PR #9 – Added /networks endpoint
- PR #8 – Removed some foreign key constraints and returned some primary keys to integer
- PR #6 – Added database models and /hegemony/cones endpoint
- PR #2 – Country endpoint