This service provides an API for managing information about organizations, their connections with activities, buildings, and phone numbers. The service allows you to perform the following operations:
- Getting a list of organizations by various criteria (by name, by building, by activity).
- Searching for organizations in a given geographic area (rectangle or circle).
- Managing activity data (including nesting).
- Support for authentication via a static API key.
- Automatic application of migrations when starting a container.
The service is implemented on FastAPI using SQLAlchemy+SQLite, and Alembic to work with the database. Docker is used for launching, which makes it easy to deploy and test the service locally or in production.
- Python 3.11
- Docker & Docker-compose
To download the repository, you need to create an SSH key and add it to your account according to instructions.
Now you can clone the repository using SSH
$ git clone [email protected]:Valentina-Gol/catalog_of_organizations.git
Just start service in docker and enjoy of using it :)
$ docker-compose up
To run the project locally you need to set up a python virtual environment
$ cd catalog_of_organizations
$ python3 -m venv organizations_env
Activate the virtual environment
- on Windows
$ organizations_env\Scripts\activate
- on macOS or Linux
$ source ./organizations_env/bin/activate
Install dependencies for the service
$ pip install -r requirements.txt
Apply database migrations and initialize database
$ alembic upgrade head
Start the service using Uvicorn
$ uvicorn app.main:app
The service will be deployed at
http://127.0.0.1:8000
You can interact with the service via Swagger UI at
http://127.0.0.1:8000/docs
And also use ReDoc
http://127.0.0.1:8000/redoc
To run the tests, run the commands
$ cd tests
$ pytest -v