Skip to content

Getting Started with RapidRoot

This guide shows you how to get the boilerplate running locally. Note that RapidRoot relies on several external services—Supabase, Stripe, Resend, Upstash, and PostHog—all of which must be configured in your .env before the app will start successfully.


1. Prerequisites

  1. Node.js (version 18.17 or later)
  2. A package manager (npm, yarn, or pnpm)
  3. Git
  4. A code editor (like VS Code)

2. Required Service Setup

To avoid runtime errors, you’ll need to follow each service’s setup guide and gather the development credentials:

  1. Supabase Setup
    • Get your NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, and SUPABASE_SERVICE_ROLE_KEY.
  2. Stripe Setup
    • Generate test keys: STRIPE_PUBLIC_KEY, STRIPE_SECRET_KEY, and STRIPE_WEBHOOK_SECRET.
  3. Resend Setup
    • Obtain RESEND_API_KEY (and optional domain/audience IDs).
  4. Upstash Setup
    • Create a Redis instance and note UPSTASH_REDIS_REST_URL & UPSTASH_REDIS_REST_TOKEN.
  5. PostHog Setup
    • Use NEXT_PUBLIC_POSTHOG_KEY and NEXT_PUBLIC_POSTHOG_HOST.

Tip: In each guide, you’ll find details on how to create test accounts, configure dev environments, and copy the required variables. Complete those steps first.


3. Installation

  1. Clone the repository:

    Terminal window
    git clone https://github.com/Fig-Tree-Labs/rapidroot.git
    cd rapidroot
  2. Install dependencies:

    Terminal window
    # Using npm
    npm install
    # or yarn
    yarn install
    # or pnpm
    pnpm install

4. Environment Variables

  1. Copy the example env (if provided) to .env.local:

    Terminal window
    cp .env.example .env.local
  2. Add credentials for all the services you set up:

    .env.local
    NEXT_PUBLIC_SUPABASE_URL=...
    NEXT_PUBLIC_SUPABASE_ANON_KEY=...
    SUPABASE_SERVICE_ROLE_KEY=...
    STRIPE_PUBLIC_KEY=...
    STRIPE_SECRET_KEY=...
    STRIPE_WEBHOOK_SECRET=...
    RESEND_API_KEY=...
    UPSTASH_REDIS_REST_URL=...
    UPSTASH_REDIS_REST_TOKEN=...
    NEXT_PUBLIC_POSTHOG_KEY=...
    NEXT_PUBLIC_POSTHOG_HOST=...
    # ...any other variables

Important: Without these variables, the app may fail to start or throw runtime errors.


5. Running Locally

Once all required services are configured:

  1. Start the dev server:

    Terminal window
    # Using npm
    npm run dev
    # or yarn
    yarn dev
    # or pnpm
    pnpm dev
  2. Open http://localhost:3000 in your browser to see the app running.

Troubleshooting: If you get errors at startup, double-check your environment variables for typos or missing credentials.


6. Common Commands

  • Lint:

    Terminal window
    npm run lint # or yarn lint / pnpm lint
  • Build (for production):

    Terminal window
    npm run build # or yarn build / pnpm build
  • Start (run production server locally):

    Terminal window
    npm run start # or yarn start / pnpm start

7. Project Structure

rapidroot/
├── app/ # Next.js app router pages and routing
│ ├── (auth)/ # Authentication-related pages (sign-in, sign-up)
│ ├── (main)/ # Main authenticated app pages (dashboard, settings)
│ ├── (marketing)/ # Public marketing pages (landing, pricing)
│ └── blog/ # Blog content and templates
├── actions/ # Server actions for form handling
├── components/ # Reusable React components
│ ├── ui/ # Base UI components (buttons, cards etc)
│ └── [feature]/ # Feature-specific components
├── data-access/ # Database queries and data access layer
├── emails/ # Email templates and email-related logic
├── hooks/ # Custom React hooks
├── lib/ # Utility functions and shared logic
│ ├── seo.tsx # SEO tag generation
│ └── supabase/ # Supabase client configuration
├── public/ # Static assets
├── schemas/ # Data validation schemas
├── services/ # Business logic and service layer
└── types/ # TypeScript types and interfaces

8. What’s Next?


Need Help?

  • FAQ: Check out the FAQ for common issues.
  • GitHub Issues: Report bugs or request features on GitHub.

That’s it! After you configure all the required services, you’re ready to develop and test the boilerplate locally. Happy coding!