Skip to content

Development Environment

Preet Patel edited this page May 25, 2020 · 20 revisions

API Keys

Dinr makes use of the Zomato api key to search nearby restaurants. However, the free version of this key is limited to 1000 calls per day, this can be easily exceeded. If you are planning to test or develop the application please provide your own key. You can generate one here. The key can be found in the server/config.ts file.

A word of caution. Due to Zomato’s API limit, a single key may only last 4-5 sessions. Since this project was not meant for production, this compromise was deemed fair.

Setting up the Backend

Dependencies

The backend of this application is built in typescript using Node Js and Nest Js.

  • Please install Node Js first by downloading it from here. Installing Node will also install npm.js as well, which is used for package management.
  • Nest Js can then be installed by running $ npm i -g @nestjs/cli

Running the backend

To run the server make sure you are in the server directory.

Dependencies

npm install

  • This will install all needed dependencies. Please ensure you do this before running the server

Development

$ npm run start:dev

  • This will build the project for development use.
  • Nest will monitor the project files and allow for live updates to the code.

Production

$ npm run start

  • This will build then run the project for production.

Tests

$ npm run test

  • This will run all unit tests.

Setting up the Front end

Dependencies

Like the backend, the front end is coded in typescript. You will need yarn installed to run and manage the front end. Instructions for installation methods can be found here.

Setup

Android

To run the project locally on an Android emulator you will need to have Android Studio installed and running on your system. To ensure your environment is setup properly please follow the instructions found here. Carry out the steps under the "React Native CLI Quickstart" tab for your operating system. Dinr was developed on a Pixel with Android 9.0.

IOS

If you wish to run Dinr on ios you will need a MacOS development environment and the following tools.

  • Xcode and Command Line Tools. Installation instructions for both can be found here.
  • CocoaPods, which can be installed from here.
cd ios && pod install && cd ..

Running the frontend

Development

Please ensure that you are in the mobile-app directory to successfully run the following commands.

Dependencies

yarn install -frozen-lockfile

  • If you are running this app for the first time, make sure you run this before starting to ensure all dependencies are installed.

Android

yarn android

  • This will install and run the application on your Android emulator.

IOS

Before running on ios you will need to make sure all the pods are installed. this can be done by the following commands cd ios && pod install && cd ... Once done you can run Dinr with yarn ios.

Clone this wiki locally