Thank you for your interest in contributing to BARS Core! This guide will help you get started with contributing.
- Node.js 18 or higher
- Git
- Bun package manager (https://bun.sh/)
- Wrangler CLI:
bun install -g wrangler - Cloudflare account (for any testing with live services)
-
Fork and Clone
git clone https://github.com/stopbars/Core.git cd Core
-
Install Dependencies
bun install
-
Configure Development Environment
Set up Cloudflare configuration:
The
wrangler.jsoncfile is already configured and safe to use as-is. For local testing, you'll need to:- Create your own D1 SQL database in the Cloudflare Dashboard (Storage & Databases > D1 SQL)
-
Edit
wrangler.jsoncand update the database configuration (see comments in the file):account_id: Your Cloudflare account ID (found in dash.cloudflare.com/your-id/home)VATSIM_CLIENT_ID: Your VATSIM Connect application client IDdatabase_name: Your D1 database name (e.g., "bars-dev")database_id: Your D1 database ID (found in your database page)
-
Update
package.jsonscripts to use your database name:- Replace
bars-dbwith your database name in theupdate-db-localandupdate-dbscripts - Example:
"update-db": "wrangler d1 execute bars-dev-example --remote --file schema.sql",
- Replace
Warning
Important: Do not commit changes to wrangler.jsonc or package.json database configuration. These are for local development only and should remain as local modifications.
Setup environment variables:
copy .dev.vars.example .dev.varsEdit .dev.vars and add your API credentials:
VATSIM_CLIENT_SECRET: Your VATSIM Connect application secretAIRPORTDB_API_KEY: Your AirportDB API key (optional for basic testing)
- Start Development Server
bun run dev
- Use TypeScript for all new code
- Follow existing naming conventions
- Use JSDoc comments for public methods
- Use meaningful variable and function names
- Follow RESTful principles
- Use appropriate HTTP status codes
- Include proper CORS headers
- Validate all input data
- Use prepared statements for all queries
- Include proper indexes for performance
- Follow the existing schema patterns
- Test database migrations carefully
- Browse existing issues for bug fixes or feature requests
- Create a new issue for significant changes
- Discuss the approach before starting work
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Write clean, well-documented code
- Test your changes thoroughly
- Update documentation if necessary
git add .
git commit -m "Add brief description of your changes"Use clear, descriptive commit messages:
feat: add support for approach lightingfix: resolve stopbar state synchronization issuedocs: update contribution documentation
git push origin feature/your-feature-nameCreate a pull request with:
- Clear description of changes
- Reference to related issues
- Screenshots for UI changes (if applicable)
- Start the development server:
bun run dev - Test API endpoints with curl or Postman
- Verify database operations work correctly
- Test real-time functionality with WebSocket clients
For features requiring VATSIM authentication, you'll need:
- Valid VATSIM developer account (Sandbox account)
- Test OAuth application
- Test VATSIM credentials
- Ensure your D1 database is properly configured
- Check that all required tables exist
- Verify your SQL syntax is compatible with Cloudflare D1
- Always include proper CORS headers in responses
- Test with different origins during development
- Keep type definitions up to date
- Use proper interfaces for all data structures
- Run
bun run typegenafter schema changes
- Discord: Join the BARS Discord server for real-time help
- GitHub Issues: Create an issue for bugs or feature requests
- Code Review: Ask for reviews on complex changes
Contributors are recognized in:
- Release notes for significant contributions
- BARS website credits page (coming soon)
Thank you for helping make BARS better for the entire virtual aviation community!