Local Development Setup

For local development and testing on your own machine.

Prerequisites

Before you begin, ensure you have:

Step 1: Clone the Repository

Using Git Command Line

Open your terminal and run:

git clone https://github.com/incredibotsftc/teamforge.git
cd teamforge

Or Fork and Clone

If you plan to contribute or customize:

  1. Go to github.com/incredibotsftc/teamforge and click the Fork button
  2. Clone your fork:
git clone https://github.com/YOUR_USERNAME/teamforge.git
cd teamforge

Step 2: Install Dependencies

Run the following command in your terminal:

npm install

This will install all required packages. It may take a few minutes.

💡 Tip: If you prefer Yarn or pnpm, you can use those instead:

yarn install
# or
pnpm install

Step 3: Set Up Environment Variables

Create .env.local File

Copy the example environment file to create your local configuration:

# On macOS/Linux
cp .env.example .env.local

# On Windows (Command Prompt)
copy .env.example .env.local

# On Windows (PowerShell)
Copy-Item .env.example .env.local

Configure Your Environment Variables

Open .env.local in your code editor. You'll see the following template:

# Supabase Configuration
# Get these values from your Supabase project settings
NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key

# FTC Events API (Optional - for team import and match data scouting features)
# Get credentials from: https://ftc-events.firstinspires.org/
# Uses HTTP Basic Authentication
FTC_API_USERNAME=your-ftc-username
FTC_API_KEY=your-authorization-key

Replace the Supabase placeholder values with your actual credentials. See the Cloud Deployment guide for how to obtain these values.

📝 Note on FTC API Credentials

The FTC_API_USERNAME and FTC_API_KEY are optional for initial setup. You can leave these as placeholders for now. They're only required later when you want to enable the scouting feature to import team data and match information.

⚠️ Never Commit .env.local!

The .env.local file is already in .gitignore and should never be committed to version control.

Step 4: Set Up the Database

You'll need to create a Supabase project and run the database migrations:

  1. Follow the Database Setup Guide to create your Supabase project and get your credentials
  2. Add those credentials to your .env.local file (as shown in Step 3 above)
  3. Follow the migration steps in the Database Setup guide to set up your database schema

Step 5: Start the Development Server

Run the development server:

npm run dev

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

💡 Development Mode Features

  • Hot reload - Changes appear instantly
  • Detailed error messages
  • React DevTools support

Step 6: Make Changes

You can now:

  • Edit pages in the app/ directory
  • Modify components in components/
  • Update styles in component files or globals.css
  • See changes instantly in your browser

Building for Production

To create a production build:

npm run build
npm start

This will:

  1. Create an optimized production build
  2. Start a production server on http://localhost:3000

Troubleshooting

Having issues with local development? Open an issue on GitHub for help.