Welcome to Duke Ignite 2023! We're glad you're here. This repository will show you how to use Firebase to create a simple mobile ordering app. This app will allow users to order food from a restaurant and view their order history. The frontend was built using NextJS, which is a React framework.
- Clone this repository
- Download NodeJS if you haven't already https://nodejs.org/en/download. (Get the LTS, and download using default settings)
- Open this repository
- In the terminal, install yarn with
npm install --global yarn
(yarn is a NodeJS package manager, and is an alternative to npm) - In the terminal, install dependencies with
yarn install
- Go to https://firebase.google.com/, click "Get Started", and log in with your Google account
- Click "Add Project"
- Name your project "ignite-2023"
- Click "Create Project". Note: You can disable Google Analytics - you won't be needing it
- Click "Web" to add Firebase to a web app (the logo looks like this: </>)
- Nickname your app "ignite-2023". Do not select Hosting (we don't need it)
- Copy your firebaseConfig object! It looks like this:
const firebaseConfig = { apiKey: "api key here" authDomain: "auth domain here", projectId: "project id here", storageBucket: "storage bucket here", messagingSenderId: "messaging sender id here", appId: "app id here", measurementId: "measurement id here", };
. - Paste the config object in /firebase/config.txt. Then, change the filename from
config.txt
toconfig.ts
- Continue to console, and go to sidebar -> Build -> Athentication, and enable Google sign-in. For your own apps, you can enable any other type of sign-in you want, but for this workshop, we'll be using Google sign-in.
- Go back to Build -> Storage -> Get Started -> Start in test mode -> next -> done
- Make sure Build -> FireStore Database is set up. If not, run it in test mode
- Important: Go to Firestore Database -> rules -> change the line to this:
allow read, write: if request.auth != null;
- Run the app with
yarn dev
- Open http://localhost:3000 in your browser
- There you go! Let someone know if you have any problems
This repo was put together by Joe Zakielarz, Duke '24.