NitorAssessmentPortal is an internal assessment portal for Nitor Infotech Pvt. Ltd.
- Local application setup guide (One time setup)
- Clone the repository
- Backend app setup steps
- Frontend app setup steps
- Setup pre-commit hook
- Running the application
- Using postresql database for development
- Generate entity relationship from models
- References
- Go to the cloned directory
- Setup .venv
python3.10 -m venv .venv
- Install system dependencies
sudo apt install libpq-dev python3-dev build-essential
- Activate venv, install requirements and go inside project app directory
source .venv/bin/activate
pip install -r nitoronlinetestportal/requirements.txt
cd nitoronlinetestportal
- Check and run migrations
./manage.py showmigrations
./manage.py migrate
- Create superuser
./manage.py createsuperuser
- Go to the cloned directory
- Setup node_modules using node version v14.21.3 & npm version 6.14.18
cd nitoronlinetestportal/static/
npm i
- Go to the cloned directory
- Activate venv if not already done
source .venv/bin/activate
- Install the git hook script
pre-commit install
Validate if getting the result as pre-commit installed at .git/hooks/pre-commit
- After this before every commit command, unit test will run automatically.
- If you get error:
Executable pytest not found
, please check if virtual environment is activated or not. - Read more on pre-commit
- Go to the cloned directory
- Activate venv if not already done and go to project app directory
source .venv/bin/activate
cd nitoronlinetestportal
- Run backend server
./manage.py runserver
- In a new shell, go to cloned directory
- Go to static directory and run frontend server
cd nitoronlinetestportal/static/
npm run dev
- Stop server if running
- Download & install postgresql server locally, refer https://www.postgresql.org/download/ for installation instructions.
- 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;
- Apply migrations, create superuser and run server
- After setting up the project, go to the cloned directory
- Activate venv if not already done and go to project app directory
source .venv/bin/activate
cd nitoronlinetestportal
- Run below command to generate a
.png
file
./manage.py runserver
manage.py graph_models -a -o models.png