Skip to content

Jumpi96/helpo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

helpo helpo-api units codecov helpo-web units

Created with Django React Boilerplate.

Conventions

Coding

Documenting

  • English or Spanish accepted

Tools

  • IDE: Visual Studio Code
    • To setup debugger: Download vscode extension "Debugger fo chrome", open the debugger in vscode (bug icon on the left), touch the gear button on the top, select chrome, and change the url to localhost:3000 instead of 8080, and save.
  • Console: cmder
    • Go to settings (Win+Alt+p), startup, tasks, {{cmd:cmder}}, startup dir.. and select your GitHub directory
  • Prototyping: JustInMind
  • UML Modelling: Enterprise Architect
  • Redux dev tools: ReduxDevTools
  • Reactotron (mejor debug para mobile): Reactotron
    • No config needed for mobile, just install the app
    • If using android emulator and it doesnt connect, try adb reverse tcp:9090 tcp:9090

Git

To know how to:

  • Start coding
  • Prepare for a Pull Request
  • Create, update and delete branches

Go to our Git wiki

Running without Docker

Prerequisites

  • Python 3.6.5: Full install, select "Add to PATH", for all users, including debugging binaries (select all options).
  • NodeJS and NPM LTS 8.11.1
  • PostgreSQL 10.3.2: Full install, select all options, password=postgres, port=5432, next.
  • Create a virtualenv for your helpo-api app. Read here

Setup

  • On pgAdmin, open Servers, PostgreSQL 10, right click on Databases and create db with name: db-helpo
  • On project folder helpo-api/:
    • Create file with name .env and text from: API Local ENV Wiki
    • Run on helpo-api/ with virtualenv activated:
pip install numpy
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
npm update
npm update --save
npm install
npm run start

Running with Docker

Prerequisites (with Docker)

  • Install Docker.

Setup (with Docker)

Run

  • From root: docker-compose build
  • From root: docker-compose up
    • If you need pgAdmin4 go to http://localhost:5050 and create a server with:
      • Name: postgres, Host: db, Password: postgres.

Migrations and Docker

  • We have a problem with our optional use of Docker and migrations. If you want to create or modify models in Django, you have to:
    • Do not use Docker to makemigrations and migrate.
      • Change your .env file and run your DB with docker-compose up db.
      • Use pipenv to run your environment and run your Django locally.
      • Run python manage.py makemigrations and python manage.py migrate on your shell.
    • To use Docker again, change your .env file, build your Docker image and run with docker-compose.

Running tests

  • You can run tests from inside the container. Run pytest, create logs folder if needed.

Testing your deployment

  • Open a browser and go to:
    • Helpo-api: localhost:8000
    • Helpo-web: localhost:3000

Running helpo-mobile

Initial Setup

Only the first time:

  1. Follow the Building Projects with Native Code guide picking your OS
  2. Follow the Ignite CLI Installation guide
  3. Remember to Install Yarn paying attention to Ubuntu 16.04 configuration
  4. Open Android Studio and start an Android Virtual Device (AVD)
  5. From helpo-mobile folder, run:
    • yarn install
    • react-native run-android (or react-native run-ios in case you are Lucho)

Run (helpo-mobile)

Whenever you want to code, after initial setup:

  • Android
    1. Open Android Studio and start an Android Virtual Device (AVD)
    2. From helpo-mobile folder, run:
      • npm start
    3. Tap twice R inside AVD to reload Helpo app.

Using local API

  • Add your server (the IP where the JS bundler is working) IP to base.py configuration file. For example, 10.0.2.2.
    • Add to ALLOWED_HOSTS (without the port) and CORS_ORIGIN_WHITELIST (with its port --> 10.0.2.2:8000).
  • Change IP of api.js configuration file in helpo-mobile.

Reinstalling dependencies and packages

  • Repeat Step 5 from Initial Setup if mobile dependencies have changed