A generic API ingestion framework built with FastAPI, featuring pluggable connectors, job tracking, Docker support, and automated testing.
Due to time constraints and free-tier deployment limitations, the project is provided with Docker support for one-command local execution.
Run:
docker compose up --buildSwagger UI:
http://localhost:8000/docs
- Python 3.14
- FastAPI
- SQLAlchemy 2.x
- SQLite
- Pydantic v2
- Loguru
- Pytest
- Docker
- Docker Compose
- HTTPX
DataForge is a generic REST API ingestion service designed to fetch data from external APIs, persist the raw JSON payloads, and track ingestion history.
Rather than building a connector for a single API, the project was designed around reusable abstractions so that additional APIs and storage backends can be integrated with minimal changes.
The architecture emphasizes clean separation of concerns by isolating HTTP communication, storage, business logic, and API orchestration into independent components.
- Generic REST API ingestion
- Pluggable connector architecture
- Pluggable storage architecture
- Ingestion job tracking
- Raw JSON payload storage
- OpenAPI/Swagger documentation
- SQLAlchemy ORM
- Dependency Injection
- Structured logging using Loguru
- Automated tests using Pytest
- Docker & Docker Compose support
FastAPI
│
POST /ingest
│
PipelineService
┌─────────────┴─────────────┐
▼ ▼
GenericHTTPConnector SQLiteStorage
│
▼
External REST APIs
│
▼
SQLite Database
│
▼
Job Tracking & Stored Records
The API layer remains thin and is responsible only for request handling. Business logic is delegated to the PipelineService, while connectors and storage implementations remain interchangeable through abstract interfaces.
DataForge/
├── app/
│ ├── api/
│ ├── connectors/
│ ├── core/
│ ├── database/
│ ├── models/
│ ├── schemas/
│ ├── services/
│ └── storage/
│
├── tests/
│
├── assets/
│
├── Dockerfile
├── docker-compose.yml
├── pytest.ini
├── pyproject.toml
└── README.md
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /ingest |
Start a new ingestion job |
| GET | /jobs |
Retrieve ingestion history |
| GET | /jobs/{id} |
Retrieve a specific ingestion job |
| GET | /records/{job_id} |
Retrieve records belonging to an ingestion job |
Request
{
"url": "https://jsonplaceholder.typicode.com/posts",
"method": "GET",
"source": "jsonplaceholder"
}Expected Result
- 100 records fetched
- 100 records stored
{
"url": "https://api.github.com/users",
"method": "GET",
"source": "github"
}Expected Result
- GitHub user data successfully ingested through the same pipeline.
The ingestion pipeline depends on an abstract connector rather than a concrete HTTP implementation.
This allows future connectors (GitHub, Shopify, Stripe, Salesforce, etc.) to be added without modifying the pipeline itself.
Storage is abstracted behind a common interface.
Although SQLite is currently implemented, the same pipeline can support PostgreSQL, MongoDB, Redis, or cloud object storage with minimal changes.
The PipelineService orchestrates the ingestion workflow.
Responsibilities:
- Fetch data from the connector
- Validate and normalize the response
- Persist records
- Return ingestion statistics
Keeping orchestration separate from the API layer improves maintainability, readability, and testability.
Every ingestion creates an IngestionJob that stores:
- Job status
- Start timestamp
- Completion timestamp
- Number of fetched records
- Number of stored records
- Error message (if any)
Each stored record is linked back to its ingestion job through a foreign key, allowing complete traceability.
Automated tests were written using Pytest.
The test suite validates:
- Job retrieval endpoint
- Individual job lookup
- Record retrieval
- Empty record handling
- Invalid job requests
Run tests:
uv run pytestCurrent Status
========================
4 passed
========================
Build and run the application:
docker compose up --buildThe application will be available at:
http://localhost:8000/docs
Install dependencies:
uv syncRun the application:
uv run uvicorn app.main:app --reloadOpen Swagger:
http://127.0.0.1:8000/docs
The project was successfully tested against multiple public REST APIs:
https://jsonplaceholder.typicode.com/posts
https://api.github.com/users
Both APIs were ingested successfully using the same generic pipeline implementation.
AI tools were used as engineering assistants throughout development.
Used for:
- Architecture discussions
- System design
- SOLID principles
- Dependency injection
- Code reviews
- Refactoring suggestions
- Backend design decisions
Used for:
- Boilerplate generation
- SQLAlchemy model scaffolding
- FastAPI endpoint generation
- Docker configuration
- Test scaffolding
All generated code was manually reviewed, integrated, tested, and refactored where necessary.
One notable architectural refinement involved introducing a relationship between ingestion jobs and stored records (job_id). This improved traceability and enabled record retrieval for individual ingestion runs.
Authentication and advanced pagination strategies were intentionally left as future enhancements to keep the assignment focused on the generic ingestion architecture.
The GenericConnector already supports custom headers, making API-key and bearer-token authentication straightforward to add.
Pagination strategies differ across APIs (page-based, cursor-based, offset-based), so the connector abstraction was designed to accommodate future pagination implementations.
One example where AI assistance required human review involved introducing the relationship between ingestion jobs and ingested records.
Although the AI correctly updated the application code, it overlooked the existing SQLite schema. I identified the issue after runtime testing and recreated the development database. In a production system this would be handled through Alembic migrations.
To keep the implementation focused within the assignment timeline, several production-grade features were intentionally deferred:
- Database migrations using Alembic
- Retry & exponential backoff
- Advanced pagination strategies
- Alembic database migrations
- PostgreSQL support
- S3 storage backend
- Background workers using Celery
- Retry and exponential backoff
- Multiple pagination strategies
- OAuth/API key authentication
- Scheduled ingestion jobs
- Deployment to cloud platforms (Render, Railway, AWS)
This project provided practical experience with:
- Designing extensible backend architectures
- Applying SOLID principles
- Dependency Injection
- Abstract base classes
- REST API design
- SQLAlchemy ORM
- Dockerizing FastAPI applications
- Writing automated tests
- Integrating AI-assisted development into a software engineering workflow
Ganshyam Suthar
Backend Developer | Python | FastAPI | SQLAlchemy



