Skip to content

Python-based REST API built with FastAPI that connects to a local MariaDB database to serve asteroid data for the DAMIT iOS native app

Notifications You must be signed in to change notification settings

scraptechguy/DAMIT-rest_api

Repository files navigation

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.

Project structure

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 API

Instructions to run

Note: Make sure your database (MariaDB) is running and the credentials in app/config.py are correct.

Install dependencies

pip install -r requirements.txt

Start 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

About

Python-based REST API built with FastAPI that connects to a local MariaDB database to serve asteroid data for the DAMIT iOS native app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published