Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Management and Organization API using Flask

This is a Python API using Flask Framework that Connects the application to a Postgres database server. ORM like SQLAlchemy was used

Base Endponit

Register Endpoint

#[POST] /auth/register Registers a users and creates a default organisation Register request body:

{
	"firstName": "string",
	"lastName": "string",
	"email": "string",
	"password": "string",
	"phone": "string",
}

Login Endpoint

  • [POST] /auth/login : logs in a user. When you log in, you can select an organisation to interact with
{
	"email": "string",
	"password": "string",
}

Get a user Organization(s) Endpoint

  • [GET] /api/organisations: a user gets their own record or user record in organisations they belong to or created [PROTECTED]

Get a single organization Endpoint

  • [GET] /api/organisations/:orgId the logged in user gets a single organisation record [PROTECTED]

Create organization Endpoint

  • [POST] /api/organisations : a user can create their new organisation [PROTECTED]
{
	"name": "string", // Required and cannot be null
	"description": "string",
}

Add a user to a particluar organization Endpoint

  • [POST] /api/organisations/:orgId/users : adds a user to a particular organisation
{
	"userId": "string"
}

Framework:

  • Flask

Python Version:

  • 3.11.9

Render is used to host the postgres DB and Vercel for deployment:

  • Vercel: used for application deployment and hosting.
  • Render: Host for PostgresQL Database.

Test files

UnitTest and E2E test located in:

  • tests/auth.spec.py

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages