/cosecha-mobile-api

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

Cosecha Mobile Api

A public API for the mobile app, and mobile apps to consume.

Dependencies

Make sure you have the following installed on your computer

  1. Node.js (latest)
  2. Yarn
  3. Git
  4. Mongo
  5. Xcode Command Line Tools: xcode-select --install (required to properly install the bcrypt package)

Development Setup

  1. Clone the repository

  2. Setup the environment variables in the / directory: cp src/.env.example src/.env

  3. Install node modules in the /src directory, we recommend using Yarn: yarn in the /src directory

  4. Run MongoDB service: brew services start mongodb

  5. Update the MongoDB database: yarn run bootstrap in the /src directory

  6. Start server: yarn start in the /src directory

  7. To shut down server: Ctrl + c in server terminal

  8. To shut down database: brew services stop mongodb

Scripts

  • yarn start: starts the server (also npm start)
  • yarn test: performs testing (also npm test)
  • yarn run lint: runs the linter (also npm run lint)
  • yarn run bootstrap: populates your local mongo db with sample data (also npm run bootstrap)