Skip to content

willem4130/SSO-RACI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Next.js Fullstack Template πŸš€

Production-ready Next.js 16 template with tRPC, Prisma, shadcn/ui, Vercel Analytics, Sentry, and rate-limited API routes

A complete, opinionated fullstack Next.js starter that includes everything you need to build and deploy production-ready applications.

⚑ Quick Start

Option 1: Using degit (Recommended - No Git History)

npx degit willem4130/nextjs-fullstack-template my-app
cd my-app
npm install

Option 2: Using GitHub Template

  1. Click "Use this template" button on GitHub
  2. Create your repository
  3. Clone and install:
git clone https://github.com/willem4130/your-new-repo.git
cd your-new-repo
npm install

Option 3: Using npx (Coming Soon)

npx create-nextjs-fullstack my-app
cd my-app

🎯 What's Included

Core Stack

  • ⚑ Next.js 16 - App Router, React 19, Turbopack
  • πŸ”· TypeScript - Strict mode, full type safety
  • 🎨 Tailwind CSS 3 - Utility-first styling
  • 🧩 shadcn/ui - Beautiful, accessible components

Backend & Data

  • πŸ”„ tRPC v11 - End-to-end typesafe APIs
  • πŸ—„οΈ Prisma ORM - Type-safe database client
  • 🐘 PostgreSQL - Production database (configured)
  • βœ… Zod - Runtime validation

Features

  • πŸ“Š Admin Dashboard - Professional UI with sidebar navigation
  • πŸ”’ Protected API Routes - Rate limiting, authentication, validation
  • πŸ›‘οΈ Rate Limiting - Upstash Redis integration
  • πŸ“ˆ Analytics - Vercel Analytics + Speed Insights (privacy-friendly)
  • πŸ› Error Tracking - Sentry integration with session replay
  • 🌍 Environment Validation - Type-safe env vars with @t3-oss/env-nextjs

Developer Experience

  • πŸ§ͺ Testing - Vitest (unit) + Playwright (e2e)
  • πŸ“ Code Quality - ESLint, Prettier, Husky, lint-staged
  • πŸ“š Documentation - Complete setup guides included

πŸ“¦ What's Pre-configured

Admin Dashboard (/admin)

  • Dashboard - Stats cards, recent activity, metrics
  • Users - User management with data tables
  • Settings - Application configuration

API Routes (/api)

  • Health Check - /api/health
  • Documentation - /api (auto-generated)
  • Posts CRUD - /api/posts with full CRUD operations
  • Rate Limited - All endpoints protected
  • Validated - Zod schemas for all inputs

Components

10 shadcn/ui components pre-installed:

  • Card, Table, Button, Dropdown Menu, Badge
  • Avatar, Separator, Input, Label, Select

πŸš€ Setup Instructions

1. Install Dependencies

npm install

2. Configure Environment Variables

Copy .env.example to .env and configure:

cp .env.example .env

Required:

DATABASE_URL="postgresql://user:password@localhost:5432/mydb"

Optional (but recommended):

# Upstash Redis (rate limiting) - https://upstash.com
UPSTASH_REDIS_REST_URL="your-url"
UPSTASH_REDIS_REST_TOKEN="your-token"

# API Authentication
API_SECRET_KEY="generate-with-openssl-rand-base64-32"

# Sentry (error tracking) - https://sentry.io
NEXT_PUBLIC_SENTRY_DSN="your-dsn"
SENTRY_ORG="your-org"
SENTRY_PROJECT="your-project"
SENTRY_AUTH_TOKEN="your-token"

3. Set Up Database

# Push schema to database
npm run db:push

# Or create migration
npm run db:migrate

4. Run Development Server

npm run dev

Visit http://localhost:3000

5. Explore the Features

  • Homepage: / - Landing page
  • Admin Dashboard: /admin/dashboard - Admin interface
  • API Docs: /api - API documentation
  • Sentry Test: /sentry-test - Error tracking test page

πŸ“– Documentation

Comprehensive guides included in the repository:

πŸ› οΈ Available Scripts

Development

npm run dev          # Start dev server with Turbopack
npm run build        # Build for production
npm run start        # Start production server
npm run lint         # Run ESLint
npm run format       # Format code with Prettier
npm run typecheck    # Run TypeScript type checking

