This is an opinionated Next.js template bootstrapped with
create-next-app
.
This tries to maintain a separation between API and Client side UI, which is not the intended use of NextJS 14.
.env.example
, rename it to .env
and change
values if needed.docker compose up
in project root directory (or alternative) to start a
postgresql server.npm i -g pnpm
.pnpm install
to install dependencies.pnpm dev
to start the development server.pnpm drizzle-kit studio
to view database content in browser. Or use
a tool like HeidiSQL or DBeaver.pnpm drizzle-kit push:pg
to update the db according to your schemas at any
time. Never use this in production.pnpm drizzle-kit generate:pg
to generate migration
scripts.pnpm tsx migrate-db.ts
in production/staging to run database
migrations.app/api
for (json) API routes.modules
folder organized by feature. Core logic
shouldn't depend on NextJS-specific APIs. Use your best judgement.modules
and make sure to name them
schema.ts
.lib
.components
.
IconButton
π DoDashboardView
π Don'tusers/123/orders
app/users/[id]/orders/page.tsx
tailwind.config.ts
according to your design system and use them
consistently and try to avoid
arbitrary valuesTo learn more about Next.js, take a look at the following resources:
Other: