Getting Started Guide

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js 18.17 or later
  • pnpm (Package Manager)
  • Docker Desktop
  • Git

Installation Steps

  1. Clone the Repository
    git clone [repo-url] cd starShip-developer-kit
  2. Install Dependencies
    pnpm install
  3. Set Up Environment Variables

    Copy the provided .env.example file and configure your variables:

    cp .env.example .env

    The .env.example file contains all required environment variables with empty values. Fill in the appropriate values according to your setup. Refer to the Environment Configuration page for detailed information about each variable.

Starting the Development Environment

  1. Start Docker Services
    docker compose up -d
  2. Run Database Migrations
    pnpm run db:migrate
  3. Start the Development Server
    pnpm run dev

The application will be available at http://localhost:3000

Environment Configuration

Configure the following in your .env file:

  • DATABASE_URL - Your database connection string
  • NEXTAUTH_SECRET - Secret for NextAuth.js
  • NEXTAUTH_URL - Your application URL
  • STRIPE_SECRET_KEY - Your Stripe secret key
  • STRIPE_WEBHOOK_SECRET - Your Stripe webhook secret
  • SMTP_HOST - SMTP server host
  • SMTP_PORT - SMTP server port
  • SMTP_USER - SMTP username
  • SMTP_PASSWORD - SMTP password

Additional Development Tools

Drizzle Studio

To view and manage your database through Drizzle Studio (configure port to use different databases):

npx drizzle-kit studio

For local database access with Drizzle Studio, use the dedicated local studio command:

pnpm db:studio:local

This is especially useful when working with multiple database connections or when troubleshooting database issues.

Project Cleanup and Maintenance

The kit includes a cleanup script to help maintain your development environment and reduce disk usage. This is particularly important as Next.js cache files can grow to over 1GB.

pnpm cleanup

This script performs several maintenance tasks:

  • Cleans Next.js cache files (reduces disk usage by ~1GB)
  • Removes temporary Drizzle SQL files
  • Ensures proper .gitignore entries
  • Removes log files
  • Reports on disk usage after cleanup

We recommend running this before committing major changes and whenever you experience unusual behavior in your development environment.

Database Management

Common database commands:

# Generate migrations pnpm run db:generate # Push schema changes pnpm run db:push # Run migrations pnpm run db:migrate

Troubleshooting

  • If you encounter database connection issues, ensure Docker is running and the database container is up
  • For authentication issues, verify your NextAuth.js configuration in the .env file
  • If Stripe integration isn't working, check your API keys and webhook configuration

Next Steps

Ready to start building your SaaS product? Learn how to customize the developer kit and remove features you don't need in our Implementing Your SaaS Product guide.