CLAUDE.md TemplatesCLAUDE.md Template

Nuxt 4 + SQLite + Lucia Auth + Drizzle ORM Local Core Studio - CLAUDE.md Template

A copyable CLAUDE.md Template page for Nuxt 4 with SQLite, Lucia Auth, Drizzle ORM, and Local Core Studio—ready to paste into CLAUDE.md.

CLAUDE.md templateNuxt 4SQLiteLucia AuthDrizzle ORMLocal Core StudioClaude Codefull-stackauthenticationORMTypeScript

Target User

Developers building Nuxt 4 apps with local SQLite, Lucia authentication, and Drizzle ORM in Local Core Studio.

Use Cases

  • Boilerplate for Nuxt 4 + SQLite apps
  • User authentication with Lucia
  • Data access with Drizzle ORM
  • Local Core Studio integration
  • Copyable Claude Code blocks for stack-specific CLAUDE.md files

Markdown Template

Nuxt 4 + SQLite + Lucia Auth + Drizzle ORM Local Core Studio - CLAUDE.md Template

# CLAUDE.md
Project role
- You are Claude, a coding assistant that outputs actionable code blocks for Nuxt 4 projects using SQLite, Lucia Auth, Drizzle ORM in Local Core Studio.

Architecture rules
- Use Nuxt 4 with Nitro server routes
- Separate client side from server side logic
- Use Drizzle ORM as data access layer with SQLite
- Keep authentication logic centralized under server side

File structure rules
- root
  - nuxt.config.ts
  - package.json
  - .env
  - drizzle.config.ts
  - migrations/
  - server/
  - app/
  - components/
  - composables/
  - layouts/
  - pages/
  - plugins/
  - app.vue
- server
  - lib/
  - drizzle/
  - lucia/

Authentication rules
- Use Lucia Auth for all user management
- Store password hashes in SQLite via Drizzle migrations
- Use httpOnly cookies for sessions
- Implement email/password signup and login
- Protect protected routes with auth middleware

Database rules
- SQLite database using Drizzle ORM
- Use migrations for schema changes
- Seed a sample user if running locally
- Use migrations to enforce constraints like unique email

Validation rules
- Validate user input on both client and server
- Use runtime guards on API boundaries
- Validate payload shapes before writing to DB

Security rules
- Do not expose secrets in client code
- Use httpOnly cookies with secure flag in production
- Enforce CSRF protection for server routes
- Restrict access based on user roles where applicable

Testing rules
- Unit test database helpers and Lucia auth flows
- Integration tests for sign up, login, and protected routes
- End-to-end tests are optional but encouraged in CI

Deployment rules
- Use environment variables for DB path and secrets
- Run migrations as part of bootstrapping in CI
- Build on Nuxt 4 and start with proper server process manager

Things Claude must not do
- Do not reference remote production databases in examples
- Do not use Prisma, Mongoose or other ORMs not in this stack
- Do not bypass Lucia auth flows
- Do not output plaintext secrets
- Do not propose insecure patterns

Overview

CLAUDE.md template for Nuxt 4 + SQLite + Lucia Auth + Drizzle ORM Local Core Studio. This page provides a copyable CLAUDE.md template that developers can paste into CLAUDE.md to bootstrap a stack-specific project. The template targets a Nuxt 4 frontend with a local SQLite database, Lucia authentication, and Drizzle ORM data access within a Local Core Studio environment.

When to Use This CLAUDE.md Template

  • Starting a Nuxt 4 app that uses a local SQLite database for development and testing.
  • Implementing user authentication with Lucia in a Nuxt 4 app.
  • Setting up data access with Drizzle ORM against SQLite.
  • Working in Local Core Studio for local, offline-first development.
  • Creating a copyable Claude Code block to drop into CLAUDE.md with stack-specific rules.

Copyable CLAUDE.md Template

# CLAUDE.md
Project role
- You are Claude, a coding assistant that outputs actionable code blocks for Nuxt 4 projects using SQLite, Lucia Auth, Drizzle ORM in Local Core Studio.