Testing

npm run test         # Run Vitest unit tests
npm run test:ui      # Open Vitest UI
npm run test:e2e     # Run Playwright e2e tests
npm run test:e2e:ui  # Open Playwright UI

Database

npm run db:generate  # Generate Prisma client
npm run db:push      # Push schema changes
npm run db:migrate   # Create migration
npm run db:studio    # Open Prisma Studio

πŸ—οΈ Project Structure

nextjs-fullstack-template/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ (auth)/            # Protected routes
β”‚   β”‚   β”œβ”€β”€ (public)/          # Public routes
β”‚   β”‚   β”œβ”€β”€ admin/             # Admin dashboard
β”‚   β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   β”œβ”€β”€ error.tsx          # Error boundary
β”‚   β”‚   └── layout.tsx         # Root layout
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”‚   └── ui/                # shadcn/ui components
β”‚   β”œβ”€β”€ lib/                   # Utilities
β”‚   β”‚   β”œβ”€β”€ api-middleware.ts  # API helpers
β”‚   β”‚   └── rate-limit.ts      # Rate limiting
β”‚   β”œβ”€β”€ server/                # Backend code
β”‚   β”‚   β”œβ”€β”€ api/               # tRPC routers
β”‚   β”‚   └── db/                # Prisma client
β”‚   β”œβ”€β”€ trpc/                  # tRPC client config
β”‚   └── env.js                 # Environment validation
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma          # Database schema
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ unit/                  # Unit tests
β”‚   β”œβ”€β”€ integration/           # Integration tests
β”‚   └── e2e/                   # E2E tests
└── public/                    # Static files

πŸ”§ Customization

Update Project Name

  1. Update package.json name field
  2. Update database name in .env
  3. Update metadata in src/app/layout.tsx

Add Authentication

The template is ready for authentication. Recommended options:

  • NextAuth.js - OAuth, credentials, magic links
  • Clerk - Drop-in authentication
  • Better Auth - Modern auth library

Add More API Routes

Follow the pattern in src/app/api/posts/route.ts:

import { protectedRoute, apiResponse, validateRequest } from '@/lib/api-middleware'

export async function GET(request: NextRequest) {
  return protectedRoute(request, async (req) => {
    // Your logic here
    return apiResponse({ data: 'your-data' })
  })
}

Add More shadcn/ui Components

npx shadcn@latest add dialog
npx shadcn@latest add form
npx shadcn@latest add toast

🚒 Deployment

Quick Deploy to Vercel

Deploy with Vercel

Complete Deployment Guide: See DEPLOYMENT.md for detailed instructions.

Quick Steps

  1. Push to GitHub

    git push origin main
  2. Import to Vercel

    • Go to vercel.com
    • Click "Add New Project"
    • Import your GitHub repository
  3. Set Environment Variables (required)

    DATABASE_URL="postgresql://..."
    DIRECT_URL="postgresql://..."
    NODE_ENV="production"
  4. Deploy!

    • Vercel auto-detects Next.js configuration
    • Build command: prisma generate && next build (pre-configured)
    • Every push to main auto-deploys to production
    • Pull requests create preview deployments

What's Included

Vercel automatically configures:

  • βœ… Analytics (privacy-friendly)
  • βœ… Speed Insights
  • βœ… Edge Functions for API routes
  • βœ… Serverless Functions
  • βœ… Automatic HTTPS
  • βœ… Global CDN
  • βœ… Preview deployments for PRs

Production Checklist

  • Database configured (PostgreSQL recommended)
  • Environment variables set in Vercel
  • Upstash Redis for rate limiting (optional but recommended)
  • Sentry for error tracking (optional)
  • Custom domain configured (optional)

Full deployment guide with troubleshooting: DEPLOYMENT.md

🀝 Contributing

This is a template repository. Feel free to:

  1. Fork it
  2. Customize for your needs
  3. Share improvements via PR

πŸ“ License

MIT License - use freely for personal and commercial projects.

πŸ™ Credits

Built with:


Ready to build? Start with npx degit willem4130/nextjs-fullstack-template my-app πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages