A modern, full-stack web application template built with Astro, React, and Node.js. This starter kit integrates robust tools for database management, validation, and styling.
- Framework: Astro (SSR with Node.js adapter)
- UI Library: React
- Island Routing: wouter
- Styling: Emotion (CSS-in-JS)
- Database: PostgreSQL with Kysely (Type-safe SQL query builder)
- Testing: Vitest
- Form Handling: React Hook Form
- Validation: Zod
- State Management: Zustand and Nano Stores
- Data Fetching: @tanstack/react-query
- Formatting: Prettier
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher recommended)
- pnpm (preferred package manager)
- PostgreSQL database
git clone <repository-url>
cd default-stackpnpm installCopy the sample environment file to .env:
cp .env.sample .envUpdate .env with your PostgreSQL credentials.
Note: The application code expects the following variables (ensure these match your .env):
POSTGRES_DATABASE=your_database_name
POSTGRES_USER=your_username
POSTGRES_PASSWORD=your_password
POSTGRES_HOST=localhostEnsure your PostgreSQL server is running and the database specified in POSTGRES_DATABASE exists.
To generate TypeScript types from your database schema (powered by kysely-codegen):
pnpm run kysely-codegenpnpm devThe app will be available at http://localhost:8080.
| Script | Description |
|---|---|
pnpm dev |
Starts the local development server |
pnpm build |
Builds the project for production |
pnpm preview |
Previews the production build locally |
pnpm start |
Same as pnpm preview |
pnpm test |
Runs tests using Vitest |
pnpm kysely-codegen |
Generates TypeScript interfaces from the database schema |
pnpm lint |
Formats code using Prettier |
/
├── public/ # Static assets
├── src/
│ ├── actions/ # Server actions (Zod validation, etc.)
│ ├── assets/ # Source assets (images, fonts)
│ ├── components/ # React components
│ ├── integrations/# Third-party integrations (DB connection)
│ ├── layouts/ # Astro layouts
│ ├── models/ # TypeScript types (DB schema)
│ ├── pages/ # Astro pages/routes
│ └── services/ # Business logic
├── astro.config.mjs # Astro configuration
└── package.json # Project dependencies and scripts