Skip to content

Commit

Permalink
Merge branch 'develop' into frepe/barista-hub
Browse files Browse the repository at this point in the history
  • Loading branch information
fredpetersen committed Aug 29, 2023
2 parents b204177 + a493510 commit 4592e9e
Show file tree
Hide file tree
Showing 313 changed files with 6,314 additions and 2,942 deletions.
2 changes: 1 addition & 1 deletion .env.develop
Original file line number Diff line number Diff line change
@@ -1 +1 @@
coffeeCardUrl="https://beta.analogio.dk/api/clippy"
coffeeCardUrl="https://core.dev.analogio.dk"
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1 +1 @@
coffeeCardUrl="https://analogio.dk/clippy"
coffeeCardUrl="https://core.prd.analogio.dk"
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Device (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- App Version [e.g. 1.0.0]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Documentation update
about: Propose a documentation improvement
title: ''
labels: 'documentation'
assignees: ''

---

**Describe the change**
A clear and concise description of what the change is.

**Why is this change necessary?**
Explain why the documentation needs to be updated and how the proposed change improves it.

**Additional context**
Add any other context or screenshots about the proposed change here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/question-discussion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Question/Discussion
about: Ask a question or start a discussion
title: ''
labels: 'discuss'
assignees: ''

---

**Describe the topic**
Briefly describe what you would like to discuss.

**Additional context**
Add any other context or details here.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
value: ${{ jobs.version.outputs.version_tag }}

env:
FLUTTER_VERSION: 3.7.8
FLUTTER_VERSION: 3.10.2
JAVA_VERSION: 11.x

jobs:
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
run: sed -i '' 's/.env.develop/.env.production/' lib/env/env.dart

- name: Generate code
run: flutter pub run build_runner build
run: dart run build_runner build

- name: Build iOS (dev)
if: github.ref_name != 'production'
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
run: sed -i 's/.env.develop/.env.production/' lib/env/env.dart

- name: Generate code
run: flutter pub run build_runner build
run: dart run build_runner build

- name: Build appbundle (dev)
if: github.ref_name != 'production'
Expand Down Expand Up @@ -211,16 +211,16 @@ jobs:
run: flutter pub get

- name: Generate code
run: flutter pub run build_runner build
run: dart run build_runner build

- name: Check formatting
run: flutter format --set-exit-if-changed .
run: dart format --set-exit-if-changed .

- name: Static Analysis
run: flutter analyze

- name: Run Code Metrics
run: flutter pub run dart_code_metrics:metrics --reporter=github lib
run: dart run dart_code_metrics:metrics --reporter=github lib

- name: Run tests
run: flutter test --coverage
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/codesee-arch-diagram.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow was added by CodeSee. Learn more at https://codesee.io/
# This is v2.0 of this workflow file
on:
push:
branches:
- develop
pull_request_target:
types: [opened, synchronize, reopened]

name: CodeSee

permissions: read-all

jobs:
codesee:
runs-on: ubuntu-latest
continue-on-error: true
name: Analyze the repo with CodeSee
steps:
- uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
codesee-url: https://app.codesee.io
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
- .github/workflows/**
- pubspec.lock
- pubspec.yml
- .env.develop
- .env.production

jobs:
build_and_test:
Expand Down
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
"lib/main_development.dart"
]
},
{
"name": "Development flavor (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"program": "lib/main_development.dart",
"args": [
"--flavor",
"development",
"--target",
"lib/main_development.dart"
]
},
{
"name": "Production flavor (debug mode)",
"request": "launch",
Expand Down
64 changes: 46 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,67 @@

We invite everyone to report issues and create pull requests to the repository.

## Issues

Issues are used to track bugs, feature requests and other tasks related to the
project. When creating an issue, please make sure to follow the issue template
and provide as much information as possible.

## Development

### Prerequisites

- [Flutter](https://flutter.dev/docs/get-started/install)
- [Dart](https://dart.dev/get-dart)

Opening this project in VSCode will prompt you to install the recommended
extensions:

- [Dart extension](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code)
- [Flutter extension](https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter)
- [bloc extension](https://marketplace.visualstudio.com/items?itemName=FelixAngelov.bloc)

## Git branch structure

We follow a [Git Flow](https://nvie.com/posts/a-successful-git-branching-model/) inspired setup. The
branch structure is as following :
We follow a [Git Flow](https://nvie.com/posts/a-successful-git-branching-model/)
inspired setup. The branch structure is as following:

- `develop` **(Main branch)** All new branches must check out from `develop` into feature branches,
then merged back to `develop`.
- `production` Reflects the current deployment in production. The `production` branch is merged
with `develop` every time a new version is released to `production`.
- `feature/{author}/{feature-name}` New features are developed on feature branches following the *
feature / author name / feature name branch* structure.
- `develop` **(Main branch)** All new branches must check out from `develop`
into feature branches, then merged back to `develop`. Feature branches can
have any name, but should be named after the feature they implement.
- `production` Reflects the current deployment in production. The `production`
branch is merged with `develop` every time a new version is released to
`production`.

## Merging with the `develop` branch

**A pull request must be created and approved before merging with `develop`!**

We use a **rebase** strategy when merging to `develop`. When a feature has been finished in
development, the feature branch must be rebased with `develop` before creating the pull request in order to avoid
merge commits.
When a feature branch is ready to be merged with `develop`, the following steps
should be taken:

1. Make sure the feature branch is up to date with the `develop` branch. This
can be done by merging the `develop` branch into the feature branch, or by
rebasing the feature branch on top of the `develop` branch.

A rebase from `develop` to the feature branch can be done in command line like this:
A rebase from `develop` to the feature branch can be done in command line like
this:

```bash
git fetch
git checkout feature/author/feature-name # checkout the feature branch
git rebase origin/develop # rebase with remote develop branch
# resolve any conflicts
# add or stage your changes
# checkout the feature branch
git checkout feature/author/feature-name

# rebase with remote develop branch
git rebase origin/develop

# (resolve any conflicts if necessary)

# Then commit and push to the feature branch
git commit -m "New Purchase button for coffee clip cards"
git push
```

Now go to github and create a pull request from the feature branch to the develop branch.
If the pull request closes an issue, make sure to tag this issue in the description for the pull request.
From there, the feature branch can be merged with `develop` using a pull
request. If the pull request closes an issue, the issue should be referenced in
the pull request description using the `Closes #issue-number` syntax.
64 changes: 46 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,57 @@
# Coffee card App [in development]
<p align="center">
<img src="readme_logo.png" alt="Coffee Card App Logo" width="200">
</p>

![Flutter build and test](https://github.com/AnalogIO/coffeecard_app/workflows/Flutter%20build%20and%20test/badge.svg) [![codecov](https://codecov.io/gh/AnalogIO/coffeecard_app/branch/master/graph/badge.svg)](https://codecov.io/gh/AnalogIO/coffeecard_app)
<p align="center">
<a href="https://github.com/AnalogIO/coffeecard_app/actions">
<img alt="Build and test" src="https://github.com/AnalogIO/coffeecard_app/actions/workflows/build.yml/badge.svg">
</a>
<a href="https://codecov.io/gh/AnalogIO/coffeecard_app">
<img alt="codecov" src="https://codecov.io/gh/AnalogIO/coffeecard_app/branch/develop/graph/badge.svg">
</a>
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/badge/license-MIT-purple.svg" alt="License: MIT">
</a>
</p>

**Contact** AnalogIO at *support [at] analogio.dk*
---

We are rewriting our Coffee card app for Cafe Analog to a new cross platform one in Flutter. The app
allows users to buy and use clip cards in Cafe Analog @ IT University of Copenhagen.
<p align="center">
Brew the best coffee experience at <a href="https://cafeanalog.dk">Cafe Analog</a> with our new cross-platform app, designed and coded in Flutter.
Buy and use digital clip cards at our cafe located at the <a href="https://itu.dk">IT University of Copenhagen</a>.
</p>

## SDKs
<p align="center">
<strong>Contact AnalogIO at: </strong><em>support [at] analogio.dk</em>
</p>

We are building the Flutter app with these SDK versions
---

| SDK | Version |
| ------- | ------- |
| Dart | >=2.18.0 <3.0.0 |
| Flutter | 3.7.8 |
## 🛠️ SDKs

## Relevant READMEs
The application is brewed using these SDK versions:

- [Contribution guidelines](CONTRIBUTING.md) `CONTRIBUTING.md`
- [Testing guidelines](test/README.md) `test/README.md`
- [Generated CoffeeCardApi](lib/data/api/README.md) `lib/persistence/api/README.md`
| SDK | Version |
| ------- | -------------- |
| Dart | >=3.0.0 <4.0.0 |
| Flutter | 3.10.2 |

## Getting started
## 📚 Documentation

This project relies on autogenerated files for environment configuration and testing. To generate these files run `make generate`.
For more details, please refer to our documentation:

A **.env.develop** should be present in the root directory before running code generation. This file should contain the URI of the backend API in the format `coffeeCardUrl="https://the-url"`.
- [Contribution Guidelines](CONTRIBUTING.md)
- [Testing Guidelines](test/README.md)
- [Generated CoffeeCard API](lib/data/api/README.md)

## 🔧 Getting Started

This project relies on autogenerated files for environment configuration and testing. Follow the steps below to get started:

1. Ensure a `.env.develop` file is present in the root directory. This file should contain the URI of the backend API in the format `coffeeCardUrl="https://the-url"`.

2. Run the command `make generate` to generate necessary files.

## 📬 Contact

For any queries, feel free to reach us at: <em>support [at] analogio.dk</em>
11 changes: 4 additions & 7 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ linter:
sort_pub_dependencies: false

analyzer:
strong-mode:
implicit-casts: false
exclude:
- lib/generated/**
- test/**.mocks.dart
Expand All @@ -26,25 +24,24 @@ analyzer:
fixme: warning
plugins:
- dart_code_metrics
language:
strict-casts: true

dart_code_metrics:
extends:
- package:dart_code_metrics_presets/all.yaml
metrics:
cyclomatic-complexity: 20
cyclomatic-complexity: 15
number-of-parameters: 6
maximum-nesting-level: 4
rules:
- list-all-equatable-fields: true
- avoid-ignoring-return-values:
exclude:
- test/**

- no-empty-block:
exclude:
- test/**

- list-all-equatable-fields

- arguments-ordering: false
- format-comment: false
- member-ordering: false
Expand Down
Loading

0 comments on commit 4592e9e

Please sign in to comment.