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 and implement API folder schema #4

Open GabrielEValenzuela opened 1 month ago

GabrielEValenzuela commented 1 month ago

Description

Create the foundational structure for the FastAPI-based API portion of the knowledge graph similarity detection project. The structure should follow common industry standards for backend APIs, prioritize separation of concerns, and be designed for scalability, allowing easy addition of new endpoints. The organization will promote maintainability and adherence to best practices across all modules.

User Stories


Details


Required Directory and File Structure

Based on:

[!NOTE] This is only a proposal, can be modify to fit with project requirements

project_root/
├── app/                          # Main FastAPI application directory
│   ├── main.py                   # Application entry point
│   ├── config.py                 # Configuration settings and environment variables
│   ├── api/                      # API routes, endpoints, and dependencies
│   │   ├── routers/              # Individual route files organized by entity
│   │   │   └── similarity.py     # Endpoint for similarity detection
│   ├── models/                   # Model loader and neural network logic
│   ├── services/                 # Core services (e.g., similarity detection, rate limiting)
│   ├── db/                       # Database setup, connection, and management
│   ├── schemas/                  # Pydantic schemas for input/output validation
│   └── utils/                    # Utility functions, including custom logging
├── tests/                        # Tests for the application
│   ├── unit/                     # Unit tests for individual components
│   ├── integration/              # Integration tests for API endpoints
├── .env.example                  # Example environment variables for developers
├── requirements.txt              # Dependencies required for running the project
└── README.md                     # Overview and instructions for setting up the project

Examples and Notes

Edge Cases