yarn add
to add libraries
yarn install
to install dependencies
Refer to this discussion.
In /api: yarn run formatAll
In /mobile: yarn run formatAll
yarn run resetDb
For all routes created, ensure authorizaiton of user via authmiddleware. For Example:
{
eventRouter.post("/", [auth], async (req: Request, res: Response) => {
....
// [auth] function puts the user id in the req, it can be accessed via:
const id = (req as AuthRequest).user.id;
}
}
- Get the API KEY from Ally
- Create a file called .env in the api folder. Put the key in it as GOOGLE_MAPS_API_KEY=PastedKey
- Run source .env to load in your api variables in the api folder
- Then be happy :)
Our app is distributed for development through Expo. In order to publish a release to expo, follow these instructions.
The API is deployed on Heroku. Deployment is handled through git. Here's a guide on how to deploy to Heroku using git.
The gist of it is that when you are ready to deploy, make sure that your changes are all committed (ie: git status returns "all up to date"). Change into the root WiGo folder and execute this command:
git subtree push --prefix api heroku master
We are pushing just the api folder to Heroku, since that is where the package.json and the code for the api lies. You should see a series of steps being executed in order to prepare the code for production. `