Repositories and Structure

Project Structure

Core Repos

Auxiliary repos

Auth management

Issue trackers

Sentry

 

UKRDC-FastAPI

Pydantic and Type Hints

  • Our data goes through 2 “conversions”:

    • SQLAlchemy ORM turns database rows into Python objects

    • Pydantic (via FastAPI response_model) turns Python objects into JSON

UKRDC-Nuxt

TypeScript

  • Initially it often just looks like a source of frustration, but it does a tonne of good for catching errors early on

  • Interfaces are roughly equivalent to Pydantic models. They give the expected fields and types for objects (JS dictionaries)

Tailwind

  • One of the most divisive web dev libraries I’ve ever come across

  • I’ve found it excellent for rapidly developing new components

  • We abstract a lot of styling away at the component level

    • E.g. we have a “TextH1” component which acts a lot like html “h1” but with extra styling

    • This means we can easily bulk-change styles across the whole application without a web of CSS files

Docker-Compose

  • We use Docker images to deploy the applications

    • I’m assuming everyone is familiar with Docker but if not let me know and I’ll run through why we use it

  • Docker images can have tags, so we use these to separate environments (dev, staging, production etc)

  • Our Docker-Compose file pulls and configures all images required to run the whole stack

  • Runtime configuration is handled by .env files or environment variables

Devops Flow

Branches

  • main

    • Current "snapshot" branch

    • Code here should be as stable as possible

    • Code should not be committed directly

    • Base for feature/fix branches

  • Feature branches

    • When working on a specific feature/fix, create a new branch for that work item 

    • Either submit a PR when ready, or create a draft PR whenever

    • PRs should pass all tests and code-quality checks before merging

    • PRs should be reviewed by someone else on the project before merging

GitHub Actions

How to deploy a new release

Build and publish Docker images

This guide is broadly applicable to both "ukrdc-fastapi" and "ukrdc-nuxt"

Update containers on the app server

Reverting/redeploying an old version

  • Modify your docker-compose file, and instead of pointing to the image tag 'latest', point to a specific version tag.

Active Instances

ukrdc-app-live - Systems Infrastructure - Confluence (atlassian.net)

ukrdc-app-staging_7 - Systems Infrastructure - Confluence (atlassian.net)