Skip to content

Prekols-Inc/calculator

Repository files navigation

calculator

Build (Linux)

Backend

cd backend
sudo apt install python3.11-venv
python3 -m venv .venv # create virtual environment
source .venv/bin/activate # activate venv
pip install -r requirements.txt# install all dependencies from requirements.txt

python3 app.py # start server

Frontend

Dev build

cd frontend
sudo apt install nodejs
sudo apt install npm
npm install
npm run dev

Release build

cd frontend
sudo apt install nodejs
sudo apt install npm
npm install
npm run build
npm run preview

Database launch (MySQL)

To start MySQL in a Docker container run:

docker run --rm --name calculator-mysql \
  -e MYSQL_ROOT_PASSWORD=passwd \
  -e MYSQL_DATABASE=calculator_db \
  -e MYSQL_USER=calc_user \
  -e MYSQL_PASSWORD=calc_pass \
  -p 3306:3306 \
  -d mysql:8

Check for Docker container calculator-mysql:

docker ps

Expected output:

CONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS         PORTS                                                    NAMES
aaa9d16acc03   mysql:8   "docker-entrypoint.s…"   5 seconds ago   Up 4 seconds   0.0.0.0:3306->3306/tcp, [::]:3306->3306/tcp, 33060/tcp   calculator-mysql

To get into database:

docker exec -it calculator-mysql mysql -u <username> -p <password>

Tests

pytest -v # full output of the test results list
pytest -q # brief summary of test results

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5