- authentication
- authorization
- user info gathering (bio and displayName)
- mobx as state management liabrary
- firebase for backend and authentication
- react hook form
- some of the npm scripts use bash commands so its best to run in a bash shell
- install nvm and use node -v 10.15.3 and npm -v 6.4.1
cd ./frontend; npm i && cd ../functions; npm i
you have to setup credentials by creating a service account and adding them to some absolute directory for which you can then add that path to functions/src/index.ts
in the future we should add these to the environmental variable, or just figure out how to get default credentials working (it throws an error looking for default credentials and this is kind of a hack to have it work)
credential: admin.credential.cert('./creds.json')
cd ./functions/; npm run start
#run just the functions emulator
npm run emulate
#run the firestore emulators
firebase emulators:start --only firestore
1. setup a firebase project
2. go to settings
3. create new web app
4. copy the config into frontend/src/app/config/index.ts
npm i -g firebase-tools
firebase login
firebase use {PROJECT_ID}
import { firebaseFunctions } from 'app/firebase/base';
const testFunc = firebaseFunctions.httpsCallable("testFunc")
testFunc({hello: "world"})
import * as React from 'react';
import { GLOBAL_STATE } from 'app/constants';
import { inject, observer } from 'mobx-react'
@inject(GLOBAL_STATE)
@observer
export class Home extends React.Component{
render() {
return (
<div>
{this.props[GLOBAL_STATE].VALUEWITHINMOBXSTORE}
</div>
);
}
}
tree -d -I 'node_modules|lib'
this is the information collected on a user before they can use the app
currently only has ["bio", "displayName"]
, however you can easily extend this by editing the
- firestore.rules
- frontend/src/app/containers/UserInfo/index.tsx to include more input fields
- shared/src/shared_interfaces.ts
route guard allows you to define user roles and make it so that if a user does not have those roles then they are barred from accessing that route
<RouteGuard path="/admin" allowedRoles={["admin"]}>
<Route ...
</RouteGuard>