Skip to content

Monolithic REST API. Will be replaced by microservices.

Notifications You must be signed in to change notification settings

wingflo/general-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

READ ME

Get Started

It's highly recommended to use PyCharm Professional Edition as the IDE.
The IDE is free for students by signing up for a GitHub Student Developer Pack.

  1. Install PostgreSQL locally brew install postgresql
  2. Install Python 3.12
  3. Initiate virtual environment Mac, Windows
  4. Install dependencies pip install -r requirements.txt
  5. Create a .env file in the root directory and add following lines with your own credentials:
    DB_USER=<postgresql username>
    DB_PASSWORD=<postgresql password>
    DB_DB=postgres
    SECRET_KEY=<secret key for JWT>
    ATTACHMENT_BUCKET_NAME=<GCP Storage bucket name>
    GCP_KEY_FILE_PATH=<GCP key file path>
    
  6. Run the init-db.sql script in the local postgresql DB
  7. Run uvicorn app.main:app --reload to start the server

Project Structure

  • app - Main application package
    • models - SQLAlchemy database models (ORM)
    • schemas - Pydantic schemas. All request/response body should be defined here
    • services - Business logic
    • routers - API endpoints
    • core - Common logic

Authentication

  • All endpoints except signup and sign in require authentication.
  • Requests can authenticate themselves in one of the two ways:
    • API Key: Add Api-Token header with the application's API key
    • Session Token: Add Authorization header with the session token returned by the sign in endpoint
    • In case both methods are used, API key will be used for authentication

About

Monolithic REST API. Will be replaced by microservices.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •