Skip to content

Propose installation methods #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/decisions/0001-separate-infra-and-application-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Separate infra template code and application template code into different repositories

* Status: accepted
* Deciders: @rocketnova @lorenyu
* Date: 2022-09-08


## Context and Problem Statement

We want to add support for a Python tech stack to the Platform, but want to avoid duplicating common infrastructure code.

### Additional context

The NJ UI project intends to develop a Python API application, which is the second application (after WIC) that will have a Python application. We expect that Python will be a common choice for future projects, and want to have a way to support it in the Platform. There is already a template-application-nextjs template that contains template infrastructure code as well as template code for the NextJS application. Creating a template-application-flask in the same manner would end up duplicating the infrastructure code.

## Considered Options

* Create `template-application-flask` similar to `template-application-nextjs`
* Separate the infrastructure code from `template-application-nextjs` into a separate repo `template-infra`, and create `template-application-flask` with just the python application code

## Decision Outcome

Decision was to rename the `template-application-nextjs` repo to `template-infra` and create a new repo `template-application-nextjs` with the same git history. This effectively splits up the repo into two parts. The infra part will eventually just contain the infra code, and the other repo will just contain the application code.

We also created `platform` repo to be the landing page for the platform where we can put instructions for how to use all the pieces together.

### See also

* [Slack thread about adding Python stack/API to the platform](https://nava.slack.com/archives/C03G1SWD9H7/p1662570596982139)
* [Follow up Slack thread about naming conventions for separate repos](https://nava.slack.com/archives/C03G1SWD9H7/p1662676260639049?thread_ts=1662665280.211029&cid=C03G1SWD9H7)
77 changes: 77 additions & 0 deletions docs/decisions/0002-installation-method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# How to use template-infra with template applications

* Status: proposed
* Deciders: [list everyone involved in the decision] <!-- optional -->
* Date: [YYYY-MM-DD when the decision was last updated] <!-- optional -->

Technical Story: User can follow instructions on how to use template-infra with either of the template applications [#2](https://github.com/navapbc/platform/issues/2)

## Context and Problem Statement

We previously decided to [separate infra and application templates into separate repos](./0001-separate-infra-and-application-templates.md). We need to decide how a user of the platform can use the infra template with one of the application templates or with their own custom application.

## Considered Options

1. User creates a repo from the template-infra repo, and replaces the `app` folder with one copied from an application template or their own.
2. User copies relevant files from the template-infra repo and from the application template repo.

## Decision Outcome

TBD

## Pros and Cons of the Options

### Create project repo from template-infra repo

Pros

* Fewer things to copy over (github actions, pull request template)

Cons

* Doesn't work with existing repo (e.g. if a user already has an application and wants to add template infra to the repo)
* May still need to have a setup script or instructions to remove/clean up files that aren't needed (e.g. the example application in template-infra is likely not needed)

### Copy files into existing repo

Add something like this to instructions in [template-infra](https://github.com/navapbc/template-infra)

```bash
# fetch latest version of template-infra
git clone --single-branch --branch main --depth 1 [email protected]:navapbc/template-infra.git

# copy docker-compose.yml
cp template-infra/docker-compose.yml .

# copy infra decision records
mkdir -p docs/
cp -r template-infra/docs/decisions/ docs/decisions/

# copy infra code
cp -r template-infra/infra/ infra/

# clean up template-infra folder
rm -fr template-infra
```

Can also simplify the middle lines into a script e.g.

```bash
# fetch latest version of template-infra
git clone --single-branch --branch main --depth 1 [email protected]:navapbc/template-infra.git

# install
./template-infra/scripts/install.sh

# clean up template-infra folder
rm -fr template-infra
```

Pros

* Allows user to install template to existing repo
* In some cases, potentially allows a user to update their project with new versions of the template

Cons

* Requires maintaining installation instructions (or script) for template-infra