Bolt prompt

Full-Stack App with Auth

Next.js full-stack application with authentication, database, API routes, and basic CRUD operations.

Build a full-stack Next.js application for {{app_name}}.

## Purpose: {{purpose}}
## Core Data: {{core_data}}

### Architecture
- Framework: Next.js 14+ (App Router)
- Auth: NextAuth.js or Clerk
- Database: PostgreSQL with Prisma ORM
- UI: Tailwind CSS + shadcn/ui

### Authentication
Email/password + social OAuth (Google).
Protected routes using middleware.
Session management with JWT.
User profile table in database.

### Database Schema
```prisma
model User {
  id        String   @id @default(cuid())
  email     String   @unique
  name      String?
  createdAt DateTime @default(now())
  {{core_data_field}} {{core_data_type}}[]
}

model {{core_data}} {
  id        String   @id @default(cuid())
  userId    String
  user      User     @relation(fields: [userId], references: [id])
  // Add relevant fields
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}
```

### API Routes (App Router)
GET /api/{{resource}} — list with pagination
POST /api/{{resource}} — create
GET /api/{{resource}}/[id] — read one
PUT /api/{{resource}}/[id] — update
DELETE /api/{{resource}}/[id] — delete

All routes: authenticate user from session, validate input with zod, return typed JSON.

### UI Pages
/ — Landing or redirect to dashboard
/dashboard — Main authenticated page
/{{resource}} — List view
/{{resource}}/[id] — Detail/edit view
/auth/signin — Sign in
/auth/signup — Sign up

### Core Features
Full CRUD for {{core_data}}.
Search and filter.
Responsive layout with sidebar navigation.

Fill in: {{app_name}}, {{purpose}}, {{core_data}}, {{core_data_field}}, {{core_data_type}}, {{resource}}. In Loopy you fill these in a form and copy the finished prompt in one click.