A FastAPI-based REST API service for the Profielentool application, designed to be deployed on Render.
This project provides backend services for the Profielentool application using FastAPI, a modern, fast web framework for building APIs with Python.
Profielentool_API/
├── app/ # Application package
│ ├── __init__.py
│ ├── main.py # Application entry point
│ ├── config.py # Configuration settings
│ ├── models/ # Pydantic models
│ │ ├── __init__.py
| | ├── default.py
| | ├── schema.py
│ │ └── validation.py
├── tests/ # Test suite
│ ├── __init__.py
│ ├── conftest.py
│ └── test_api.py
│ └── test_arcgis_post.py
└── venv-profielentool-api # virtual environment that contains the libraries under requirements
├── requirements.in # Python dependencies (source)
├── requirements.txt # Python dependencies (pinned)
├── .gitignore # Git ignore rules
└── README.md # This file
- Python 3.10.12
- pip and venv
-
Create and activate virtual environment:
python3 -m venv venv-profielentool-api source venv-profielentool-api/bin/activate # On Windows: venv-profielentool-api\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
python3 -m uvicorn app.main:app --reloadThe API will be available at http://localhost:8000
- API docs:
http://localhost:8000/docs
pytest tests/This project uses pip-compile for dependency management.
Update dependencies:
pip install pip-tools
pip-compile requirements.inThen install updated requirements:
pip install -r requirements.txt- Render account (https://dashboard.render.com/)
- GitHub repository with this code
- Make a project on Render
- Create a new Web Service on Render
- Connect to your repository (i.e.GitHub) with this repository and select branch (settings on Render)
- Configure the service:
- Environment: Python 3.10
- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
- Add environment variables in Render dashboard
- Deploy
Set these in your Render dashboard or .env file:
- Currently None
- Configurated in app/main.py
- https://profielentoolbox-api.onrender.com/
- Create a local branch
- Commit changes
- Merge branch into main
- Render polls for a new commit on main and deploys a new version