Skip to content

Commit

Permalink
docs: Update README.md (#716)
Browse files Browse the repository at this point in the history
Closes #533
  • Loading branch information
dansvend authored Apr 25, 2024
1 parent 6655aaa commit dcbc84f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 88 deletions.
124 changes: 38 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,62 @@

# Links

- :inbox_tray: [Bug and feature tracker](https://github.com/orgs/equinor/projects/87/views/8)
- :inbox_tray: [Bug and feature tracker](https://github.com/orgs/equinor/projects/361/views/34)
- :1234: [Feature backlog (and prioritisation)](https://github.com/orgs/equinor/projects/141/)
- :art: [Figma design & prototype](https://www.figma.com/file/IkHwmIQrsT0iR34f5R5UnZ/vsm)
- :zap: [Api-endpoints: See swagger](https://vsm-api-dev.azurewebsites.net/swagger/index.html)
- :dizzy: [Our development process: Mapped in Flyt itself](https://flyt.equinor.com/projects/172)
- 🏃 [Running in Radix](https://console.radix.equinor.com/applications/vsm/)
- :art: [Figma design & prototype](https://www.figma.com/file/SacZjN10goX2lahJrmjWC0/Flyt--%3E-Ideation?type=design&node-id=0%3A1&mode=design&t=qZPDP2RQYWZdO8Fh-1)
- :zap: [API endpoints](https://api-flyt-api-dev.radix.equinor.com/swagger/index.html?urls.primaryName=Flyt%20Api%20V2)
- :dizzy: [Development process](https://flyt.equinor.com/process/172)
- 🏃 [Running in Radix](https://console.radix.equinor.com/applications/flyt/)
- :memo: [Architecture contract](https://github.com/equinor/architecturecontract/blob/master/contracts/flyt.md)

# Background

Mission statement: Empower everyone on all levels to improve the way we work - process by process

# Tech stack / Features

| | Comment |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Library | This is a [React](https://reactjs.org/) project |
| Package manager | We use the [Yarn](https://yarnpkg.com/) -package-manager. To get started, run `yarn && yarn start` |
| Navigation | [NextJS](https://nextjs.org/) |
| State management | [EasyPeasy](https://easy-peasy.now.sh/) persisted global store |
| Canvas tools | We heavily rely on canvas and use [PixiJS](https://www.pixijs.com/) to ease development. |
| Testing | TODO: [Testing-Library](https://testing-library.com/) |
| Code-Style | We use [ESLint](https://eslint.org/) together with [Prettier](https://prettier.io/) for linting and enforcing a consistent code-style. |
| Authentication | [@azure/msal-react](https://github.com/AzureAD/microsoft-authentication-library-for-js#readme) |
| Styling | [Sass](https://sass-lang.com/) |
| Templates | |
# Tech stack

| | Comment |
| ---------------- | ---------------------------------------------------------------------------------------------- |
| Language | [TypeScript](https://www.typescriptlang.org/) |
| Library | [React](https://react.dev/) |
| Framework | [Next.js](https://nextjs.org/) |
| Process renderer | [React Flow](https://reactflow.dev/) |
| State management | [EasyPeasy](https://easy-peasy.vercel.app/) |
| Linting | [ESLint](https://eslint.org/) |
| Code-Style | [Prettier](https://prettier.io/) |
| Authentication | [@azure/msal-react](https://github.com/AzureAD/microsoft-authentication-library-for-js#readme) |
| Styling | [Sass](https://sass-lang.com/) |
| Package manager | [Yarn](https://yarnpkg.com/) |

# Developing

To get up and running:
`yarn && yarn use-dev`
To get up and running, run:

```bash
yarn && yarn use-dev
```

## Running different environments locally

| Env. | command |
| ---- | :-------------: |
| Dev | `yarn use-dev` |
| Test | `yarn use-test` |
| DEV | `yarn use-dev` |
| TEST | `yarn use-test` |
| QA | `yarn use-qa` |
| PROD | `yarn use-prod` |

### What it does

For example: running `yarn use-dev` replaces the root `.env` file with `environment-variables/DEV.env`, then it
runs `yarn dev`.

## Branching and deploying stuff

We use a simple branching structure. Instead of having a `master` and `develop` branch we just use one `main`-branch.

The `main`-branch contains the latest changes.

We use a "sliding tag" for each environment... Tag something DEV, TEST, QA or PROD, and it should trigger a new build
and release. This gets rid of the "empty Pull requests" for releases, which is something we would have if we do a PR
into `Master` from `Develop`. Also, this gives us more flexibility to release from another branch if we need to do that
for some reason.

I've added a simple script to automate this:
For example; Run `yarn release-dev` to tag DEV and push tags to GitHub.

> **NOTE:** This script need to be updated to accomadate for multiple people updating the tags. Until then, try to update the tag and push it manually. [Read more about git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
To release you you run one of the following scripts:

| Environment | Release script | Deploy status | URL | Who should test what? | Comments |
| ----------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------- | --------------------------- | -------------------------------------------------------------------------------- |
| DEV | Run `yarn release-dev` | ![DEV environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/vsm/environments/dev/buildstatus) | https://web-vsm-dev.radix.equinor.com/ | Developer | Developer is free to use this environment however they want to |
| TEST | Run `yarn release-test` | ![TEST environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/vsm/environments/test/buildstatus) | https://web-vsm-test.radix.equinor.com/ | Internal testing | Developer tags what needs to be tested for QA-tester in the team |
| QA | Run `yarn release-qa` | ![QA environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/vsm/environments/qa/buildstatus) | https://web-vsm-qa.radix.equinor.com/ | "Product Owner" or Customer | When said feature is ready, it gets released into QA so our PO can give feedback |
| PROD | Run `yarn release-prod` | ![PROD environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/vsm/environments/prod/buildstatus) | https://web-vsm-prod.radix.equinor.com/ | End-users | We wait with deploying to prod until everyone is happy |

> **Note:** When running `yarn release-<environment>` we are starting a new build in Radix. If we already have a working build and want to release it to another environment, we may "promote" it to a different environment via the [Radix-console](https://console.radix.equinor.com/applications/vsm).
| Environment | Release script | Deploy status | URL | Who should test what? | Comments |
| ----------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | --------------------------- | -------------------------------------------------------------------------------- |
| DEV | `yarn release-dev` | ![DEV environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/flyt/environments/dev/buildstatus) | [dev.flyt.equinor.com](https://dev.flyt.equinor.com) | Developer | Developer is free to use this environment however they want to |
| TEST | `yarn release-test` | ![TEST environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/flyt/environments/test/buildstatus) | [test.flyt.equinor.com](https://test.flyt.equinor.com) | Internal testing | Developer tags what needs to be tested for QA-tester in the team |
| QA | `yarn release-qa` | ![QA environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/flyt/environments/qa/buildstatus) | [qa.flyt.equinor.com](https://qa.flyt.equinor.com) | "Product Owner" or Customer | When said feature is ready, it gets released into QA so our PO can give feedback |
| PROD | `yarn release-prod` | ![PROD environment build status in Radix](https://api.radix.equinor.com/api/v1/applications/flyt/environments/prod/buildstatus) | [flyt.equinor.com](https://flyt.equinor.com) | End-users | We wait with deploying to prod until everyone is happy |

## Docker

Expand All @@ -94,7 +80,7 @@ docker run -p 3000:3000 --env-file ./environment-variables/PROD.env equinor-flyt

## Runtime environment variables

When using NEXT.JS, the environment variables need to be set when building the image and not at runtime.
When using Next.js, the environment variables need to be set when building the image and not at runtime.

> Generally you'll want to use build-time environment variables to provide your configuration. The reason for this is that runtime configuration adds rendering / initialization overhead and is incompatible with Automatic Static Optimization.
>
Expand All @@ -113,43 +99,9 @@ MyApp.getInitialProps = async (appContext: AppContext) => {
Which disables "automatic static optimization" for all our
pages. [Read more ...](https://github.com/vercel/next.js/blob/master/errors/opt-out-auto-static-optimization.md)

# Pixi js Canvas

## Making space for stuff

Put every Main activity and all it's children inside a container. That container width can be used to figure out
the distance to the next Main Activity etc...

# Defining a process

A vsm/flyt/process consists of a set of entities.

An entity can be of the following types:

- MainActivity
- SubActivity
- Choice
- Waiting

Structure of an entity

```json5
{
id: "",
type: "MainActivity",
text: "",
roles: [],
duration: 0,
problems: [],
ideas: [],
solutions: [],
parentId: "",
}
```

# Semantic Commit Messages

> Copied from https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716
> Copied from <https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716>
See how a minor change to your commit message style can make you a better programmer.

Expand Down Expand Up @@ -180,6 +132,6 @@ More Examples:

References:

- https://www.conventionalcommits.org/
- https://seesparkbox.com/foundry/semantic_commit_messages
- http://karma-runner.github.io/1.0/dev/git-commit-msg.html
- <https://www.conventionalcommits.org/>
- <https://seesparkbox.com/foundry/semantic_commit_messages>
- <http://karma-runner.github.io/1.0/dev/git-commit-msg.html>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"release-test": "yarn fetch-tags && git tag -f TEST && yarn push-tags",
"release-qa": "yarn fetch-tags && git tag -f QA && yarn push-tags",
"release-prod": "yarn fetch-tags && git tag -f PROD && yarn push-tags",
"push-tags": "git push origin --tags -f && echo Check status: https://console.radix.equinor.com/applications/vsm/jobs",
"push-tags": "git push origin --tags -f && echo Check status: https://console.radix.equinor.com/applications/flyt/jobs",
"use-dev": "cp environment-variables/DEV.env .env && yarn dev",
"use-test": "cp environment-variables/TEST.env .env && yarn dev",
"use-qa": "cp environment-variables/QA.env .env && yarn dev",
Expand Down Expand Up @@ -102,4 +102,4 @@
"path": "./node_modules/cz-conventional-changelog"
}
}
}
}

0 comments on commit dcbc84f

Please sign in to comment.