Skip to content

Latest commit

 

History

History
130 lines (97 loc) · 2.39 KB

setup.md

File metadata and controls

130 lines (97 loc) · 2.39 KB

How to run the app locally

First, run these commands in terminal:

Step 1:

git clone [repository-url]

Step 2:

cd [local-repository]

Step 3:

  • install VS Code or other preffered IDE

install following frameworks and packages, and DB:

  • Node.js + React.js
  • Python 3.8 + Django
  • Cypress
  • PostgreSQL

For back-end, carry out the following steps:

Step 1:

create and start a a virtual environment:

virtualenv env --no-site-packages
source env/bin/activate

Step 2:

Install the project dependencies:

pip install djangorestframework
pip install markdown       # Markdown support for the browsable API.
pip install django-filter  # Filtering support
pip install django-cors-headers

Step 3:

create a postgres db with the following settings:

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "text",
        "USER": "postgres",
        "PASSWORD": "postgres",
        "HOST": "127.0.0.1",
        "PORT": "5432",
    }
}

Step 4:

Run these commands in terminal:

python manage.py migrate

python manage.py createsuperuser        # create admin account

python manage.py makemigrations server  # makemigrations for the app

python manage.py migrate                # run again

python manage.py runserver              # start the development server

Step 5:

open localhost:8000 on your browser to view the app


For front-end, carry out the following steps:

Step 1:

Check package.json file and ensure scripts are notated as below:

  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "test:cov": "npm test -- --coverage --watchAll=false",
    "test:debug": "react-scripts --inspect-brk test --runInBand",
    "eject": "react-scripts eject"
  },

Step 2:

Delete the node_modules folder and any 'lock' files, such as yarn.lock or package-lock.json if present.

Step 3:

Run these commands in terminal:

npm install

Optional: In case of issues shown after npm install, run the below to automatically fix the issues:

npm audit fix

Alternatively, use the below to see the errors:

npm audit

Step 4:

npm start

Step 5:

open localhost:3000 on your browser to view the app