Prerequisites
Before you begin, ensure you have the following installed:- Node.js version 24.13.0 or higher
- pnpm package manager (version 10.28.2 or compatible)
- Git for version control
Installation Steps
Fork and Clone the Repository
Fork the Birdflop website repository on GitHub at github.com/birdflop/web, then clone your fork:
Install Dependencies
Navigate to the project directory and install all necessary dependencies:This will automatically run the
postinstall script which generates Drizzle types and Cloudflare worker types.Build the Project
Run the initial build to set up the RGBirdflop package and Cloudflare worker types:This is only necessary the first time you set up the project to avoid type errors.
Database Setup (Optional)
The Birdflop website uses Cloudflare D1 for its database. Setting up a local database is required for contributing to the Presets system and other features that depend on database functionality. Without this setup, Flopbird may show errors when opening certain pages.Migrate the Local Database
Run the migration command to set up the local database schema:This creates and configures a local D1 database with the required schema.
Environment Variables (Optional)
For Discord login functionality to work locally, you’ll need to set up a Discord application and configure environment variables.Create a Discord Application
- Visit the Discord Developer Portal
- Create a new application
- Navigate to the OAuth2 section
- Add
http://localhost:5173/auth/callback/discordas a redirect URI - Note your Client ID and Client Secret
Available Scripts
Here are the main scripts you’ll use during development:Development
Building
Database Management
Code Quality
Deployment
Verify Your Setup
To verify everything is working correctly:- The development server starts without errors
- You can access
http://localhost:5173in your browser - The site loads and navigation works
- TypeScript shows no errors in your editor
Troubleshooting
Port Already in Use
If port 5173 is already in use, the dev server will try to use the next available port. Check the terminal output for the actual URL.Type Errors
If you see TypeScript errors:Database Errors
If you get database-related errors, ensure you’ve run:Module Not Found
Try deletingnode_modules and reinstalling: