Developer Documentation - djgamekid/GDP-Group-I-bearcatmanager GitHub Wiki
Bearcat Event Manager - Developer Documentation
Tools & Services Used
Frontend
- React (v18) - Frontend framework
- Vite - Build tool for faster development
- TailwindCSS with DaisyUI - Styling
- React Router DOM - Routing
- Chart.js with react-chartjs-2 - Data visualization
- react-day-picker - Date selection
- html5-qrcode & qrcode - QR code functionality
Backend/Database
- Firebase - Authentication and database
- Firebase Admin SDK - Backend administrative functionality
State Management
- React Context API
AuthContext
- Authentication stateEventContext
- Event management stateTicketContext
- Ticket management state
Setting Up a Development Environment
Prerequisites
Ensure you have the following installed on your system:
- Node.js (v16 or later) - Download Here
- Git - Download Here
- Firebase CLI - Installation Guide
Cloning the Repository
# Open a terminal and navigate to your desired project directory
git clone https://github.com/djgamekid/bearcat-event-manger
cd bearcat-event-manager
cd bearcat-event-manager
Updating dependencies
npm install
Running the Project
Setting Up Environment Variables
Create a .env file in the root directory and add the following environment variables:
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
VITE_FIREBASE_APP_ID=your_firebase_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_firebase_measurement_id
Replace your_firebase_* values with your own Firebase project settings, which can be found in the Firebase Console under Project Settings.
Starting the Development Server
npm run dev
http://localhost:5173/ (default Vite port).
This will start the application atRunning Tests
Prerequisites for Testing
Before running the tests, ensure you have the following tools installed:
- Jest - Unit testing framework for JavaScript/React
- React Testing Library - UI component testing
- Cypress - End-to-end testing framework
- Firebase Emulator Suite - Local testing for Firestore and Authentication
- Postman - API testing for Firebase interactions
Running Unit and UI Tests
To run unit and UI tests, use Jest and React Testing Library. Run the following command:
npm run test
This will execute all the unit tests defined for your components.
Running End-to-End Tests
To run the end-to-end tests using Cypress, use the following command:
npm run cypress
This will run Cypress and test the full user flows, including authentication, event creation, and ticket purchasing.
Contributing
To contribute to the project:
Create a new branch
git checkout -b feature-branch
Make your changes and commit them
git commit -m "Describe your changes"
Push your branch to the repository
git push origin feature-branch
Then, open a pull request on GitHub.