Skip to content

Commit 48063d9

Browse files
authored
Add Code of Conduct and Contribution Guide; Update Documentation (#219)
* add code of conduct based on official GitHub template * add contribution guide * fix: update old mermaid diagram * docs: update and expand wiki pages for authentication, backend, architecture, environment variables, and various features * docs: update German translation status to specify formal usage
1 parent b5f155a commit 48063d9

17 files changed

Lines changed: 395 additions & 101 deletions

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at dev@asta-bochum.de. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTION.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<h2 align="center">Thanks for deciding to contribute to Campus App 🎉💡</h2>
2+
3+
### How to contribute?
4+
5+
If you'd like to contribute, start by searching through the issues and pull requests to see whether someone else has raised a similar idea or question.
6+
7+
If you don't see your idea listed, and you think it fits into the goals of this project, do one of the following:
8+
9+
- If your contribution is minor, such as a typo fix, open a pull request.
10+
- If your contribution is major, such as a new guide, start by opening an issue first. That way, other people can weigh in on the discussion before you do any work.
11+
12+
<img src="https://user-images.githubusercontent.com/56138477/213162795-f00d1f4c-3978-4017-a974-b65b40e70908.png" height="14" width="14" > [Discord server](https://discord.gg/zv8CCHRTjn)
13+
14+
#### Steps to Contribute!
15+
16+
Pull requests are the best way to propose changes to the codebase (we use Github Flow). We actively welcome your pull requests:
17+
18+
- Fork the repo and create your branch from master.
19+
- Write clear meaningful git commit messages.
20+
- Make sure your code lints.
21+
- Issue that pull request!
22+
23+
### Can you take an internship?
24+
25+
**Yes!** As a computer science student, you can have an internship with the Campus App counted as a software project. Even if you are studying something else, you can contact us at any time at dev@asta-bochum.de.
26+
27+
### Roadmap
28+
29+
Current information on milestones and recent developments can be found in [this GitHub project](https://github.com/orgs/astarub/projects/16). Please keep in mind that we sometimes need a little more time to include bugs or features in the roadmap.

docs/wiki/Authentication.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
> If we plan to implement the authentication, we will write this wiki page.
1+
# Authentication
2+
3+
This page provides a short overview of authentication flows currently used in the app.
4+
5+
---
6+
7+
## Semesterticket Login
8+
9+
The semesterticket flow uses the user provided RUB credentials (`loginId`, `password`).
10+
11+
- Credentials are read from secure storage.
12+
- A headless webview performs the login flow.
13+
- Ticket information (Aztec code and metadata) is extracted and stored securely.
14+
15+
Main implementation:
16+
17+
- `lib/pages/wallet/ticket/ticket_datasource.dart`
18+
- `lib/pages/wallet/ticket/ticket_repository.dart`

docs/wiki/Backend.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All commands are for Linux only. If you wish to use another OS, you will have to
44

55
# Basic Concept
66

7-
The backend of the Campus App serves as the main management unit for all processes the involve push notifications and data storage.
7+
The backend of the Campus App serves as the main management unit for all processes that involve push notifications and data storage.
88
As of right now, [Appwrite](https://appwrite.io/) is used as our backend software.
99

1010
Upon startup of the app a new user account or session, depending on whether an account already exists, is created.
@@ -25,7 +25,7 @@ The following features are currently backed by our backend:
2525
System requirements:
2626
- 1 CPU Core and 2GB of RAM
2727
- Docker
28-
- Docker Dompose Version 2
28+
- Docker Compose Version 2
2929

3030
Follow the installation guide as instructed here: https://appwrite.io/docs/installation
3131

docs/wiki/Basic_Architecture.md

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ design patterns and principles.
55

66
## Folder Structure
77

8-
All the source code is located inside the `lib` folder and the corresponding unit
9-
tests inside the `test` folder. The first level inside these folders is always a
10-
main feature of the app like the Moodle, Flexnow or eCampus integration. Each
11-
of these features is structured via a [layerized architecture](https://medium.com/kayvan-kaseb/the-layered-architecture-pattern-in-software-architecture-324922d381ad).
8+
All source code is located inside the `lib` folder and unit tests inside the `test` folder.
9+
Feature modules are mainly organized below `lib/pages` and follow the project layering
10+
approach where applicable.
1211

13-
The source code inside the `lib` folder is separated in three parts `core`, `pages`
14-
and `utils`. The `core` folder contain all features (like authentication) and basic
15-
functionalities which are used in multiple pages. The `pages` folder contain all
16-
independent features and inside `utils` you can find all helper functions and classes
17-
like APIs. The `test` folder is structured the same way.
12+
The source code inside `lib` is mainly separated into `core`, `pages`, `utils`, `env`
13+
and `l10n`. The `core` folder contains shared app services and infrastructure
14+
(e.g. backend repository, settings and dependency injection). The `pages` folder
15+
contains feature modules. Inside `utils` you can find shared helper classes.
16+
Current tests are mainly located in `test/pages`.
1817

1918
As a tree-structure our project looks at follows:
2019

@@ -32,15 +31,22 @@ As a tree-structure our project looks at follows:
3231
│ ├── core
3332
│ │ ├── feature-xyz
3433
│ │ ├── themes
34+
│ │ ├── settings
35+
│ │ ├── ...
36+
│ ├── env
37+
│ │ ├── env.dart
38+
│ │ ├── env.g.dart
39+
│ ├── l10n
3540
│ │ ├── ...
3641
│ ├── pages
3742
│ │ ├── feature-xyz
3843
│ │ ├── ...
3944
│ ├── utils
40-
│ │ ├── apis
4145
│ │ ├── pages
46+
│ │ ├── widgets
4247
│ │ ├── ...
43-
| ...
48+
│ ├── main.dart
49+
│ ├── firebase_options.dart
4450
├── test
4551
│ ├── core
4652
│ │ ├── ...
@@ -83,22 +89,22 @@ about this architecture. For future reading you can read the [explaination by Mi
8389
Let's start with a visualization of this architecture:
8490

8591
```mermaid
86-
graph BT;
87-
subgraph <h3>Infrastructure Layer
88-
api{API} -->|Raw Data| rds(Remote Datasource)
89-
db{DB} -->|Raw Data| lds(Local Datasource)
92+
flowchart BT
93+
subgraph infra[Infrastructure Layer]
94+
api{API} -->|Raw Data| rds[Remote Datasource]
95+
db{DB} -->|Raw Data| lds[Local Datasource]
9096
end
91-
subgraph <h3>Domain Layer
92-
rds -->|Model| repo
93-
lds -->|Model| repo
94-
repo(Repository) -->|Entity| uc(Use Cases)
97+
subgraph domain[Domain Layer]
98+
rds -->|Model| repo[Repository]
99+
lds -->|Model| repo
100+
repo -->|Entity| uc[Use Cases]
95101
end
96-
subgraph <h3>Application Layer
97-
uc --> appl(Presentation <br> Logic Holder)
98-
repo -.->|Entity| appl
102+
subgraph app[Application Layer]
103+
uc --> appl[Presentation Logic Holder]
104+
repo -.->|Entity| appl
99105
end
100-
subgraph <h3>Presentation Layer
101-
appl --> wid(Widgets)
106+
subgraph presentation[Presentation Layer]
107+
appl --> wid[Widgets]
102108
end
103109
```
104110

@@ -120,9 +126,9 @@ interactions.
120126
The Application Layer handles the state of our App. All user requests coming from the
121127
UI are validated and handled at this point. So validation also into this layer. It could be argued that Validation goes into the domain, but the risk there is that errors raised may reference fields not present in the View Model which would cause confusion.
122128

123-
In Flutter their a Stateful-Widgets which can handle the State by them self and
124-
global states can be handled by Change Notifiers. So their aren't different files
125-
for the Presentation and Application Layer. [¹]
129+
In Flutter there are StatefulWidgets which can handle state by themselves and
130+
global state can be handled by ChangeNotifiers. Therefore there are not always separate
131+
files for Presentation and Application Layer. [¹]
126132

127133
### Domain Layer
128134

docs/wiki/Environment_Variables.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
# Environment Variables
22

3-
In order to test the backend service you will have to set your own API key, for your very own server, in order to use the ``create_user`` function.
4-
5-
To do that you will have to:
6-
- Create an .env file in the root directory
7-
- Set the value of ``APPWRITE_CREATE_USER_AUTH_KEY`` to your function's api key
8-
- Rebuild the ``env.g.dart`` file in the ``/env/`` folder, using the ``flutter pub run build_runner build`` command
9-
- Re-add all other previous keys e.g. the mensa api key and the firebase key, but make sure to replace the value of ``APPWRITE_CREATE_USER_AUTH_KEY`` with the newly generated output
10-
- Start debugging
3+
The app uses `envied` and reads secrets from a `.env` file in the project root.
4+
5+
---
6+
7+
## Required keys
8+
9+
The following keys are currently used by `lib/env/env.dart`:
10+
11+
- `MENSA_API_KEY`
12+
- `FIREBASE_ANDROID_API_KEY`
13+
- `FIREBASE_IOS_API_KEY`
14+
- `APPWRITE_CREATE_USER_AUTH_KEY`
15+
- `SENTRY_DSN`
16+
17+
---
18+
19+
## Setup
20+
21+
1. Create a `.env` file in the project root.
22+
2. Add all required keys to the file.
23+
3. Generate `lib/env/env.g.dart` with:
24+
25+
`flutter pub run build_runner build --delete-conflicting-outputs`
26+
27+
4. Start the app.

docs/wiki/Getting_Started.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This pages will explain how to setup your development environment and first steps to start contributing to our project.
1+
This page explains how to set up your development environment and the first steps to start contributing to our project.
22

33
---
44

@@ -10,11 +10,10 @@ First you need to install Flutter. The [official flutter documentation](https://
1010

1111
## Setup an editor and emulator
1212

13-
To write code you need an editor or IDE (obvously :D ). Wer would recommend to follow
14-
the official steps for VS Code by the [official flutter documentation](https://docs.flutter.dev/get-started/editor?tab=vscode).
13+
To write code you need an editor or IDE. We recommend to follow the official VS Code setup from the [Flutter documentation](https://docs.flutter.dev/get-started/editor?tab=vscode).
1514

16-
In addition of the VS Code setup you need a running phone emulator. The best case, for non-MAC-users, is to install Android Studio Code and the included Virtual Device Manager.
17-
The [android developer documentation](https://developer.android.com/studio/run/managing-avds) provide a useful tutorial about AVD creation and management. We would recommend to create a phone with the newest Android API Level or at least API level 30 (Android 11.0). Google Play support is optional.
15+
In addition to the editor setup you need a running phone emulator. For non-macOS users, Android Studio with the Virtual Device Manager is a good choice.
16+
The [Android developer documentation](https://developer.android.com/studio/run/managing-avds) provides a tutorial about AVD creation and management. We recommend using the newest Android API level (or at least API level 30). Google Play support is optional.
1817

1918
---
2019

@@ -24,18 +23,20 @@ If you work the first time with git, check out this [cheat sheet](https://traini
2423

2524
You can easily clone the repository with the command `git clone https://github.com/astarub/campus_app`. Git will create a new folder for you inside your current directory.
2625

27-
Now you can open VS Code with the command `code ./campus_app` and start development.
26+
Now you can open VS Code with `code ./campus_app` and start development.
2827

2928
---
3029

3130
## Start development
3231

33-
After opening VS Code you should open a terminal and update all flutter dependencies. For this, run the following command: `flutter pub get`.
32+
After opening VS Code, open a terminal and download dependencies with `flutter pub get`.
3433

35-
Meanwhile you can start your emulator created privously. For that you can run: `flutter emulator --launch <emulator_name>`.
34+
Meanwhile you can start your emulator with `flutter emulator --launch <emulator_name>`.
3635

37-
In the end execute `flutter run` to start the app. Now, evertime you updated the source you can use the key `r` or `R` to update the running app.
38-
You can quite quit `q`.
36+
Then execute `flutter run` to start the app. After source changes you can press `r` or `R` for hot reload/restart.
37+
Press `q` to quit.
38+
39+
If you work with custom backend credentials, also set up the `.env` file as described in `Environment_Variables.md`.
3940

4041
Happy coding. :)
4142

0 commit comments

Comments
 (0)