mstephenhunt / holiday_acres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UI

Installing Packages

~/holiday_acres$ nvm use
~/holiday_acres$ cd ui
~/holiday_acres/ui$ yarn

Starting NextJS App

~/holiday_acres/ui$ yarn dev

API

Package Management Setup

Poetry Python Package Management

Python Poetry is used for package management. That link will bring you to the instructions page for installing for Windows or Unix.

Depending on your system's python --version you may need to update in order to install the correct version of poetry. It's best if you're in python 3.9

On Mac install, if you get the error:

[SSL: CERTIFICATE_VERIFY_FAILED]

You may need to create a symlink from the OS certs to python.

Yarn JS Package Installation

yarn is used to manage JS packages used for linting and pre-commit hooks. This can usually be installed directly via npm:

npm install --global yarn

After installing yarn, simply run:

$ yarn

to install the required JS packages.

Django Setup

Environment Variables

Copy the existing .env.example to .env

~/api$ cp .env.example .env

Initial DB migration

Currently only setup to use SQLite. Run poetry run manage.py migrate to put in base tables.

Prisma DB migration (in /haec-user-service)

yarn prisma migrate dev

Create dummy initial admin account

poetry run manage.py createsuperuser --email admin@example.com --username admin

Using password "testing".

Seeding DB

After running the initial migration, run

~/holiday_acres/api$ poetry run python manage.py loaddata holiday_acres_api/seeds/0001_initial_seed.json

To seed the DB with initial data.

Running Tests

Tests are located in ~/api/holday_acres_api/tests. To run them, you have to be in the ~/api folder and then invoke command poetry run pytest.

Making App Externally Accessable

  1. Install ngrok and create an account
  2. Head over to the ngrok token page and follow the instructions to set your ngrok token.
  3. Install Docker
  4. Start up Docker images with docker-compose up
  5. Run ngrok with ngrok http 8080

About


Languages

Language:Python 53.3%Language:TypeScript 44.3%Language:JavaScript 0.9%Language:Dockerfile 0.6%Language:Mako 0.5%Language:Shell 0.4%