https://github.com/rocketpy-team/infinity-api
Infinity-API is a RESTful Open API for RocketPy
https://github.com/rocketpy-team/infinity-api
aerodynamics api flight-simulator public-api rocket-simulator
Last synced: 3 months ago
JSON representation
Infinity-API is a RESTful Open API for RocketPy
- Host: GitHub
- URL: https://github.com/rocketpy-team/infinity-api
- Owner: RocketPy-Team
- License: mit
- Created: 2023-04-29T21:17:07.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-16T15:22:51.000Z (4 months ago)
- Last Synced: 2025-04-03T15:05:16.442Z (3 months ago)
- Topics: aerodynamics, api, flight-simulator, public-api, rocket-simulator
- Language: Python
- Homepage: https://api.rocketpy.org
- Size: 345 MB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Infinity-API
## Capabilities
- Performs rocket simulations and returns simulation data
- Stores simulation input data in mongo-db## Setup
- [Install python3](https://www.python.org/downloads/) 3.11.5 or above
- [install mongodb-atlas](https://www.mongodb.com/try/download/community)
- Install dependencies `python3 -m pip install -r requirements.txt`## Development
- make format
- make test
- make clean
- make build## Starting the server
- Setup MONGODB_CONNECTION_STRING:
```
$ touch .env && echo MONGODB_CONNECTION_STRING="$ConnectionString" > .env
```### Docker
- run docker compose: `docker-compose up --build -d`### Standalone
- Dev: `python3 -m uvicorn src:app --reload --port 3000`
- Prod: `gunicorn -k uvicorn.workers.UvicornWorker src:app -b 0.0.0.0:3000`## Project structure
```
├── README.md # this file
├── requirements.txt
│
├── lib
│ │
│ ├── api.py # main app
│ │── secrets.py
│ │
│ ├── controllers
│ │ ├── interface.py
│ │ ├── environment.py
│ │ ├── flight.py
│ │ ├── motor.py
│ │ └── rocket.py
│ │
│ ├── services
│ │ ├── environment.py
│ │ ├── flight.py
│ │ ├── motor.py
│ │ └── rocket.py
│ │
│ ├── routes
│ │ ├── environment.py
│ │ ├── flight.py
│ │ ├── motor.py
│ │ └── rocket.py
│ │
│ ├── repositories
│ │ ├── interface.py
│ │ ├── environment.py
│ │ ├── flight.py
│ │ ├── motor.py
│ │ └── rocket.py
│ │
│ ├── models
│ │ ├── interface.py
│ │ ├── environment.py
│ │ ├── flight.py
│ │ ├── motor.py
│ │ ├── rocket.py
│ │ │
│ │ └── sub
│ │ ├── aerosurfaces.py
│ │ └── tanks.py
│ │
│ └── views
│ ├── interface.py
│ ├── environment.py
│ ├── flight.py
│ ├── motor.py
│ └── rocket.py
│
└── tests
```## DOCS
- OpenAPI standard: [https://api.rocketpy.org/redoc](https://api.rocketpy.org/redoc)
- Swagger UI: [https://api.rocketpy.org/docs](https://api.rocketpy.org/docs)## API Flowchart
General API workflow. Current available models are: Environment, Flight, Rocket and Motor.### CRUD
```mermaid
sequenceDiagram
participant User
participant API
participant MongoDBUser ->> API: POST /model
API ->> MongoDB: Persist API Model as a document
MongoDB -->> API: Model ID
API -->> User: 201 ModelCreated ViewUser ->> API: GET /model/:id
API ->> MongoDB: Read API Model document
MongoDB -->> API: API Model document
API -->> User: 200 API ModelViewUser ->> API: PUT /model/:id
API ->> MongoDB: Update API Model document
API -->> User: 204User ->> API: DELETE /model/:id
API ->> MongoDB: Delete API Model document
MongoDB -->> API: Deletion Confirmation
API -->> User: 204```
### Simulating and extracting RocketPY native classes
```mermaid
sequenceDiagram
participant User
participant API
participant MongoDB
participant RocketPy libUser ->> API: GET model/:id/simulate/
API -->> MongoDB: Retrieve API Model document
MongoDB -->> API: API Model document
API ->> RocketPy: Initialize RocketPy native class and simulate
RocketPy lib -->> API: Simulation Results
API -->> User: Simulation ResultsUser ->> API: GET /model/:id/rocketpy
API -->> MongoDB: Retrieve API Model document
MongoDB -->> API: API Model document
API ->> RocketPy: Initialize RocketPy native class
RocketPy lib -->> API: RocketPy native class
API -->> User: RocketPy native class as .dill binary (amd64)
```