Skip to content

lcacollect/assembly-backend

Repository files navigation

LCA Assembly Service

Introduction

This repo is a git submodule. Thus changes made here will be reflected in external sources, which requires a certain workflow to ensure consistency for all developers who depend on this repo. Besides that it functions as any other repo.

Getting Started

To get started please make sure that the following pieces of software are installed on your machine.

Software dependencies

Windows

Linux

Getting the backend up and running

Setup local .env Copy the contents of .env.example to a local .env file. To get the ARTIFACTS_TOKEN_BACKEND_PACKAGES token for fetching python packages from Azure Artifacts. You can do it by creating a PAT that have read access to artifacts.

Install dependencies

# Set environment variables on linux
export ARTIFACTS_TOKEN_BACKEND_PACKAGES=<YOUR_PAT>

# Set environment variables on Windows
$env:ARTIFACTS_TOKEN_BACKEND_PACKAGES=<YOUR_PAT>
# Install packages
pipenv install --dev

# Install pre-commit hooks
pre-commit install

See more about Windows Env vars here Start dev server

# Start Minikube to run a local Kubernetes cluster
minikube start
# Run Skaffold
skaffold dev

Run tests locally

pytest tests/

Make migration Skaffold should be running!

./local_migration.sh

Export GraphQL schema

./export_schema.sh

Load EPD data into database

kubectl -n assembly exec -it $(kubectl -n assembly get pod -l app=backend -o name) -- python src/import_data/main.py

Folder Structure

alembic/  # Contains migrations
graphql/  # Contains graphql schema for the gateway
helm/  # helm chart for deployment
src/  # source code
    core/  # code related to FastAPI/webserver
    exceptions/  # custom exceptions
    models/  # database models
    routes/  # api routes
    schema/  # graphql schema definitions
tests/  # test code

Documentation

License

Unless otherwise described, the code in this repository is licensed under the Apache-2.0 License. Please note that some modules, extensions or code herein might be otherwise licensed. This is indicated either in the root of the containing folder under a different license file, or in the respective file's header. If you have any questions, don't hesitate to get in touch with us via email.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages