Skip to content

Commit

Permalink
Add setup documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenkleinle committed Dec 23, 2024
1 parent 8ad5f70 commit 119ee3f
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 70 deletions.
80 changes: 31 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,45 @@

## Contents

- [Conventions](#conventions)
- [Environment Variables](#environment-variables)
- [Compiling the App](#compiling-the-app)
- [Setup](#setup)
- [Initial Setup](#initial-setup)
- [Run the App](#run-the-app)
- [Conventions](docs/conventions.md)
- [CI/CD](docs/cicd.md)

## Conventions
## Setup

### Code Style

We follow the [Effective Dart code style](https://dart.dev/effective-dart/style).

Code should be formatted using `dart format` ([docs](https://dart.dev/tools/dart-format)).

### Commits, Branches and Pull Requests

Branch names should be written using kebab-case and have the following schema:
### Initial Setup

1. Install the Android SDK via the [Android plugin](https://www.jetbrains.com/help/idea/create-your-first-android-application.html#754fd) or Android Studio
2. Install [fvm](https://fvm.app/documentation/getting-started/installation) (flutter version manager)
3. Install [fvm](https://fvm.app/documentation/getting-started/installation) (flutter version manager)
4. Install flutter
``` shell
fvm install
```
<issue_key>-your-branch-name
1234-commit-message-documentation
5. Configure local environment
``` shell
cp .env.dev .env
```
6. [Optional] Adjust the environment variables in `.env` as needed
7. [Optional] Open IntelliJ settings and
- Install the Android plugin and set the Android SDK path
- Install the Dart plugin and set the Dart SDK path
- Install the Flutter plugin and set the Flutter SDK path

Commit messages and PR names should have the following schema:
```
<issue_key>: Your commit message
### Run the App

1234: Add commit message documentation
1. Update translations
``` shell
fvm dart run slang
```
2. Run build runner to update API definitions
``` shell
fvm dart run build_runner build
```
3. Run the app (`development`)

See [this guide](https://github.com/erlang/otp/wiki/Writing-good-commit-messages) for a general reference on how to
write good commit messages.

## Environment variables
The application uses the following environment variables:

- `USE_LOGIN`: If set to `true`, the application will use the OIDC login. This variable is only a temporary solution to allow starting the app without IDP with secure connection. It will be removed later.
- `OIDC_CLIENT_ID`: The client ID of the OIDC client.
- `OIDC_ISSUER`: The issuer url of the identity provider.

You can copy the `.env.dev` file to `.env` and fill in the values.
Please note that it's not possible to use the OIDC login if issuer url does not have a secure connection.

### Compiling the app

installing flutter via fvm
`fvm install`

downloading flutter/dart packages
`fvm flutter pub get`

#### Creating translation files

Before building the app, it's needed to generate the translation files

`fvm flutter dart run slang`

#### Generate SwaggerAPI Files
### Connecting to local Grüne API

`fvm dart run build_runner build`
TODO
21 changes: 0 additions & 21 deletions docs/cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,3 @@ fastlane match development

The current certificates and provisioning profiles can be viewed in
[Appstoreconnect](https://developer.apple.com/account/resources/certificates).

## Versioning

Versions consist of a version name and a version code and are set in [version.yaml](../version.yaml).
Versions are automatically bumped and committed using the corresponding scripts in [tools](../tools) in the
delivery [workflows](#workflows) in the CI.

### Version Name

We use the [calver schema](https://calver.org) `YYYY.MM.PATCH` for versioning.
`PATCH` is a counter for the number of releases in the corresponding month starting with 0.

Examples:

- First versions of 2024: `2024.1.0`, `2024.1.1`, `2024.1.2`.
- First version of February 2024: `2024.2.0`.

### Version Code

An additional consecutive version code is used for unique identification in the app stores.
The version code has to be incremented for every new release uploaded to the stores.
54 changes: 54 additions & 0 deletions docs/conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Conventions

## Contents

- [Code Style](#code-style)
- [Commits, Branches and Pull Requests](#commits-branches-and-pull-requests)
- [Versioning](#versioning)

## Code Style

We follow the [Effective Dart code style](https://dart.dev/effective-dart/style).

Code should be formatted using `dart format` ([docs](https://dart.dev/tools/dart-format)).

## Commits, Branches and Pull Requests

Branch names should be written using kebab-case and have the following schema:

```
<issue_key>-your-branch-name
1234-commit-message-documentation
```

Commit messages and PR names should have the following schema:
```
<issue_key>: Your commit message
1234: Add commit message documentation
```

See [this guide](https://github.com/erlang/otp/wiki/Writing-good-commit-messages) for a general reference on how to
write good commit messages.

## Versioning

Versions consist of a version name and a version code and are set in [version.yaml](../version.yaml).
Versions are automatically bumped and committed using the corresponding scripts in [tools](../tools) in the
delivery [workflows](#workflows) in the CI.

### Version Name

We use the [calver schema](https://calver.org) `YYYY.MM.PATCH` for versioning.
`PATCH` is a counter for the number of releases in the corresponding month starting with 0.

Examples:

- First versions of 2024: `2024.1.0`, `2024.1.1`, `2024.1.2`.
- First version of February 2024: `2024.2.0`.

### Version Code

An additional consecutive version code is used for unique identification in the app stores.
The version code has to be incremented for every new release uploaded to the stores.

0 comments on commit 119ee3f

Please sign in to comment.