This project is a Python-based REST API built with FastAPI that connects to a local MariaDB database to serve asteroid data for the DAMIT iOS native app.
DAMIT-rest_api/ │ ├── app/ │ ├── __init__.py │ ├── main.py # Entrypoint: FastAPI app │ ├── db.py # DB engine + session │ ├── models.py # SQLAlchemy models │ ├── schemas.py # Pydantic data models (for API I/O) │ ├── crud.py # DB logic (Create, Read, Update, Delete) │ └── config.py # DB credentials │ ├── tests/ │ └── test_main.py # Simulate HTTP requests │ ├── data/shapes/ │ ├── 47f96eff1d.. │ └── d1b14688e2.. # Sample files (.obj) │ ├── requirements.txt # Dependencies ├── ngrok_url.txt # Static url to reference dynamic ngrok url ├── run.py # Runs uvicorn └── start_damit_rest_api.sh # Runs the REST APINote: Make sure your database (MariaDB) is running and the credentials in app/config.py are correct.
pip install -r requirements.txtStart the FastAPI development server from the run.py script and expose the local server to the internet with ngrok (requires ngrok to be installed)
./start_damit_rest_api.sh-> Visit the public URL printed by the script to access your API