Skip to content

chhatrapalsinh-nitor/NITORASSESSMENTPORTAL-withoutdocker

Repository files navigation

NitorAssessmentPortal

NitorAssessmentPortal is an internal assessment portal for Nitor Infotech Pvt. Ltd.

Table of contents

Backend App Setup Steps

  1. Go to the cloned directory
  2. Setup .venv
python3.10 -m venv .venv
  1. Install system dependencies
sudo apt install libpq-dev python3-dev build-essential
  1. Activate venv, install requirements and go inside project app directory
source .venv/bin/activate
pip install -r nitoronlinetestportal/requirements.txt
cd nitoronlinetestportal
  1. Check and run migrations
./manage.py showmigrations
./manage.py migrate
  1. Create superuser
./manage.py createsuperuser

Frontend App Setup Steps

  1. Go to the cloned directory
  2. Setup node_modules using node version v14.21.3 & npm version 6.14.18
cd nitoronlinetestportal/static/
npm i

Setup pre-commit hook

  1. Go to the cloned directory
  2. Activate venv if not already done
source .venv/bin/activate
  1. Install the git hook script
pre-commit install

Validate if getting the result as pre-commit installed at .git/hooks/pre-commit

  1. After this before every commit command, unit test will run automatically.
  2. If you get error: Executable pytest not found, please check if virtual environment is activated or not.
  3. Read more on pre-commit

Running the application

  1. Go to the cloned directory
  2. Activate venv if not already done and go to project app directory
source .venv/bin/activate
cd nitoronlinetestportal
  1. Run backend server
./manage.py runserver
  1. In a new shell, go to cloned directory
  2. Go to static directory and run frontend server
cd nitoronlinetestportal/static/
npm run dev

Using postresql database for development

  1. Stop server if running
  2. Download & install postgresql server locally, refer https://www.postgresql.org/download/ for installation instructions.
  3. Connect to postgres database from shell or UI (or use command psql postgres on freshly install postgres server) and create database and user as per DATABASE configuration in nitoronlinetestportal/settings.py file.
-- create database
create database db_name_here;

-- create user
create user username_here with encrypted password 'password_here';

-- grant db permission to user
grant all privileges on database db_name_here to username_here;
  1. Apply migrations, create superuser and run server

Generate entity relationship from models

  1. After setting up the project, go to the cloned directory
  2. Activate venv if not already done and go to project app directory
source .venv/bin/activate
cd nitoronlinetestportal
  1. Run below command to generate a .png file
./manage.py runserver
manage.py graph_models -a -o models.png

References

  1. Postman Collection for backend APIs

About

NITORASSESSMENTPORTAL-withoutdocker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages