Skip to content

codeagencybe/nestjs-supabase-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nestjs Nextjs Supabase starter template

This is an opiniated starter template for a NestJS application with Supabase as the database.

-->Please read the links on the bottom of this readme first<--

  • pnpm
  • Nestjs API backend
  • Fastify as the server
  • Caching with Redis (KeyDB or Dragonfly as open source drop-in replacements)
  • Rate limiting with Fastify rate limit
  • Logging with Pino
  • queue with BullMQ and/or Memphis.dev (Kafka alternative)
  • Swagger for API documentation
  • Drizzleorm as the ORM
  • Supabase as the database
  • ElectricSQL as localfirst sync integraded with Supabase
  • Nextauth for authentication with Supabase RLS
  • Nextjs frontend
  • Tailwindcss for styling
  • Shadcn for the UI components

Todo

  • migrate to monorepo
  • add auth for backend and frontend (JWT with refresh tokens?)
  • add rate limiting
  • add caching
  • add queue
  • move shared types and utils to a shared package
  • create a basic API user model
  • create a basic dashboard layout as starting point
  • create a simple todo app to demo functionality

Demo model:

  • users
  • todos

Inspiration & credits to

Schema

graph TD;
  subgraph "Frontend"
    A[Next.js Frontend] --> B[Login Page]
    A --> C[Signup Page]
    A --> D[Dashboard]
    style B,C,D fill:#0b6b00,stroke:#0b6b00,stroke-width:4px
  end
  subgraph "Backend"
    E[NestJS with Fastify API Backend] --> F[Authentication & Authorization]
    E --> G[CRUD Operations for Tasks]
    F --> H[JWT Tokens]
    G --> I[Supabase Database]
    style F,H,G fill:#85007c,stroke:#85007c,stroke-width:4px
  end
  subgraph "Database"
    I[Supabase Database] --> J[Users Table]
    I --> K[Tasks Table]
    style J,K fill:#00328f,stroke:#00328f,stroke-width:4px
  end
  subgraph "Auth with JWT Refresh Tokens"
    F --> L[Token Generation & Refresh]
    style L fill:#f00,stroke:#f00,stroke-width:4px
  end
  subgraph "Security Considerations"
    B --> M[Secure Storage]
    E --> N[Input Validation & Sanitization]
    N --> O[HTTPS Communication]
    style M,N,O fill:#bd6202,stroke:#bd6202,stroke-width:4px
  end

Loading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published