Skip to content

Development Env

Henrique Dias edited this page Mar 31, 2023 · 4 revisions

This tutorial explain how to build a development environment to run NoHarm Backend.

Requirements

  • PostgreSQL > 10.x
  • Python > 3.x
  • Pip3
  • Git

PostgreSQL

Run noharm-database scripts in your PostgreSQL instance in the following order:

  1. noharm-public.sql
  2. noharm-create.sql
  3. noharm-triggers.sql
  4. noharm-insert.sql
  5. noharm-newuser.sql

you can run a similar script this in command line

Python

Install

$ git clone https://github.com/noharm-ai/backend
$ cd backend
$ python3 -m venv env
$ source env/bin/activate
$ pip3 install -r requirements.txt

Test your Env

$ python3 mobile.py &
$ curl -X POST -d '{"email":"teste", "password":"1234"}' -H "Content-Type: application/json"  http://127.0.0.1:5000/authenticate
$ curl -X GET http://127.0.0.1:5000/prescriptions

Run Tests

$ python -m pytest -v
$ python -m pytest -v -k "test_get_existing_memory"
Clone this wiki locally