Systemy-rozmyte-sql/README.md
2021-12-04 21:41:57 +01:00

1.2 KiB

Systemy rozmyte

Frontend URL

http://localhost:8080/

Backend URL

http://localhost:8000/

Run in Docker

You need to install Docker and Docker-compose

Running in docker

To build:

make build

To run:

make up

Locally

Requirements

  • Python 3.10
  • PostgreSQL
  • Node v15.13.0

Create virtual environment

python3 -m venv venv
. venv/bin/activate

Install requirements:

make install

Create .env file in backend directory & copy variables:

SECRET_KEY=SECRET_KEY
DEBUG=1
ALLOWED_HOSTS=localhost 127.0.0.1
SQL_HOST=localhost
SQL_PORT=5432
POSTGRES_PASSWORD=sysrozm
POSTGRES_DB=sysrozm
POSTGRES_USER=sysrozm

Create database:

sudo -u postgres psql
CREATE DATABASE sysrozm;
CREATE USER sysrozm WITH PASSWORD 'sysrozm';
GRANT ALL PRIVILEGES ON DATABASE sysrozm TO sysrozm;

Allow user to create databases:

ALTER USER sysrozm CREATEDB;

Run

(cd backend && python3 manage.py runserver)
(cd frontend && npm run serve)

Install pre-commit

  1. Run command in project directory
make install-pre-commit

Run linters

  1. Run command in project directory
make lint