Management and data viewing portal for recycling department administrators.
This is part of a suite of apps made for Georgia Tech's OSWM&R, which also includes:
- route-recorder: Buddy app for recycling department crewmembers working recycling routes
- recycling-checkin: Daily check-out/check-in for recycling department crewmembers needing GT property
- latest stable version of Node
- latest stable version of NPM (usually included with the Node installation)
- the Firebase CLI
- the Angular CLI
- access to our Firebase console
- read/write access to this Github repo
- read/write access to our private Github repo
- credentials (see below)
Until you add credentials, the project will not run, and there will be an error about missing imports. Credentials are required for both development and deployment.
- Go to our Firebase console settings
- Retrieve the code for the Firebase config object (Your Apps -> Web apps -> Admin website -> Firebase SDK Snippet -> Config)
- Make a new file called
firebase.ts
and place it in thesrc/environments
directory, and export the Firebase config object asdefault
- A template,
src/environments/firebase-template.ts
, is provided as a reference for this step. This file doesn't do anything else.
- A template,
It is not necessary to secure Firebase API keys like this, but we do so as an extra layer of security.
This project uses Firebase services: Authentication, Firestore, and Functions.
To run locally for development:
- In a CLI, install dependencies with
npm i
- Also navigate to the
functions
folder to install Firebase functions dependencies:cd functions
,npm i
- Also navigate to the
- Go back to the project root directory and run
npm start
- This will start a local development instance. In a web browser, navigate to http://localhost:4200/ to view
- This also starts the Firebase emulators. The website mostly uses emulated resources during development instead of production data.
- Some sample data is automatically imported for testing purposes.
- Firestore and Functions are emulated. Authentication uses production auth data, and is not emulated due to lack of need.
- Firestore Rules are not emulated, so be mindful when testing new changes.
- If you need the emulated database to contain record data, there are two Functions endpoints (
seedRouteRecords
andseedCheckinRecords
) to help you by seeding some data.
This uses Angular's Github Pages deploy tool, and deploys built files to a private Github Pages instance.
- Run
ng deploy --base-href=/pages/dscgt/recycling_website_dist/ --repo=https://github.gatech.edu/dscgt/recycling_website_dist.git --branch=master --name="your_gatech_display_name_here" --email="your_gatech_email_here"
- View our deploy here.
There is no need to build beforehand, this is done automatically.
firebase deploy --only functions:functionname1,functions:functionname2
For example, firebase deploy --only functions:generateExcelSheet
will deploy only the generateExcelSheet() endpoint.
More information:
https://firebase.google.com/docs/functions/manage-functions#deploy_functions
https://firebase.google.com/docs/cli#deploy_specific_functions
You shouldn't have to do this that often (or at all), since both running for development and deploying to production build automatically.
Building for production:
npm run build-prod
Building for development:
npm run build
Built files are placed in a /dist
directory.
Made by the Developer Student Club at Georgia Tech.