Thank you for your interest in contributing to the BARS website! This guide will help you get started with contributing to the frontend React application.
- Node.js 18 or higher
- Git
- Bun package manager
- A modern web browser for testing
⚠️ Important for Authentication Development: If you're working on authentication features, user management, or any functionality that requires user login, you MUST also clone and run the BARS backend API locally. The frontend alone cannot handle authentication without the backend.
🔧 Backend Requirement: For authentication features, division management, airport contributions, or any user-related functionality, you need to run both the frontend and backend locally. Clone the BARS API repository and follow its setup instructions before proceeding with frontend development that involves authentication.
-
Fork and Clone
git clone https://github.com/stopbars/Website.git cd WebsiteFor authentication development, also clone the backend:
git clone https://github.com/stopbars/Core.git cd Core # Follow the backend setup instructions in the Core repository cd ../Website
-
Install Dependencies
bun install
-
Configure Environment Variables
Set up environment variables:
copy .env.example .env
Edit
.envand add your API credentials:VITE_VATSIM_CLIENT_ID: Your VATSIM Connect application client IDVITE_MAPBOX_TOKEN: Your Mapbox access token (optional for basic testing)
Configure VATSIM Connect:
To get VATSIM Connect credentials for testing:
- Follow the VATSIM Connect Sandbox Guide to create a development application
- Obtain your client ID and update the
VITE_VATSIM_CLIENT_IDin your.envfile - Set your redirect URL to
http://localhost:8787/auth/callbackin your VATSIM Connect application settings
Note: The VATSIM client ID is required for authentication features to work properly during development.
Configure API URL for local development:
⚠️ REQUIRED for authentication features: Update the API URL insrc/context/AuthContext.jsxto point to your local backend:const apiUrl = 'http://localhost:8787'; // Update this to match your local backend port
Critical: Authentication, user management, division features, and airport contributions will NOT work without a running backend API. Make sure you have cloned and started the BARS API server before testing these features.
Important: Do not commit changes to the API URL. This should remain as a local modification for development purposes only.
-
Start Development Server
bun run dev
The development server will start at
http://localhost:5173with hot module replacement enabled. -
Available Scripts
bun run dev- Start development server with hot reloadbun run build- Build for productionbun run preview- Preview production build locallybun run lint- Run ESLint to check code qualitybun run doctor- Audit React correctness, accessibility, and performance patternsbun run perf:trace- Capture a Chrome performance trace for the home page
Install the Playwright Chromium binary once after installing dependencies:
bunx playwright install chromiumStart the development server, then capture the route you want to investigate:
bun run perf:trace
bun run perf:trace /global-status global-status
bun run perf:trace http://localhost:5173/contribute contributeEach run writes a full Chrome trace and a smaller .summary.json report to
performance-traces/. The directory is ignored by Git.
For authenticated routes, save a Playwright storage-state file locally and set
BARS_TRACE_STORAGE_STATE to its path before running the trace command. Do not
commit storage-state files because they can contain session credentials.
React Grab and React Scan are opt-in development diagnostics. Enable either one
in .env.local, then restart Vite:
VITE_ENABLE_REACT_GRAB=true
VITE_ENABLE_REACT_SCAN=trueKeep both disabled during load traces unless you are specifically measuring the diagnostic tooling itself.
- Use modern React patterns (hooks, functional components)
- Follow existing naming conventions and file structure
- Use TypeScript where applicable (
.tsxand.tsfiles) - Use JSDoc comments for complex functions
- Keep components focused and reusable
- Use Tailwind CSS for styling
src/components/- Reusable React components organized by featuresrc/pages/- Page-level components that represent routessrc/hooks/- Custom React hookssrc/context/- React context providerssrc/utils/- Utility functions and helperssrc/styles/- Global styles and CSSpublic/- Static assets and documentation
- Use functional components with hooks
- Follow the existing component organization pattern
- Keep components small and focused
- Use proper PropTypes or TypeScript interfaces
- Implement proper error boundaries where needed
- 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 new airport contribution formfix: resolve mobile navigation menu issuedocs: update contribution documentationstyle: improve responsive design for tablets
git push origin feature/your-feature-nameCreate a pull request with:
- Clear description of changes
- Reference to related issues
- Screenshots for UI changes
- Testing instructions for new features
- Start the development server:
bun run dev - Test the application in different browsers
- Verify responsive design on various screen sizes
- Test form submissions and user interactions
- Check accessibility using browser dev tools
- Create a production build:
bun run build - Preview the build locally:
bun run preview - Verify all features work in production mode
- Test on mobile, tablet, and desktop screen sizes
- Verify all interactive elements work properly
- Check loading states and error handling
- Ensure accessibility standards are met
- Run
bun installto ensure all dependencies are installed - Clear cache with
rm -rf node_modules package-lock.json && bun install - Check for Node.js version compatibility (18+)
- Ensure Tailwind CSS classes are properly configured
- Check for conflicting CSS rules
- Verify responsive design breakpoints
- Check for missing imports or exports
- Verify PropTypes or TypeScript interfaces
- Ensure proper React hook usage
- Discord: Join the BARS Discord server for real-time help
- GitHub Issues: Create an issue for bugs or feature requests
- Code Review: Ask for review on complex changes
Contributors are recognized in:
- Release notes for significant contributions
- BARS website credits page (coming soon)
Thank you for helping make the BARS website better for the entire virtual aviation community!