Skip to content

Commit

Permalink
Add first GitHub entities and automatically fetch them for the leader…
Browse files Browse the repository at this point in the history
…board (#62)

Co-authored-by: Felix T.J. Dietrich <[email protected]>
Co-authored-by: Felix T.J. Dietrich <[email protected]>
  • Loading branch information
3 people authored Sep 2, 2024
1 parent 1c13b58 commit 2937c61
Show file tree
Hide file tree
Showing 50 changed files with 2,027 additions and 56 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.venv
.DS_Store

# Idea files
.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -162,4 +165,6 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

node_modules/
node_modules/

application-local.yml
58 changes: 36 additions & 22 deletions server/application-server/HELP.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,53 @@
# Getting Started

### Local development

The Spring Boot Maven Plugin supports running your application with a local development environment. To do this, you can use the `spring-boot:run` goal:

```shell
mvn spring-boot:run
```

This will start your application in a local development environment. You can access the application at `http://localhost:8080`.

Setting environment variables works through profile-based `application.yml` files. For local development, create a `application-local.yml` file overwriting the original properties. See [Using the Plugin :: Spring Boot](https://docs.spring.io/spring-boot/maven-plugin/using.html#using.overriding-command-line) for more information.

### Reference Documentation

For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/#build-image)
* [Docker Compose Support](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#features.docker-compose)
* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#using.devtools)
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web)
* [Spring Security](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security)
* [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data)
* [Spring Boot Actuator](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#actuator)
* [Liquibase Migration](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#howto.data-initialization.migration-tool.liquibase)
* [OAuth2 Client](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.client)
* [OAuth2 Resource Server](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.server)
- [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
- [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/)
- [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.3.2/maven-plugin/reference/html/#build-image)
- [Docker Compose Support](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#features.docker-compose)
- [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#using.devtools)
- [Spring Web](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web)
- [Spring Security](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security)
- [Spring Data JPA](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#data.sql.jpa-and-spring-data)
- [Spring Boot Actuator](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#actuator)
- [Liquibase Migration](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#howto.data-initialization.migration-tool.liquibase)
- [OAuth2 Client](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.client)
- [OAuth2 Resource Server](https://docs.spring.io/spring-boot/docs/3.3.2/reference/htmlsingle/index.html#web.security.oauth2.server)

### Guides

The following guides illustrate how to use some features concretely:

* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
* [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
* [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
* [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
* [Building a RESTful Web Service with Spring Boot Actuator](https://spring.io/guides/gs/actuator-service/)
- [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
- [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
- [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
- [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
- [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
- [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)
- [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/)
- [Building a RESTful Web Service with Spring Boot Actuator](https://spring.io/guides/gs/actuator-service/)

### Docker Compose support

This project contains a Docker Compose file named `compose.yaml`.
In this file, the following services have been defined:

* postgres: [`postgres:latest`](https://hub.docker.com/_/postgres)
- postgres: [`postgres:latest`](https://hub.docker.com/_/postgres)

Please review the tags of the used images and set them to the same as you're running in production.

Expand All @@ -42,4 +57,3 @@ Due to Maven's design, elements are inherited from the parent POM to the project
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
To prevent this, the project POM contains empty overrides for these elements.
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.

283 changes: 283 additions & 0 deletions server/application-server/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,64 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/Hello"
/user/{login}:
get:
tags:
- user
operationId: getUser
parameters:
- name: login
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/UserDTO"
/pullrequest/{id}:
get:
tags:
- pull-request
operationId: getPullRequest
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/PullRequest"
/pullrequest/author/{login}:
get:
tags:
- pull-request
operationId: getPullRequestsByAuthor
parameters:
- name: login
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequest"
/admin:
get:
tags:
Expand Down Expand Up @@ -69,3 +127,228 @@ components:
Timestamp of when the Hello entity was created.
This field is mandatory.
format: date-time
IssueCommentDTO:
type: object
properties:
id:
type: integer
format: int64
body:
type: string
createdAt:
type: string
updatedAt:
type: string
author:
$ref: "#/components/schemas/UserDTO"
pullRequest:
$ref: "#/components/schemas/PullRequestDTO"
PullRequestDTO:
type: object
properties:
id:
type: integer
format: int64
title:
type: string
url:
type: string
state:
type: string
enum:
- CLOSED
- OPEN
createdAt:
type: string
updatedAt:
type: string
mergedAt:
type: string
author:
$ref: "#/components/schemas/UserDTO"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueCommentDTO"
repository:
$ref: "#/components/schemas/RepositoryDTO"
RepositoryDTO:
type: object
properties:
name:
type: string
nameWithOwner:
type: string
description:
type: string
url:
type: string
UserDTO:
type: object
properties:
id:
type: integer
format: int64
login:
type: string
email:
type: string
name:
type: string
url:
type: string
pullRequests:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequestDTO"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueCommentDTO"
IssueComment:
required:
- body
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
body:
type: string
author:
$ref: "#/components/schemas/User"
pullRequest:
$ref: "#/components/schemas/PullRequest"
PullRequest:
required:
- state
- title
- url
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
title:
type: string
url:
type: string
state:
type: string
description: |-
State of the PullRequest.
Does not include the state of the merge.
enum:
- CLOSED
- OPEN
mergedAt:
type: string
author:
$ref: "#/components/schemas/User"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueComment"
repository:
$ref: "#/components/schemas/Repository"
Repository:
required:
- defaultBranch
- description
- name
- nameWithOwner
- url
- visibility
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
name:
type: string
nameWithOwner:
type: string
description:
type: string
defaultBranch:
type: string
visibility:
type: string
enum:
- PUBLIC
- PRIVATE
url:
type: string
homepage:
type: string
pullRequests:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequest"
User:
required:
- login
- url
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
login:
type: string
description: Unique login identifier for a user.
email:
type: string
name:
type: string
description: Display name of the user.
url:
type: string
description: |-
Unique URL to the user's profile.
Not the website a user can set in their profile.
avatarUrl:
type: string
description: |-
URL to the user's avatar.
If unavailable, a fallback can be generated from the login, e.g. on Github:
https://github.com/{login}.png
pullRequests:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/PullRequest"
comments:
uniqueItems: true
type: array
items:
$ref: "#/components/schemas/IssueComment"
Loading

0 comments on commit 2937c61

Please sign in to comment.