Local Environment Setup
Prerequisites
Before setting up the testing-api, ensure your local development environment meets the following requirements:
- Python 3.9+: The core logic is built using modern Python features.
- Git: Required for version control and cloning the repository.
- Virtual Environment Tool:
venv(built-in) orpoetryis recommended to manage dependencies. - Docker (Optional): Recommended for running containerized tests or mock services.
Local Setup Steps
Follow these instructions to get the API structure running on your machine for development and extension.
1. Clone the Repository
Start by cloning the codebase from the official Supervised AI platform repository:
git clone https://github.com/UditAkhourii/testing-api.git
cd testing-api
2. Initialize the Virtual Environment
Create and activate a dedicated environment to isolate the API dependencies:
On macOS/Linux:
python3 -m venv venv
source venv/bin/activate
On Windows:
python -m venv venv
.\venv\Scripts\activate
3. Install Dependencies
Install the required packages. This includes core API libraries and testing utilities used by the Supervised AI platform:
pip install --upgrade pip
pip install -r requirements.txt
Note: If you plan on contributing to the core structure, install development dependencies:
pip install -r requirements-dev.txt
4. Configuration and Environment Variables
The API uses environment variables for configuration. Create a .env file in the root directory based on the provided template:
cp .env.example .env
Key Configuration Keys:
| Variable | Description | Default |
| :--- | :--- | :--- |
| API_ENV | Current environment (development, staging, production). | development |
| LOG_LEVEL | Verbosity of logs (DEBUG, INFO, ERROR). | INFO |
| SUPERVISED_AI_BASE_URL | Endpoint for the main Supervised AI platform services. | N/A |
5. Verify the Installation
To ensure the environment is correctly configured to extend the API structure, run the baseline suite:
pytest
A successful run indicates that the local environment is ready for modifications or the addition of new test structures.
Development Workflow
Extending the Structure
When adding new testing modules or API endpoints:
- Define the Schema: Use the internal models located in
/modelsto ensure compatibility with the platform. - Add Logic: Implement your testing logic within the
src/directory. - Local Execution: Start the local development server to test your changes:
python main.py
Using Docker (Alternative)
If you prefer a containerized setup to match the production environment of the Supervised AI platform:
docker-compose up --build
This will spin up the API and any necessary sidecar services (like databases or cache layers) defined in the structure.