Git Product home page Git Product logo

nfactorial's Introduction

FastAPI + MongoDB Boilerplate

Deploy on Railway

This is a FastAPI boilerplate, which includes includes:

  • MongoDB as database
  • Bcrypt for password hashing
  • JWT for user token management and verification
  • Dockerfile and docker-compose files for easy deployment
  • CORS Middleware configuration

๐Ÿ“š Features

  1. User registration.
  2. User authentication and token creation.
  3. User verification and token validation.
  4. Encrypted password management.

๐Ÿš€ Quick Start

You'll need Docker and Docker Compose to run this application.

  1. Start MongoDB and Mongo admin panel
docker-compose up -d
  1. Start the FastAPI server.
poetry install
poetry shell
sh ./scripts/launch.sh

This command will start the FastAPI server on port 8000, the MongoDB service on port 27017 and Mongo admin panel on port 8081. You can navigate to http://localhost:8000/docs in your browser to access the automatically generated API documentation.

๐Ÿ“š Project Structure

The main sections of the project are:

  • app/main.py: This is the entry point of the application.
  • app/config.py: This file contains the global configuration of the application.
  • app/auth: This folder contains the logic related to the authentication system.
  • app/auth/service.py: Contains the service layer logic for the authentication system.
  • app/auth/repository: Contains the logic for interacting with the MongoDB database.
  • app/auth/router: Contains the routing logic for the authentication API.
  • app/auth/adapters: Contains the JWT management logic.
  • app/auth/utils: Contains utility functions, such as password hashing.

nfactorial's People

Contributors

atlekbai avatar inabatron avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.