GabrielEValenzuela / chatML

A web API exposing a neural network to detect duplicate entities in knowledge graphs. It uses API key authentication and rate limits requests based on client tiers (FREEMIUM, PREMIUM)
MIT License
0 stars 0 forks source link

Define project structure #5

Open GabrielEValenzuela opened 4 weeks ago

GabrielEValenzuela commented 4 weeks ago

Description

Establish a project structure under a src directory, containing both the FastAPI application and the machine learning (ML) logic. This structure will support separation of concerns, modularity, and scalability, aligning with best practices for organizing code in complex API-based and ML-driven projects. The src folder should include subdirectories for the API logic, machine learning model, and core services.

User Stories


Details


Required Directory and File Structure

project_root/
├── src/                           # Main source directory
│   ├── app/                       # FastAPI application
│   │   ├── main.py                # Entry point for FastAPI application
│   │   ├── config.py              # Configuration settings
│   │   ├── api/                   # API routes and dependencies
│   │   ├── schemas/               # Pydantic schemas for input/output validation
│   │   └── utils/                 # Utility functions, including custom logging
│   │
│   ├── ml/                        # ML logic and model handling
│   │   ├── model_loader.py        # Model loading and inference functions
│   │   ├── preprocessing.py       # Data preprocessing and feature engineering functions
│   │   └── models/                # Directory for storing ML models, if applicable
│   
├── tests/                         # Tests for the application
│   ├── integration/               # Integration tests for API endpoints
│   
├── docker-compose.yml      # Orchestrator for the application
├── .env.example                   # Example environment variables for developers
├── requirements.txt               # Project dependencies
└── README.md                      # Overview and setup instructions

Examples and Notes

Edge Cases