Loading page
Please wait a moment.
Loading page
Please wait a moment.
Loading
Please wait a moment.
A high-performance, full-stack boilerplate designed for speed and reliability. Built with Next.js 16, Prisma 7, and Clerk.
Clone the repo and verify prerequisites: Node 18+ and PostgreSQL.
git clone https://github.com/beefysalad/nexion.git
cd nexion
npm installCopy .env.example to .env and run migrations.
npx prisma migrate dev
npm run devEnsure your .env file has the following:
Prefer running everything in containers? The project now ships with a Dockerfile, Compose stack, and a Postgres service out of the box.
cp .env.example .env
docker compose up --buildOn startup, the container applies Prisma migrations, seeds the database, and serves the app on localhost:3000.
If you want to remove the sample UI pages (like this docs page, the landing page, and the example dashboard) to start entirely fresh, you can run the cleanup command:
npm run cleanIf you change your mind and want the sample pages back, you can restore them easily.
npm run restoreRoute protection is handled centrally in proxy.ts. Instead of checking auth in every component, define your routes in lib/routes.ts and let Clerk middleware handle redirects:
// proxy.ts
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
const isPublicRoute = createRouteMatcher(['/', '/docs']);
const isAuthRoute = createRouteMatcher(['/login', '/register']);Access the current Clerk user and sync them to Prisma in Server Components.
Use Clerk hooks for interactivity.
A GitHub Action automatically deletes feature branches after they are merged into main, keeping your repository clean.
AI-powered code review and PR descriptions are generated automatically for every pull request to assist with maintenance.
Populate your database with initial data for development.
npm run db:seedFollow these steps to clean up the template and make it your own:
public/file.svgpublic/globe.svgpublic/window.svgpublic/ptrck.jpg (Replace with your own)Remove components/dashboard/whats-new-modal.tsx components/dashboard/index.tsx
app/layout.tsx metadata.public/site.webmanifest.app/page.tsx (Landing Page).app/docs/ (Documentation).services/ (Node.js runtime) and routes.ts (Edge runtime).proxy.ts to validate sessions on the Edge without needing the full database adapter.Define API endpoints in app/api/ directories using route.ts.
import { NextRequest, NextResponse } from 'next/server';
import { prisma } from '@/lib/prisma';
export async function GET(request: NextRequest) {
try {
const users = await prisma.user.findMany({
select: { id: true, name: true, email: true },
});
return NextResponse.json(users);
} catch (error) {
return NextResponse.json({ error: 'Failed to fetch' }, { status: 500 });
}
}
export async function POST(request: NextRequest) {
const body = await request.json();
const user = await prisma.user.create({ data: body });
return NextResponse.json(user, { status: 201 });
}Use @tanstack/react-query with the API wrapper:
import { useQuery } from '@tanstack/react-query';
import { api } from '@/lib/api';
function UsersList() {
const { data, isLoading } = useQuery({
queryKey: ['users'],
queryFn: () => api.get('/api/users'),
});
if (isLoading) return <div>Loading...</div>;
return <div>{/* Render users */}</div>;
}prisma/schema.prismanpx prisma migrate devprisma.user.findMany()Create specific data access functions in lib/data/ instead of writing raw queries in components.
// lib/data/user.ts
import { prisma } from '@/lib/prisma';
export async function getUserById(id: string) {
return await prisma.user.findUnique({
where: { id },
include: { posts: true },
});
}Built with shadcn/ui. Components are located in components/ui/.
components/ui/button.tsxcomponents/ui/input.tsxUtility-first CSS framework with design tokens.
Built-in support with next-themes and CSS variables in globals.css.
Robust forms using React Hook Form paired with Zod schemas.
// lib/schemas/user.ts
export const userSchema = z.object({
email: z.string().email(),
password: z.string().min(8),
});
// Component
const { register, handleSubmit } = useForm({
resolver: zodResolver(userSchema)
});1. Push to GitHub
2. Import in Vercel
3. Add Environment Variables (DATABASE_URL, Clerk publishable key, Clerk secret key, etc)
4. Deploy!
CLERK_SECRET_KEY in production settings.Error: Cannot find module '@prisma/client'
npx prisma generateType errors or strange artifacts
rm -rf .next && npm installShoutout to everyone below for contributing to this boilerplate!