Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Fireinthebellyy/ftb-web/llms.txt

Use this file to discover all available pages before exploring further.

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js: Version 20 or higher
  • Package Manager: npm, yarn, pnpm, or bun
  • PostgreSQL: A PostgreSQL database (we recommend Neon for serverless PostgreSQL)
  • Git: For version control

Installation

1

Clone the repository

Clone the FTB Hustle repository to your local machine:
git clone <repository-url>
cd ftb-hustle
2

Install dependencies

Install the required npm packages using your preferred package manager:
npm install
3

Configure environment variables

Create a .env.local file in the root directory with the following variables:
# Database
DATABASE_URL="postgresql://user:password@host:5432/database"

# Authentication - Better Auth
BETTER_AUTH_SECRET="your-secret-key-here"
BETTER_AUTH_URL="http://localhost:3000"

# Email - Resend
RESEND_API_KEY="re_xxxxxxxxxxxx"
EMAIL_SENDER_NAME="FTB Hustle"
EMAIL_SENDER_ADDRESS="noreply@yourdomain.com"

# OAuth Providers
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
LINKEDIN_CLIENT_ID="your-linkedin-client-id"
LINKEDIN_CLIENT_SECRET="your-linkedin-client-secret"

# Payments - Razorpay
RAZORPAY_KEY_ID="rzp_test_xxxxxxxxxxxx"
RAZORPAY_KEY_SECRET="your-razorpay-secret"

# File Storage - Appwrite
NEXT_PUBLIC_APPWRITE_ENDPOINT="https://cloud.appwrite.io/v1"
NEXT_PUBLIC_APPWRITE_OPPORTUNITY_PROJECT_ID="your-project-id"
NEXT_PUBLIC_APPWRITE_OPPORTUNITIES_BUCKET_ID="your-bucket-id"
NEXT_PUBLIC_APPWRITE_USR_AVATAR_PROJECT_ID="your-avatar-project-id"

# Video Streaming - Bunny CDN (Optional)
BUNNY_STREAM_LIBRARY_ID="your-library-id"
BUNNY_TOKEN_SECRET="your-token-secret"
BUNNY_TOKEN_EXPIRY_SECONDS="3600"

# Content Management - Sanity (Optional)
NEXT_PUBLIC_SANITY_PROJECT_ID="your-sanity-project-id"
NEXT_PUBLIC_SANITY_DATASET="production"

# Performance Monitoring (Optional)
PERF_API_TIMING="true"
Most third-party services offer free tiers for development. Check their respective documentation for obtaining API keys.
4

Set up the database

Run Drizzle ORM migrations to set up your database schema:
npm run dz:generate
Use dz:push for quick schema changes during development. Use dz:generate to create migration files for production deployments.
5

Start the development server

Launch the Next.js development server with Turbopack:
npm run dev
The application will be available at http://localhost:3000

Development Commands

Here are the most commonly used npm scripts:
CommandDescription
npm run devStart development server with Turbopack
npm run buildBuild for production
npm startStart production server
npm run lintRun ESLint for code quality checks
npm run testRun Vitest unit tests
npm run test:uiRun tests with Vitest UI
npm run dz:generateGenerate Drizzle migrations
npm run dz:pushPush schema changes to database
npm run dz:pullPull schema from database
npm run cleanClean build artifacts and cache

Code Formatting

FTB Hustle uses Prettier for code formatting with Tailwind CSS plugin:
# Format all files
npx prettier --write .

# Check formatting
npx prettier --check .
Husky is configured to run pre-commit hooks automatically.

Troubleshooting

  • Verify your DATABASE_URL is correct
  • Ensure your PostgreSQL database is running
  • Check if your database accepts connections from your IP
  • For Neon, verify you’re using the correct connection string format
  • Ensure BETTER_AUTH_SECRET is set
  • Verify OAuth credentials (Google, LinkedIn) are correct
  • Check if redirect URIs are properly configured in OAuth providers
  • Confirm email service (Resend) credentials are valid
  • Run npm run clean to clear cache
  • Delete node_modules and reinstall: rm -rf node_modules && npm install
  • Check for TypeScript errors: npx tsc --noEmit
  • Ensure file is named .env.local (not .env)
  • Restart the development server after changing environment variables
  • Check for syntax errors in your .env.local file

Next Steps

Once your development environment is set up:

Build docs developers (and LLMs) love