Skip to content

01. Gettings Started

kevin-hashimoto edited this page Mar 4, 2024 · 1 revision

Welcome to the lcfs wiki!

Prerequisites

  • Docker and Docker Compose
  • Node.js and npm (for frontend)
  • Python 3.8+ and Poetry (for backend)

Frontend setup

installing packages and husky

cd frontend
npm install

Backend setup

To install pre-commit simply run inside the shell:

pre-commit install

pre-commit is very useful to check your code before publishing it. It's configured using .pre-commit-config.yaml file.

By default it runs:

black (formats your code); mypy (validates types); isort (sorts imports in all files); flake8 (spots possibe bugs); You can read more about pre-commit here: https://pre-commit.com/

Running the application

  1. clone this repo git clone https://github.com/bcgov/lcfs.git
  2. run docker from the project root docker-compose up --build

You will be able to access the frontend at http://localhost:3000 and the backend api documentation (swagger) at http://localhost:3000/docs

Docker runs the frontend, backend and database all together but you can run these separately as well.

To run the frontend separately:

# move to the frontend directory 
cd frontend
# install dependencies 
npm install
# run the frontend
npm run dev

To run the backend separately:

# move to the backend directory
cd backend
# install dependencies - requires poetry to be install
poetry install
# run the backend
poetry run python -m lcfs