Quickly start a new Next.js project with defaults for UI components, layout, database setup and more.
By Joost Schuur (Twitter, Threads).
(Very) early work in progress. More to come.
Not much here yet, but if you're taking an early look, start by cloning the repository:
git clone https://github.com/jschuur/decent-nextjs-starter-template
- Install dependencies:
pnpm install. - Rename
decent-nextjs-starter-templateinpackage.jsonto your project name. - Optionally set up Turso. Local development will work fine without it.
- Copy
.env.exampleto.envand fill in the values as desired. - Run
pnpm devto start the development server. Visit http://localhost:3000. - With the dev server running, run
pnpm run db:migrateto set up the database. The dev script also runs the local Turso database instance. You can also runpnpm run dev:db:tursoto run that separately. - Populate the sample data with
pnpm run db:seed. Refresh the local page to see the stack list loaded from the database. - For SST based live development, set up your AWS credentials manually in
~/aws/credentialsor via their CLI. If you don't want to use SST just yet, you can run local dev viapnpm run dev-nosst. - For Auth.js, set up credentials for the Google Provider for
AUTH_GOOGLE_IDandAUTH_GOOGLE_SECRET(or updateauth.tsto use a different one). Don't forget the randomAUTH_SECRETstring. - Test auth via the login button in the header. If you see an error, you might not have set the correct URLs for your Google OAuth credentials for 'Authorized JavaScript origins' (http://localhost:3000) and 'Authorized redirect URIs' (http://localhost:3000/api/auth/callback/google).
- To deploy, run
pnpm run deploy(for a staging build) orpnpm run deploy:prod. This deploys to AWS via SST. Cloudflare deploys are also supported by SST Ion. Or use the Vercel CLI to deploy to Vercel. Create preview and production env files under.env.previewand.env.productionrespectively. Set aSITE_DOMAINto define the hostname for the site.
Substitute pnpm for your package manager of choice (npm, bun, yarn etc).
- Next.js React framework, configured for Tailwind, TypeScript, ESlint and app router (docs).
- shadcn/ui Accessible, customisable UI components based on Radix. Default style. Slate base colour with CSS variables for colour, by shadcn (docs).
- Pre-installed components: Alert, Avatar, Badge, Button, Card, Checkbox, Command, Dialog, Form, Input, Label, Popover, Radio Group, Select, Sonner, Switch, Tabs, Textarea, Tooltip
- VS Code extensions: shadcn/ui (by Suhel Makkad), shadcn/ui snippets (by Neeraj Dalal).
- More at awesome-shadcn-ui.
- React Hook Form: Performant, flexible and extensible forms with easy-to-use validation (docs).
- Zod: TypeScript-first schema validation with static type inference.
- Drizzle: Database ORM with TypeScript support (docs).
- Configured for Turso for local and production SQLite databases (docs).
- Extensions: Drizzle ORM snippets (VS Code) by Manuel Gil, Drizzle Studio Chrome.
- SST (Ion): Deployment framework for AWS/Cloudflare with OpenNext support (docs).
- T3 Env: Type-safe environment variables (docs).
- Auth.js: Authentication library (docs).
- via Drizzle adapter
- Google Analytics: Via @next/third-parties (docs).
- Sentry: Error tracking and performance monitoring (docs)