- Python 3.9+
- Start the Postgresql Database:
docker-compose up db
from the main directory. - 2 options to install dependencies
- With Poetry (recommended, install Poetry)
cd backend
to change directory to the backend folder.poetry shell
to activate a virtual shell for the back-end.poetry install
to install Python dependencies.
- Without Poetry:
cd backend
to change directory to the backend folder.python -m venv .venv
to create a virtual environment.source .venv/bin/activate
to activate the virtual environment.pip install -r requirements.txt
to install the dependencies.
- Run:
./prestart.sh
to populate initialize some data to the database. If you get permission error when executing this command, runchmod +x ./prestart.sh
to add execution permission to the file. The first admin will have the following login info:
-
Admin user:
- email:
user@user.user
- password:
password
- email:
-
Test user 1:
- email:
william.arbour@gmail.com
- password:
costion
- email:
-
Test user 2:
- email:
ana.miranda@gmail.com
- password:
teranda
- email:
-
bash -c "uvicorn backend.main:app --host 0.0.0.0 --port 8000"
: To start the back-end.
The back-end starts at localhost:8000 by default.
In addition, localhost:8000/docs has the swagger ui for the back-end API.
cd frontend
to change directory to the frontend folder.npm i
to install node dependencies.npm run serve
to start the server with hot reload.
By default, front-end starts at localhost:8080.
docker-compose up
: To start all the containers.docker-compose up --build
: To rebuild if there's any changes.
make lint-backend
: to run linter through all backend code (all dependencies needed to be installed inside./venv
)make lint-frontend
: to run linter through all frontend code (all dependencies needed to be installed insidenode_modules
)poetry export -f requirements.txt --output requirements.txt
to export all poetry dependencies to requirements.txt file
While inside virtual environment created by Poetry.
cd backend
to change directory to the backend folder (the directory that containspyproject.toml
)poetry run pytest
to run all tests.poetry run pytest -k "prefix_of_your_test_name"
to run a subset of test cases.- Example: If run
poetry run pytest -k "test_check"
, that will run 2 tests:test_check_user_created
andtest_check_shelves_have_books
, but nottest_create_user
- Example: If run
- Back-end: Python with FastAPI
- Database: PostgreSQL with SQLAlchemy
- Front-end: Vue.js