This API serves as a backend for extending the functionality of AetherOnePy, a powerful program for conducting individual analyses and broadcasts. While AetherOnePy excels in individual work, this project is designed to enable collaborative group analysis and broadcasting efforts by:
When multiple users perform analyses on the same subject, this API collects and consolidates their results.
Facilitates group collaboration by merging intentions and ensuring coordinated broadcasts.
The API is built to support distributed teams working together on shared projects, enhancing the efficiency of group efforts.
go to tha map AetherOnePySocial/py and run
pip install -e .
then in command line in the same map run
uvicorn app.main:app --reload
AetherOnePySocial_Postman_Collection.json
pytest
python ./generateOpenAPI.py
openapi.json
file
This project is a modular and scalable web application built using FastAPI, designed with a clear Model-View-Controller (MVC) architecture. It serves as a foundation for developing APIs with features like authentication, data management, and analysis. The application includes:
- User authentication (register and login).
- Management of machines, catalogs, rates, cases, sessions, analyses, and comparisons.
- Unit tests to ensure application reliability.
- Integration with an SQLite database (or any other database of your choice).
The project follows an MVC structure:
models/
: Database models for each entity.schemas/
: Pydantic schemas for request and response validation.routers/
: FastAPI routers that define the API endpoints.tests/
: Unit tests for all endpoints to validate functionality.
The project uses SQLAlchemy for ORM and database management. It also includes an alembic
integration for database migrations (not implemented here but can be added).
The application has endpoints for:
- Authentication (
/api/auth/
) - Machines (
/api/machines/
) - Catalogs (
/api/catalog/
) - Rates (
/api/rates/
) - Cases (
/api/cases/
) - Sessions (
/api/sessions/
) - Analyses (
/api/analysis/
) - Merged Analyses (
/api/merged-analysis/
) - Comparisons (
/api/comparison/
)
All endpoints are tested using pytest. The tests/
directory includes test cases for creating, retrieving, and validating data for all entities.
git clone <repository-url>
cd AetherOnePySocial
Create a virtual environment and install dependencies:
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate
pip install -e .
Start the FastAPI server:
uvicorn app.main:app --reload
Access the API documentation at http://127.0.0.1:8000/docs.
Run the unit tests to verify functionality:
pytest
- Automatic documentation: Interactive API documentation is available with Swagger UI.
- Validation: Input and output validation using Pydantic.
- Extensibility: Easily add new models, endpoints, and features.
- Testing: Comprehensive unit tests for all entities.
Endpoint: POST /api/auth/register
{
"username": "testuser",
"email": "[email protected]",
"password": "password123"
}
Response:
{
"id": 1,
"username": "testuser",
"email": "[email protected]"
}
Endpoint: POST /api/machines/
{
"machine_name": "Machine1",
"description": "Test machine",
"api_key": "1234"
}
Response:
{
"id": 1,
"machine_name": "Machine1",
"description": "Test machine",
"api_key": "1234"
}
Feel free to fork the repository and submit pull requests. For major changes, open an issue to discuss what you would like to change.
This project is licensed under the MIT License.
files schema
project/
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── config.py
│ ├── database.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── machine.py
│ │ ├── catalog.py
│ │ ├── rate.py
│ │ ├── case.py
│ │ ├── session.py
│ │ ├── analysis.py
│ │ ├── merged_analysis.py
│ │ ├── comparison.py
│ ├── routers/
│ │ ├── __init__.py
│ │ ├── auth.py
│ │ ├── machines.py
│ │ ├── catalog.py
│ │ ├── rates.py
│ │ ├── cases.py
│ │ ├── sessions.py
│ │ ├── analysis.py
│ │ ├── merged_analysis.py
│ │ ├── comparison.py
│ ├── schemas/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── machine.py
│ │ ├── catalog.py
│ │ ├── rate.py
│ │ ├── case.py
│ │ ├── session.py
│ │ ├── analysis.py
│ │ ├── merged_analysis.py
│ │ ├── comparison.py
├── setup.py
├── tests/
│ ├── __init__.py
│ ├── test_auth.py
│ ├── test_machines.py
│ ├── test_catalog.py
│ ├── test_rates.py
│ ├── test_cases.py
│ ├── test_sessions.py
│ ├── test_analysis.py
│ ├── test_merged_analysis.py
│ ├── test_comparison.py
├── .gitignore