Skip to content

Commit 812a3b9

Browse files
committed
init
0 parents  commit 812a3b9

File tree

6 files changed

+437
-0
lines changed

6 files changed

+437
-0
lines changed

.github/workflows/gradle.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
9+
#### Uncoment this once you setup spring boot, it will run automatic tests and code style checks
10+
# name: Java CI with Gradle
11+
12+
# on:
13+
# [push, pull_request]
14+
15+
# permissions:
16+
# contents: read
17+
18+
# jobs:
19+
# build:
20+
21+
# runs-on: ubuntu-latest
22+
23+
# steps:
24+
# - uses: actions/checkout@v3
25+
# - name: Set up JDK 17
26+
# uses: actions/setup-java@v3
27+
# with:
28+
# java-version: '17'
29+
# distribution: 'temurin'
30+
# - name: Build with Gradle
31+
# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
32+
# with:
33+
# arguments: build

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
HELP.md
2+
.gradle
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
7+
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
bin/
17+
!**/src/main/**/bin/
18+
!**/src/test/**/bin/
19+
20+
### IntelliJ IDEA ###
21+
.idea
22+
*.iws
23+
*.iml
24+
*.ipr
25+
out/
26+
!**/src/main/**/out/
27+
!**/src/test/**/out/
28+
29+
### NetBeans ###
30+
/nbproject/private/
31+
/nbbuild/
32+
/dist/
33+
/nbdist/
34+
/.nb-gradle/
35+
36+
### VS Code ###
37+
.vscode/

CONTRIBUTING.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing to the project
2+
3+
## Restricted branches
4+
- `development` - all the implemented features which are done and deployed
5+
- `master` - stable version deployed
6+
7+
## Workflow
8+
9+
1. Create a feature branch when you start to work on a story and commit your changes to this
10+
- the branch should be named `<id of the ticket>: <subject>`, for example `TB-3: Add login endpoint`
11+
- the commits should also be named `<id of the ticket>: <subject>`, for example `TB-3: added unit tests`
12+
2. Push this frequently to the remote repository from your local
13+
2. When the feature is done, create a Pull Request from the `feature_branch` to `development`, follow the guidelines
14+
3. When the PR is approved, merge it, and delete your feature branch
15+
16+
## Git Commit Guidelines
17+
18+
Read this article how to write meaningful commit messages:
19+
[How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/)
20+
21+
We follow the rules below:
22+
- **Commit message format**: `TB-{id}: <subject>`
23+
- **id**: Id of the ticket you are working on (in jira)
24+
- **Subject**: Changes in the commit
25+
26+
## Pull Request guidelines
27+
28+
- From `feature_branch` to `development`: add two developers and PM as reviewers, 3 approves needed for merging
29+
- From `development` to `master`: this is managed by the PM

README.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Development rules:
2+
3+
- Use `Lombok`
4+
- Only Use Data Transfer Objects (Dto's) for request/response data (e.g. create a `dtos` package (do not put this package into the `models` package).
5+
- Make *everything* configurable (e.g. via values in `.env` and `application.properties`), i.e. no constant value should be hard-coded. The database credentials are already pre-configured this way.
6+
- Unit tests should be a part of pull requests
7+
- Use the object wrapper for primitive types, e.g. `Long` instead of `long`
8+
- Naming
9+
- Entities/Models
10+
- Use camelCase for Java properties and snake_case for the corresponding database column names. For example `private String activationToken` in the User model should be mapped to the `activation_token` column in the `users` table
11+
- Database:
12+
- Use plurals for database tables, e.g. `users`, `posts`, `likes` (and singular for the corresponding models names, i.e. `User`, `Post`, `Like`)
13+
- Use `@GeneratedValue(strategy = GenerationType.IDENTITY)` for auto-incremented fields
14+
- Tests: use descriptive (test) method names (to improve readability):
15+
- : `canCreateModel()`
16+
- : `isEmptyIsFalseForReceiptWithItems()`
17+
- : `canAddPermissionsToUsers()`
18+
- Endpoints: always start with `/api/v1/`
19+
- Endpoints: use all lowercase letters and '-' for spaces
20+
- : `/api/v1/user/vouchers`
21+
- : `/api/v1/forgot-password`
22+
- Create descriptive branch names, e.g. feature-user-registration
23+
- Use `this` keyword only to avoid variable name conflicts
24+
- Use the [code formatting](https://blog.jetbrains.com/idea/2020/06/code-formatting/) feature in Intellij (CTRL+ALT+L / ⌥⌘L)
25+
- Have at least 90% test coverage regarding services (unit test) and controllers (integration tests)
26+
- Use [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)
27+
- Have a look [here](https://stackoverflow.com/questions/42979700/how-to-configure-google-java-code-formatter-in-intellij-idea-17) on how to configure the google java style guides in IntelliJ
28+
- Make sure to use braces {} with `if`, `else`, `for`, `do` and `while` statements, even when the body is empty or contains only a single statement.
29+
30+
31+
## Processes:
32+
- Push only when *all* tests and style checks have passed
33+
- Make sure there are no unresolved conflicts esp. in other than .java files
34+
- see [CONTRIBUTING](CONTRIBUTING.md)
35+
36+
## Useful links
37+
38+
Contributing:
39+
40+
- see [CONTRIBUTING](CONTRIBUTING.md)
41+
42+
Commit messages:
43+
44+
- https://chris.beams.io/posts/git-commit/
45+
46+
Git cheat sheet
47+
48+
https://docs.google.com/spreadsheets/d/1Y6ylJLSbkUqLzn9kN_rQSgDlssRpR-ZFresF46apFWY/edit?usp=sharing
49+
50+
## Git Workflow
51+
52+
See [CONTRIBUTING](CONTRIBUTING.md)

0 commit comments

Comments
 (0)