This document provides step-by-step instructions for setting up the Friendly Eats application for local development.
- Node.js (version 16.0 or higher)
- Java (JDK version 11 or higher)
- Angular CLI
- Firebase CLI
To install the CLIs globally, run the following commands:
npm install -g @angular/cli
npm install -g firebase-tools-
Clone the repository:
git clone https://github.com/firebase/quickstart-js.git cd quickstart-js/firestore -
Install dependencies:
npm install (cd functions && npm install) (cd scripts && npm install)
-
Configure Firebase:
The application can be run against the Firebase Local Emulator Suite or a production Firebase project.
-
Emulator Suite: No configuration is needed. The necessary settings are in
src/environments/environment.default.ts. -
Production Project:
- Create a Firebase project in the Firebase Console.
- Copy the
firebaseConfigobject from your project settings. - Paste the
firebaseConfigobject intosrc/environments/environment.prod.ts.
-
-
Run the application:
-
With emulators:
npm start
This command will start the Firebase Emulator Suite and the Angular development server. The emulators are automatically populated with data from the
app-data-seeddirectory on startup. -
Against a production project:
npm run production
-
-
View the application:
Open your browser and navigate to
http://localhost:4200. -
Populating the database (optional):
If you need to add more mock data to your database, you can use the following commands:
-
For emulators:
npm run populate-emulators
-
For a production project:
npm run populate-production
-