Skip to content

ORM Free Full Stack, modern web application template. Using FastAPI, Nuxt.js, JWT Authentication, SQLite, Docker compose and more.

License

Notifications You must be signed in to change notification settings

SpaceShaman/full-stack-fastapi-nuxt-jwt-auth-orm-free-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Full Stack FastAPI Nuxt.js JWT Auth ORM Free Template

GitHub License Tests Codecov Python TypeScript FastAPI Nuxt.js Docker Docker Compose Poetry Pydantic Tailwind CSS daisyUI VeeValidate Yup Jinja JWT Pytest SQLite SQLift Code style: black Linting: Ruff Code formatter: Prettier Linting: ESLint

Technology Stack and Features

Backend

  • ⚑ FastAPI as the backend framework.
  • πŸ“¦ Dependency management with Poetry.
  • 🐢 Code linting using Ruff.
  • πŸ“ Data validation with Pydantic.
  • πŸ—ƒ SQLite as the database.
  • πŸ†“ ORM free approach using raw SQL queries with the repository pattern.
  • πŸ›  Database migrations with SQLift.
  • πŸ”‘ JWT (JSON Web Token) authentication.
  • πŸ“ Registration with email based account activation.
  • πŸ”’ Secure password hashing.
  • πŸ“« Password recovery via email.
  • πŸ“§ SMTP integration for sending emails.
  • βœ‰οΈ Email templates using Jinja.
  • βœ… Unit testing with Pytest.

Frontend

  • πŸš€ Nuxt.js as the frontend framework.
  • 🟦 TypeScript for static type checking.
  • πŸ–Œ Code formatting with Prettier.
  • ✨ Code linting using ESLint.
  • 🎨 Styling with TailwindCSS.
  • 🧩 Ready-to-use components from daisyUI.
  • πŸ” Middleware for authentication handling.
  • πŸ“ Form validation with VeeValidate and Yup.
  • 🎨 Theme selector with 32 themes from daisyUI.
  • 🚨 Utility functions for alerts and notifications.
    • ❌ Call showErrorAlert('message') to show an error message.
    • βœ… Call showSuccessAlert('message') to show a success message.
    • πŸ’‘ Call showInfoAlert('message') to show an info message.
    • ⚠️ Call showWarningAlert('message') to show a warning message.

CI/CD

  • πŸ”„ CI/CD pipeline with GitHub Actions.
  • πŸ§ͺ Automated testing before deployment.
  • πŸ“Š Code coverage reporting with Codecov
  • πŸš€ Ready-to-use workflow configurations in .github/workflows/

Deployment

Screenshots

Login Page

Login Login

Register Page

Register

Password Recovery

Password Recovery

Theme Selector

Theme Selector

Alerts and Toasts

Alerts and Toasts

Validation

Validation

Simple Dashboard

Dashboard

Activation Email

Activation Email

How To Use It

You can just fork or clone this repository and use it as is.

✨ It just works. ✨

Configure

You need to configure the environment variables to set your own values. You can copy the example .env files:

cp .env.default .env

And then edit the .env file and set your own values.

Run

Run in development environment

docker-compose -f docker-compose.dev.yml up

Run in production environment

docker-compose up

CI/CD configuration

This project has a CI/CD pipeline with GitHub Actions. You can see the workflow configuration in .github/workflows/. To use it, you need to set the following secrets in your repository settings:

CODECOV_TOKEN   # Your Codecov token
HOST            # Your SSH host
SSH_KEY         # Your SSH private key
USERNAME        # Your SSH username

Comunication between FastAPI and Nuxt.js

The communication between FastAPI and Nuxt.js is done via plugin `api' which is located in frontend/app/plugins/api.ts. This plugin uses the $fetch to make requests to the FastAPI backend. You can use this plugin in two ways:

Like useFetch

const { data: users } = await useAPI<User[]>('/users', {
    method: 'get',
    ...
})

Like $fetch

await useNuxtApp().$api<{ token: string }>('/auth/login', {
    method: 'POST',
    ...
})

License

This project is licensed under the terms of the MIT license.