Skip to content

26harvintilavat/Authentication-System-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Authentication System

This is a simple authentication API built using FastAPI. It provides user registration, login, password hashing, and JWT token based authentication.

Features

  • User Registration
  • User Login
  • Password Hashing
  • JWT Token Authentication
  • Protected Routes
  • PostgreSQL Database
  • Clean Project Structure

Tech Stack

  • FastAPI
  • SQLAlchemy
  • PostgreSQL
  • JWT (python-jose)
  • Pydantic
  • Uvicorn

Project Structure

app/
 ├── core/
 │    ├── database.py
 │    └── security.py
 ├── models/
 │    └── user.py
 ├── schemas/
 │    ├── auth.py
 │    └── user.py
 └── main.py

Setup

  1. Create virtual environment
python -m venv venv
  1. Activate environment
venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Create .env file and add:
DATABASE_URL=your_database_url
SECRET_KEY=your_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
  1. Run server
uvicorn app.main:app --reload

Open Swagger docs:

http://127.0.0.1:8000/docs

About

Secure Authentication System API built with FastAPI featuring user registration, JWT-based login, password hashing, and protected routes. Designed to demonstrate real-world backend security, authentication workflows, and scalable API architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages