A modern Next.js template with TypeScript, Tailwind CSS, and shadcn/ui components.
- Node.js 18+
- pnpm
-
Install dependencies:
pnpm install
-
Configure environment variables:
cp .env.example .env
Edit
.envwith your values:INFISICAL_CLIENT_IDINFISICAL_CLIENT_SECRETAPP_NAME
-
Update CI/CD configuration:
Edit .github/workflows/quality-gate.yml:
- Set
INFISICAL_SECRET_PATHto/{APP_NAME}
Edit .github/workflows/migrate-db.yml:
- Uncomment the push trigger
- Set
-
Start development:
pnpm dev
src/
├── app/ # Next.js App Router (pages, layouts, API routes)
├── components/ # React components
│ └── ui/ # shadcn/ui components
├── hooks/ # Custom React hooks
├── lib/ # Utilities and helpers
├── server/ # Server-side code (services, repositories, config)
└── types/ # TypeScript definitions
See individual folders for detailed organization guidelines.
The API follows a layered architecture pattern:
Component → API Route (app/api/) → Service (server/services/) → Repository (server/repositories/) → Database
- API Routes: Handle HTTP requests, validation, and responses
- Services: Contain business logic and orchestrate operations
- Repositories: Handle data access and database queries
This separation keeps business logic isolated from HTTP concerns and data access.
Built with shadcn/ui using the New York style variant:
- CSS Variables: All colors and tokens defined in
globals.cssusing OKLCH color space - Dark Mode: Automatic support via semantic color tokens (
bg-primary,text-muted, etc.) - Component Variants: Built with
class-variance-authority(cva) for consistent variants - Utility Function: Use
cn()from@/lib/utilsto merge classNames - Path Aliases: Import with
@/(e.g.,@/components/ui/button)
Component Organization follows Atomic Design principles:
- Atoms (
components/ui/): Basic building blocks (Button, Input, Card) - Molecules (
components/): Simple combinations of atoms (SearchBar, FormField) - Organisms (
components/): Complex UI sections (Navigation, ProductGrid, Dashboard)
This hierarchy promotes reusability and maintainability by composing simple components into complex interfaces.
Always use semantic tokens instead of hardcoded values to maintain theme consistency.
Add UI components:
pnpm ui:add [component-name]- Next.js 16 (App Router) • TypeScript • Tailwind CSS
- shadcn/ui • Framer Motion • Lucide Icons
See LICENSE for details.