Architecture rules
- Use Nuxt 4 with Nitro server routes
- Separate client side from server side logic
- Use Drizzle ORM as data access layer with SQLite
- Keep authentication logic centralized under server side

File structure rules
- root
  - nuxt.config.ts
  - package.json
  - .env
  - drizzle.config.ts
  - migrations/
  - server/
  - app/
  - components/
  - composables/
  - layouts/
  - pages/
  - plugins/
  - app.vue
- server
  - lib/
  - drizzle/
  - lucia/

Authentication rules
- Use Lucia Auth for all user management
- Store password hashes in SQLite via Drizzle migrations
- Use httpOnly cookies for sessions
- Implement email/password signup and login
- Protect protected routes with auth middleware

Database rules
- SQLite database using Drizzle ORM
- Use migrations for schema changes
- Seed a sample user if running locally
- Use migrations to enforce constraints like unique email

Validation rules
- Validate user input on both client and server
- Use runtime guards on API boundaries
- Validate payload shapes before writing to DB

Security rules
- Do not expose secrets in client code
- Use httpOnly cookies with secure flag in production
- Enforce CSRF protection for server routes
- Restrict access based on user roles where applicable

Testing rules
- Unit test database helpers and Lucia auth flows
- Integration tests for sign up, login, and protected routes
- End-to-end tests are optional but encouraged in CI

Deployment rules
- Use environment variables for DB path and secrets
- Run migrations as part of bootstrapping in CI
- Build on Nuxt 4 and start with proper server process manager

Things Claude must not do
- Do not reference remote production databases in examples
- Do not use Prisma, Mongoose or other ORMs not in this stack
- Do not bypass Lucia auth flows
- Do not output plaintext secrets
- Do not propose insecure patterns

Recommended Project Structure

.
├── nuxt.config.ts
├── package.json
├── .env
├── drizzle.config.ts
├── migrations/
├── server/
│   ├─ lucia/
│   ├─ drizzle/
│   └─ lib/
├── app/
├── components/
├── composables/
├── layouts/
├── pages/
├── plugins/
├── app.vue

Core Engineering Principles

  • Isolate data access via Drizzle ORM and SQLite; keep auth within Lucia
  • Prefer explicit migrations and seed data for local development
  • Maintain a clear client/server boundary in Nuxt 4
  • Keep config in environment variables and repository-agnostic defaults
  • Write tests for critical paths: auth, DB queries, and server routes

Code Construction Rules

  • Use TypeScript across the stack
  • Define types for API payloads and DB schemas
  • Configure Drizzle with sqlite dialect and migrations
  • Configure Lucia with SQLite adapter and secret management
  • Avoid inline secrets in code; use environment variables
  • Prefer composables for shared client-side utilities

Security and Production Rules

  • Enforce httpOnly secure cookies for sessions
  • Store secrets in .env and load via process.env
  • Enable CSRF protection on server routes
  • Use server middleware to guard protected endpoints
  • Review authentication middleware for privilege checks

Testing Checklist

  • Unit tests for DB access using Drizzle
  • Tests for Lucia auth flows (signup, login, logout)
  • Integration tests for API routes
  • CI checks to run migrations and build

Common Mistakes to Avoid

  • Mixing client and server code
  • Skipping migrations or seeding in local development
  • Hardcoding secrets or using non-HTTPS in dev
  • Assuming ORM features beyond Drizzle with SQLite support

FAQ

Q: What is the CLAUDE.md Template for this stack?
A: It provides a copyable Claude Code blueprint for Nuxt 4 + SQLite + Lucia Auth + Drizzle ORM in Local Core Studio.
Q: Is this template opinionated?
A: Yes, it presets file structure, auth flows, and data access patterns for quick start.
Q: Can I swap Drizzle ORM for Prisma?
A: This template is designed for Drizzle ORM with SQLite; swapping would require changes in code and migrations.
Q: How do I run it locally?
A: Install dependencies, configure env variables, run migrations, then start the Nuxt dev server.
Q: Where can I find the main template page?
A: At https://www.suhasbhairav.com/ai-skills/claude-md-templates/nuxt-4-sqlite-lucia-auth-drizzle-orm-local-core-studio-claude-md-template