FastAPI Vue OAuth2

screenshot of FastAPI Vue OAuth2

FastAPI Vue OAuth2 is a boilerplate for building a FastAPI backend with a Vue frontend. It includes OAuth2 authentication with JWT tokens, and a simple user CRUD. Project can be easily deployed with Docker-Compose.

Overview

The FastAPI Vue OAuth2 Boilerplate is a robust and efficient starting point for developers looking to create web applications with a combination of FastAPI for the backend and Vue3 for the frontend. Utilizing PostgreSQL as the database, this boilerplate offers a comprehensive setup that includes scalable architecture, authentication, and user management. Designed to streamline development, it supports modern features like OAuth2 with JWT tokens, making it suitable for both beginner and advanced developers.

With its clean structure and detailed configuration, this boilerplate offers a seamless development experience. Whether you're deploying in a development environment or pushing to production with Docker Compose, this template provides all the necessary components to get started efficiently.

Features

  • FastAPI Backend: Built with FastAPI, providing high performance and easy integration with various components.
  • PostgreSQL Integration: Utilizes PostgreSQL 15.1, ensuring robust data handling with persistent storage through Docker volumes.
  • SQLAlchemy CRUD Support: Implements async support for CRUD operations, simplifying database interactions.
  • OAuth2 Authentication: Features secure authentication using OAuth2 and JSON Web Tokens (JWT), ensuring user data is protected.
  • Token Storage: Access tokens are stored in memory (Pinia store), while refresh tokens are securely saved in httpOnly cookies.
  • Vue3 Frontend: The user interface is powered by Vue3, utilizing Pinia for state management to enhance performance and reactivity.
  • Docker Compose Compatibility: Streamlines both development and production setups, allowing for containerization and easy deployment.
  • Comprehensive Project Structure: Organized file structure with clear separation for API, models, and environment configurations, facilitating easy navigation and management.
docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.