An AI-driven application used in SCADEMY's AI courses
- Copy
.env.sample
to.env
cp .env.sample .env
- Obtain
OPENAI_API_KEY
from the KeePassX db. Its name is OpenAI API key for AI course - Add it to
.env
- Navigate to
/client
and install dependencies there. - Use
yarn
to install new ones.
Once you have these installed, you are all set. All development happens within the container.
Dockerfile
describes the container for the app. docker-compose.yml
describes the environment outside of the app container, like DBs, queues, etc.
Using make
. Check out the Makefile
.
For Windows, there is NMake. Or you may use make for windows.
Create fresh-cart.log
in the root directory of this repo first.
make start
Prerequisites
make build
make start
make tmigrate
To run all tests
make test
To run a specific test class
make sh
poetry run nose2 -v tests.api.platform.portal.api_test
Path is the relative path of the file, /
replaced with .
and file extension is removed (.py).
To run a specific test case
make sh
poetry run nose2 -v tests.api.platform.portal.api_test.TestPortalApi.test_get_participant_portal_config_returns_correct_data
The path is same as before, test class and method is appended.
Download Build Tools for Visual Studio 2019
from Microsoft's VS site. Install only MSVC ... build tools
under C++ build tools
.
Dependencies are managed via poetry
. To manage dependencies always connect to the container (make sh
) and run poetry within.
To add a new package use poetry add [package-name]
.
The project uses Postgresql w/ SQLAlchemy as an ORM and Alembic.
Migrations are stored under migrations/versions
Before reseting, stop the containers with make stop
. To get a completely clean postgres DB, you need to delete the fresh-cart_pgdata
docker volume.
make psql
make tpsql # for test db
make migrate
make tmigrate # for test db
make rollback
make trollback # for test db
Use autogenerated migrations by editing the model first, and then running the below script.
make sh
poetry run alembic revision --autogenerate -m "[description]"
Adjust the generated migration if needed.
make sh
poetry run alembic upgrade --sql head
Follow Conventional Commit messages. This will allow us to automatically generate changelogs and versioning.