Skip to content

This service provides an API for managing information about organizations, their connections with activities, buildings, and phone numbers

Notifications You must be signed in to change notification settings

Valentina-Gol/catalog_of_organizations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Catalog of organizations

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.

Necessary requirements

  • Python 3.11
  • Docker & Docker-compose

Project setup

SSH-key setup

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

Working with the service in docker

Just start service in docker and enjoy of using it :)

$ docker-compose up

Working with the service locally

Python virtual environment

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

Installing dependencies

Install dependencies for the service

$ pip install -r requirements.txt

Launch

Apply database migrations and initialize database

$ alembic upgrade head

Start the service using Uvicorn

$ uvicorn app.main:app 

Interfaces

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

Tests

To run the tests, run the commands

$ cd tests
$ pytest -v

About

This service provides an API for managing information about organizations, their connections with activities, buildings, and phone numbers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages