Skip to content

Commit 0e9030a

Browse files
committedJun 18, 2023
#1 Added README.md, checkstyle and Github Actions
1 parent 22005d6 commit 0e9030a

8 files changed

+159
-0
lines changed
 

‎.github/workflows/docker.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: docker/login-action@v2
13+
with:
14+
username: ${{ secrets.DOCKERHUB_USERNAME }}
15+
password: ${{ secrets.DOCKERHUB_TOKEN }}
16+
- uses: docker/setup-buildx-action@v2
17+
- uses: mr-smithers-excellent/docker-build-push@v5
18+
with:
19+
image: ${{ secrets.DOCKERHUB_USERNAME }}/tasklist
20+
tags: 0.0.$GITHUB_RUN_NUMBER, latest
21+
dockerfile: Dockerfile
22+
registry: docker.io
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
25+

‎.github/workflows/maven-build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: maven-build
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
8+
jobs:
9+
checkstyle:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-java@v3
14+
with:
15+
distribution: 'temurin'
16+
java-version: 17
17+
- uses: actions/cache@v3
18+
with:
19+
path: ~/.m2/repository
20+
key: maven-${{ hashFiles('**/pom.xml')}}
21+
restore-keys: |
22+
maven-
23+
- run: mvn clean install

‎README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Tasklist
2+
3+
This application helps you organize creating and accessing tasks for users.
4+
5+
You can access Swagger and see all available endpoints by visiting `http://localhost:8080/swagger-ui/index.html`
6+
7+
## Sequence diagram
8+
9+
![Sequence diagram](docs/sequence-diagram.png)
10+
11+
## Component diagram
12+
13+
![Component diagram](docs/component-diagram.png)
14+
15+
Main application communicates with cache (we use Redis), database (we use Postgresql), storage (we use MinIO).
16+
17+
## Class diagram
18+
19+
![Class diagram](docs/class-diagram.png)
20+
21+
We have two main classes - **User** and **Task**.
22+
23+
**User** class represents user in this application. User can login, create and update tasks.
24+
25+
User can have roles - `ROLE_USER` or `ROLE_ADMIN`.
26+
27+
**Task** class represents task in this application. Task can be created by user.
28+
29+
Task can have images.
30+
31+
## Environments
32+
33+
To run this application you need to create `.env` file in root directory with next environments:
34+
35+
- `HOST` - host of Postgresql database
36+
- `POSTGRES_USERNAME` - username for Postgresql database
37+
- `POSTGRES_PASSWORD` - password for Postgresql database
38+
- `POSTGRES_DATABASE` - name of Postgresql database
39+
- `POSTGRES_SCHEMA` - name of Postgresql schema
40+
- `REDIS_HOST` - host of Redis instance
41+
- `REDIS_PASSWORD` - password for Redis
42+
- `JWT_SECRET` - secret string for JWT tokens
43+
- `MINIO_BUCKET` - name of bucket for MinIO
44+
- `MINIO_URL` - URL of MinIO instance
45+
- `MINIO_ACCESS_KEY` - access key of MinIO
46+
- `MINIO_SECRET_KEY` - secret key of MinIO
47+
48+
## Guide
49+
50+
You can find step-by-step creating of this
51+
project [here](https://www.youtube.com/playlist?list=PL3Ur78l82EFD8OKSulH3NaK1As4G7YWMJ).

‎checkstyle-suppressions.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
3+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
4+
<suppressions>
5+
<suppress checks="MissingJavadocMethod"/>
6+
<suppress checks="JavadocPackage"/>
7+
<suppress checks="JavadocVariable"/>
8+
<suppress checks="DesignForExtension"/>
9+
<suppress checks="HideUtilityClassConstructor"/>
10+
<suppress checks="MagicNumber"/>
11+
<suppress checks="HiddenField"/>
12+
</suppressions>

‎docs/class-diagram.png

15.9 KB
Loading

‎docs/component-diagram.png

5.44 KB
Loading

‎docs/sequence-diagram.png

28.6 KB
Loading

‎pom.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
<springdoc.version>2.0.2</springdoc.version>
2929
<preliquibase.version>1.3.0</preliquibase.version>
3030
<minio.version>8.5.3</minio.version>
31+
<xml-format.version>3.2.2</xml-format.version>
32+
<checkstyle.version>3.2.2</checkstyle.version>
3133
</properties>
3234

3335
<dependencies>
@@ -160,6 +162,52 @@
160162
</excludes>
161163
</configuration>
162164
</plugin>
165+
<plugin>
166+
<groupId>au.com.acegi</groupId>
167+
<artifactId>xml-format-maven-plugin</artifactId>
168+
<version>${xml-format.version}</version>
169+
<executions>
170+
<execution>
171+
<id>xml-format</id>
172+
<goals>
173+
<goal>xml-format</goal>
174+
</goals>
175+
<configuration>
176+
<indentSize>4</indentSize>
177+
<keepBlankLines>true</keepBlankLines>
178+
<lineEnding>LF</lineEnding>
179+
<includes>pom.xml</includes>
180+
</configuration>
181+
</execution>
182+
</executions>
183+
</plugin>
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-checkstyle-plugin</artifactId>
187+
<version>${checkstyle.version}</version>
188+
<configuration>
189+
<configLocation>sun_checks.xml</configLocation>
190+
<consoleOutput>true</consoleOutput>
191+
<failsOnError>true</failsOnError>
192+
<linkXRef>false</linkXRef>
193+
</configuration>
194+
<executions>
195+
<execution>
196+
<id>validate</id>
197+
<phase>validate</phase>
198+
<goals>
199+
<goal>check</goal>
200+
</goals>
201+
<configuration>
202+
<suppressionsFileExpression>
203+
checkstyle.suppressions.file
204+
</suppressionsFileExpression>
205+
<suppressionsLocation>checkstyle-suppressions.xml
206+
</suppressionsLocation>
207+
</configuration>
208+
</execution>
209+
</executions>
210+
</plugin>
163211
</plugins>
164212
</build>
165213

0 commit comments

Comments
 (0)
Please sign in to comment.