A monorepo project built with Nx workspace architecture.
- api - Firebase Functions API
- auth-service - Authentication service for user management
- firebase-app - Main Firebase application
- game-engine - Game engine Firebase function
- github-receiver - GitHub webhooks receiver Firebase function
- web - Web application
Libraries that can be used in both server and client applications
- @shared/github-interfaces - GitHub interface definitions
- @codeheroes/activity - Activity tracking and processing
- @codeheroes/common - Core utilities and shared functions
- @codeheroes/event - Event handling and processing
- @codeheroes/gamify - Gamification logic and rules
- @codeheroes/providers - Shared service providers
The following libraries are deprecated and will be removed in future versions:
- @codeheroes/migration - Legacy Core library
- @codeheroes/migration-shared - Legacy core models library
Note: Database seeds library is maintained for development purposes:
- @codeheroes/database-seeds - Database seeding tools
- Node.js
- Firebase CLI:
npm install -g firebase-tools
- NX CLI:
npm install -g nx
-
Install dependencies:
npm install
-
Configure Firebase project:
- Create a
.env
file in the root directory with the following variables:FIREBASE_PROJECT_ID=your-firebase-project-id FIREBASE_API_KEY=your-firebase-api-key FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com FIREBASE_STORAGE_BUCKET=your-project.appspot.com FIREBASE_MESSAGING_SENDER_ID=your-sender-id FIREBASE_APP_ID=your-app-id
- These values can be found in your Firebase Console under Project Settings > General
- Run the setup script to generate environment files:
This will:
npm run setup
- Generate
.firebaserc
file with your project ID - Create environment files for the web application:
apps/web/src/environments/environment.local.ts
(development)apps/web/src/environments/environment.prod.ts
(production)
- Create a
-
Start development environment:
- To start the Firebase emulator suite with the firebase-app:
This will:
nx serve firebase-app
- Start the Firebase emulators (Functions, Firestore, Auth, etc.)
- Watch for code changes and rebuild automatically
- Import/export emulator data from
.emulators
directory
- To start the Firebase emulator suite with the firebase-app:
-
Access development environment:
- Firebase Emulator UI: http://localhost:4000
- Functions Emulator: http://localhost:5001
- Firestore Emulator: http://localhost:8080
- Auth Emulator: http://localhost:9099
- Create a feature branch
- Make your changes
- Run tests:
nx affected:test
- Run lint:
nx affected:lint
- Submit a pull request
This project is licensed under the ISC License - see the LICENSE file for details.