Skip to content

gordonlau/default-stack

Repository files navigation

Default Stack Template

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.

🚀 Tech Stack

🛠 Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher recommended)
  • pnpm (preferred package manager)
  • PostgreSQL database

🏁 Getting Started

1. Clone the repository

git clone <repository-url>
cd default-stack

2. Install dependencies

pnpm install

3. Environment Configuration

Copy the sample environment file to .env:

cp .env.sample .env

Update .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=localhost

4. Database Setup

Ensure 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-codegen

5. Run the development server

pnpm dev

The app will be available at http://localhost:8080.

📜 Available Scripts

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

📂 Project Structure

/
├── 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors