-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2fcbb7b
Showing
73 changed files
with
3,201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Java CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: JDK Setup 20 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '20' | ||
distribution: 'corretto' | ||
architecture: x64 | ||
cache: maven | ||
|
||
- name: Maven Build | ||
run: mvn -B install -DskipTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
server/HELP.md | ||
.gradle | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
target/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Emmy Steven / www.emmysteven.com | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
|
||
 | ||
|
||
<div align="center"> | ||
<img alt="status" src="https://github.com/emmysteven/meetona/actions/workflows/maven.yml/badge.svg?branch=main"> | ||
<img alt="status" src="https://img.shields.io/badge/Status-developing-brightgree"> | ||
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/emmysteven/meetona"> | ||
<img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed/emmysteven/meetona"> | ||
<img alt="GitHub stars" src="https://img.shields.io/github/stars/emmysteven/meetona"> | ||
<img alt="visitors" src="https://visitor-badge.laobi.icu/badge?page_id=meetona"> | ||
<a href="https://twitter.com/intent/tweet?hashtags=meetona,java,Spring Boot,oss&text=A+portal+for+efficient+and+effective+community+management&url=https%3A%2F%2Fgithub.com%2Femmysteven%2Fmeetona&via=emmysteven_"> | ||
<img alt="Twitter" src="https://img.shields.io/twitter/url/http/shields.io.svg?style=flat&logo=twitter"> | ||
</a> | ||
|
||
</div> | ||
|
||
<br/> | ||
|
||
An Implementation of Spring Boot with Java 20. | ||
With this Codebase, you will get access to the world of Loosely-Coupled and Inverted-Dependency Architecture in Java 20 | ||
|
||
## Upcoming Release | ||
|
||
### v0.0.1-release | ||
|
||
Read the [Changelog file](https://github.com/emmysteven/meetona/blob/main/CHANGELOG.md) to see the new changes. | ||
|
||
Clone this repository to get the latest unreleased version. | ||
|
||
|
||
## Releases | ||
|
||
v0.0.1-snapshot - IS NOT YET OUT<!--[Download the first snapshot here](https://github.com/emmysteven/meetona/releases/tag/v0.0.1-snapshot) --> | ||
|
||
## Getting Started | ||
Follow these steps to get started | ||
1. Clone this Repository and Extract it to a Folder. | ||
2. Open up docker | ||
3. On your terminal, go to the root folder and run docker-compose up | ||
4. Run the Application using IntelliJ IDEA CE | ||
|
||
|
||
## Purpose of this Project | ||
|
||
This project will help community leaders have the following info: | ||
- The number of members in their community | ||
- The number of members that are in attendance | ||
- The number of members absent in a meeting | ||
|
||
This project will also help community leaders: | ||
- keep a record of member's birthday | ||
- send automated birthday and wedding anniversary emails | ||
- keep a record of meeting agenda | ||
|
||
|
||
## Technologies | ||
- GraalVM Java 20 | ||
- Spring Boot 3.1.3 | ||
- Maven 3.9.4 | ||
- PostgreSQL 15 | ||
- IntelliJ IDEA CE | ||
|
||
## Features | ||
- [x] Java Persistence API (JPA) | ||
- [x] Repository Pattern - Generic | ||
- [ ] CQRS and Event Sourcing | ||
- [x] Logging | ||
- [x] Swagger UI | ||
- [x] Response Wrappers | ||
- [x] Pagination | ||
- [x] Redis Cache | ||
- [x] RDBMS | ||
- [x] JWT Authentication | ||
- [x] Custom Exception Handler | ||
- [x] Email Service | ||
- [x] Complete User Management Module (Register / Generate Token / Forgot Password / Confirmation Mail) | ||
|
||
|
||
## Prerequisites | ||
- IntelliJ IDEA CE | ||
- JDK 20 and above | ||
- Basic Understanding of Spring Boot | ||
- I Recommend that you read: | ||
* [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/bookmarks/) | ||
* [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) | ||
|
||
|
||
## Bugs? Suggestions? | ||
Having any issues or troubles getting started? [Get in touch with me](https://www.codaholic.com/contact) or [Raise a Bug or Feature Request](https://github.com/emmysteven/meetona/issues/new/choose). Always happy to help. | ||
|
||
|
||
## Give a Star ⭐ | ||
If you find this project helpful, do give it a star. Thanks! <br/> | ||
If you are feeling really generous, send me ETH: <code>0x9F4942911f2406E5897669Db99184d47B3078E99</code> | ||
|
||
|
||
## Share it! | ||
There are many improvements and fixes along the way from the day I started out. Thanks to the community for the support and suggestions. | ||
Please share this Repository within your developer community, if you think this would make a difference! Thanks. | ||
|
||
|
||
## About the Author | ||
### Emmy Steven | ||
- Blogs at [codaholic.com](https://www.codaholic.com) | ||
- Twitter - [Emmy Steven](https://www.twitter.com/emmysteven_) | ||
- Linkedin - [Emmy Steven](https://www.linkedin.com/in/emmysteven/) | ||
|
||
## Licensing | ||
This project is licensed with the [MIT License](https://github.com/emmysteven/meetona/blob/main/LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>meetona</groupId> | ||
<artifactId>meetona</artifactId> | ||
<version>0.0.1</version> | ||
</parent> | ||
|
||
<artifactId>core</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package meetona.core.common; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.persistence.*; | ||
import lombok.Data; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedBy; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
|
||
|
||
@Data | ||
@MappedSuperclass | ||
public abstract class BaseEntity implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = 5L; | ||
|
||
@Id | ||
@GeneratedValue | ||
private UUID id; | ||
|
||
@JsonIgnore | ||
@CreatedDate | ||
@Column(name = "created_by", updatable = false) | ||
private String createdBy; | ||
|
||
@JsonIgnore | ||
@CreatedDate | ||
@Column(name = "created_dt") | ||
@Temporal(TemporalType.TIMESTAMP) | ||
private LocalDateTime createdDate; | ||
|
||
@JsonIgnore | ||
@LastModifiedBy | ||
@Column(name = "updated_by") | ||
private String updatedBy; | ||
|
||
@JsonIgnore | ||
@LastModifiedDate | ||
@Column(name = "updated_dt") | ||
@Temporal(TemporalType.TIMESTAMP) | ||
private LocalDateTime updatedDate; | ||
|
||
@JsonIgnore | ||
@Version | ||
private Integer version; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package meetona.core.entity; | ||
|
||
import meetona.core.common.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
|
||
|
||
@Entity | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "units") | ||
@EqualsAndHashCode(callSuper = false) | ||
public class Units extends BaseEntity { | ||
|
||
private String name; | ||
private String location; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package meetona.core.entity; | ||
|
||
import meetona.core.enums.Role; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.springframework.data.annotation.Transient; | ||
import meetona.core.common.BaseEntity; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
|
||
@Data | ||
@Entity | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "users") | ||
@EqualsAndHashCode(callSuper = false) | ||
public class User extends BaseEntity { | ||
|
||
private String firstname; | ||
private String lastname; | ||
protected String username; | ||
private String email; | ||
protected String password; | ||
|
||
@Builder.Default | ||
@Enumerated(EnumType.STRING) | ||
protected Set<Role> roles = new HashSet<>(); | ||
|
||
@Column(name = "unit_id") | ||
private long unitId; | ||
|
||
@Transient | ||
private Units units; | ||
|
||
private Boolean isEmailVerified; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package meetona.core.enums; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING) | ||
public enum Role { | ||
USER, | ||
ADMIN, | ||
SYSTEM | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package meetona.core.enums; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING) | ||
public enum Status { | ||
ENABLED, | ||
DISABLED, | ||
ACTIVE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package meetona.core.event; | ||
|
||
import meetona.core.entity.User; | ||
import org.springframework.lang.NonNull; | ||
|
||
public record SignedInEvent(@NonNull User user) { | ||
public User getUser(User user) { | ||
return user; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package meetona.core.event; | ||
|
||
|
||
import meetona.core.entity.User; | ||
import org.springframework.lang.NonNull; | ||
|
||
public record SignedUpEvent(@NonNull User user) { | ||
public User getUser(User user) { | ||
return user; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
core/src/main/java/meetona/core/exception/AppException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package meetona.core.exception; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
|
||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) | ||
public class AppException extends RuntimeException { | ||
|
||
public AppException(String message) { | ||
super(message); | ||
} | ||
|
||
public AppException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
Oops, something went wrong.