Skip to content

peshala-prabhapoorna/pindrop-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pindrop API

Python version - 3.12.3

Get started: for devs

  1. Spin up a virtual environment in /backend/. We're using virtualenv.

Warning

Instructions below assume that your working directory is /backend/

virtualenv venv
source venv/bin/activate
  1. Install dependencies
pip3 install -r requirements.txt

Installing dependencies using the requirements file has not worked well for me so far. So, if it fails, install each dependency one by one. Some dependencies require more than a simple pip install.

  • fastapi

pip install command is different. Refer the FastAPI docs.

pip install "fastapi[standard]"
  • psycopg2

python3-devel, libpg-devel libraries are required. The exat names of the libraries depend on the OS or the Linux distribution. Look it up!

  • pyjwt
  • bcrypt

pip install command is different. Refer the FastAPI authorization docs.

pip install "passlib[bcrypt]"
  1. Setup PostgreSQL database

    1. Initiate Postgresql.
    2. Add password to default user (postgres).
    3. Create new user with password (admin of the pindrop database).
    4. Alter newly created user with appropriate privileges (user roles).
    5. Change the authentication mode form peer to md5.
    6. Login to the database as the new user.
    7. Create database for pindrop.
    8. Create a user to be used by the api.
    9. Grant relevant privileges to the newly created user.
  2. Fill in the values of config files

Sample config files are given. Copy them and fill in the values.

  • .env.sample
  • database/database.ini
  1. Run the backend application using fastapi cli
fastapi dev app/main.py

Happy coding!

About

API for location-based issue reporting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages