Skip to content

Gokruzk/photo_manager_api

Repository files navigation

REST API Photo Album

REST API made with FastAPI, PrismaORM and PostgreSQL for manage users' photos

Installation and Configuration

Step 1: Create a Virtual Environment

First, create a virtual environment to manage the project dependencies.

python -m venv venv

2. Activate the virtual environment

On Windows

.\venv\Scripts\activate.bat

On MacOS/Linux

source venv/bin/activate

3. Requirements

Use the package manager pip to install the requirements.

pip install -r requirements.txt

4. Generate Prisma client

prisma generate

Step 4: Configure the .env file

Create an .env file in the root of the project with the following variables:

Variables with text are fixed, depending on your case change the variables containing [].

DB_URL="postgresql://[user]:[password]@[host]:5432/photo_manager"
# Generate a key with this command: openssl rand -hex 32
SECRET_KEY = [key]
API_EMAIL = [host]

Step 5: Execution

python main.py

Database

Schema: public
Database: photo_manager
database model