Skip to content

Finnegan1/ringtausch

Repository files navigation

nextExample

A modern Next.js application showcasing authentication, task management, and theming capabilities.

Features

  • 🔐 Authentication with better-auth
  • 🎨 Dark/Light theme support
  • 🗃️ PostgreSQL database support with Prisma
  • 📁 File storage with MinIO
  • 🎯 Type-safe database operations
  • 🎨 Styled with Tailwind CSS and shadcn/ui

Prerequisites

  • Node.js 18+
  • PostgreSQL
    • use a local docker-instance or use a free remote instance from supabase or tembo
  • MinIO server (for file storage)

Environment Variables

copy the .env.example file to .env.local and fill in with your values.

Getting Started

  1. Install dependencies:
npm install
  1. b) Install husky hooks:
npm run prepare
  1. Generate Prisma client:
npx prisma generate
  1. Run database migrations:
npx prisma db push
  1. Start the development server on port 3001:
npm run dev
  1. Open http://localhost:3001 with your browser to see the result.

Seed Database for Testing

  • npm run seed:initial - Builds typescript resources and seeds the database with initial data.
  • npm run seed - Seeds the database with initial data. Use if typescript files are already built.
  • npm run prisma:reset - Deletes all data from the database.
  • Login with the email address of a generated user (e.g. lukas.sauerland@yahoo.de) and the password password.

Project Structure

src/
├── app/ # Next.js app directory
├── components/ # React components
├── database/ # Database configuration and migrations
├── lib/ # Utility functions and configurations
└── middleware.ts # Authentication middleware
prisma/schema.prisma # Database schema

Authentication

The project uses better-auth for authentication. Protected routes are handled by the middleware, which redirects unauthenticated users to the sign-in page.

Styling

The project uses Tailwind CSS with shadcn/ui components. Theme configuration can be found in:

  • tailwind.config.ts
  • src/app/globals.css

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages