All Projects → Allianzcortex → Laraforum

Allianzcortex / Laraforum

Licence: apache-2.0
[Spring + JPA ] [ React + Typescript + Redux + Hooks ] [ Docker ] based blog

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Laraforum

Easyee
开源 JavaEE 企业级快速开发平台。提供了 Spring Boot, Struts2, Hibernate, MyBatis, Shiro, EasyUI 等技术,包含完整的权限管理系统等。提供自动化代码生成器。 Open source JaveEE enterprise-class rapid development of the basic platform. Integration of Spring Boot, Struts2, Hibernate, MyBatis, Shiro, EasyUI and other technologies, including the integrity of the rights management. Provides an automated code generator.
Stars: ✭ 275 (+1618.75%)
Mutual labels:  jpa, spring-boot
Spring Jpa Best Practices
spring-jpa best practices
Stars: ✭ 332 (+1975%)
Mutual labels:  jpa, spring-boot
Atom
Java course materials
Stars: ✭ 293 (+1731.25%)
Mutual labels:  jpa, spring-boot
Crnk Framework
JSON API library for Java
Stars: ✭ 234 (+1362.5%)
Mutual labels:  jpa, spring-boot
Favorites Web
云收藏 Spring Boot 2.X 开源项目
Stars: ✭ 4,485 (+27931.25%)
Mutual labels:  jpa, spring-boot
Eladmin
项目基于 Spring Boot 2.1.0 、 Jpa、 Spring Security、redis、Vue的前后端分离的后台管理系统,项目采用分模块开发方式, 权限控制采用 RBAC,支持数据字典与数据权限管理,支持一键生成前后端代码,支持动态路由
Stars: ✭ 16,943 (+105793.75%)
Mutual labels:  jpa, spring-boot
Xboot
基于Spring Boot 2.x的一站式前后端分离快速开发平台XBoot 微信小程序+Uniapp 前端:Vue+iView Admin 后端:Spring Boot 2.x/Spring Security/JWT/JPA+Mybatis-Plus/Redis/Elasticsearch/Activiti 分布式限流/同步锁/验证码/SnowFlake雪花算法ID 动态权限 数据权限 工作流 代码生成 定时任务 社交账号 短信登录 单点登录 OAuth2开放平台 客服机器人 数据大屏 暗黑模式
Stars: ✭ 3,432 (+21350%)
Mutual labels:  jpa, spring-boot
Spring Boot Leaning
Spring Boot 2.X 最全课程代码
Stars: ✭ 2,008 (+12450%)
Mutual labels:  jpa, spring-boot
Scoold
A Stack Overflow clone for teams (self-hosted)
Stars: ✭ 463 (+2793.75%)
Mutual labels:  forum, spring-boot
Erupt
🚀 纯 Java 注解,快速开发 Admin 管理后台。不生成任何代码、零前端代码、零 CURD、自动建表、注解式API,支持所有主流数据库,支持自定义页面,支持多数据源,提供二十几类业务组件,十几种展示形式,支持逻辑删除,动态定时任务,前端后端分离等。核心技术:Spring Boot、JPA、Reflect、TypeScript、NG-ZORRO等。 开源不易,记得右上角点个star鼓励作者~
Stars: ✭ 421 (+2531.25%)
Mutual labels:  jpa, spring-boot
Spring Boot Postgresql Jpa Hibernate Rest Api Demo
Building RESTful APIs with Spring Boot, PostgreSQL, JPA and Hibernate
Stars: ✭ 209 (+1206.25%)
Mutual labels:  jpa, spring-boot
Grpc By Example Java
A collection of useful/essential gRPC Java Examples
Stars: ✭ 709 (+4331.25%)
Mutual labels:  jpa, spring-boot
Jpa Hibernate Tutorials
Hibernate Tutorials with Spring Boot and Spring-Data-JPA
Stars: ✭ 186 (+1062.5%)
Mutual labels:  jpa, spring-boot
Spring Boot Demo
Spring Boot & Spring Cloud & Spring Security Demo Case(Spring学习示例实战项目)
Stars: ✭ 255 (+1493.75%)
Mutual labels:  jpa, spring-boot
Okta Spring Boot React Crud Example
Simple CRUD with React and Spring Boot 2.0
Stars: ✭ 176 (+1000%)
Mutual labels:  jpa, spring-boot
Angularjs Springmvc Sample Boot
A RESTful sample using Spring Boot, Spring MVC, Spring Data and Angular/Bootstrap.
Stars: ✭ 309 (+1831.25%)
Mutual labels:  jpa, spring-boot
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (+550%)
Mutual labels:  jpa, spring-boot
Spring Kotlin Exposed
playground for spring-boot 2.*, kotlin , jetbrains-exposed, postgres, jsonb, flyway, docker
Stars: ✭ 106 (+562.5%)
Mutual labels:  jpa, spring-boot
Dokit
基于 Spring Boot2、 Jpa、 Spring Security、JWT、redis、Vue的前后端分离的后台管理系统开发平台, 用户管理、菜单管理、角色管理、字典管理、权限控制的方式为RBAC,操作日志、异常日志、接口限流、项目支持数据权限管理,支持一键生成前后端代码(支持在线预览及打包下载),支持前端菜单动态路由 可一键部署服务器应用,数据库。系统中活跃用户状态监控,监视当前系统CPU、内存、磁盘、堆栈等相关信息,基于Element UI在线表单设计及生成Vue代码。
Stars: ✭ 348 (+2075%)
Mutual labels:  jpa, spring-boot
Hibernate Springboot
Collection of best practices for Java persistence performance in Spring Boot applications
Stars: ✭ 589 (+3581.25%)
Mutual labels:  jpa, spring-boot

LaraForum Build Status

LaraForum is a full-stack forum with Spring Boot as skeleton and Spring Data JPA as ORM to provide restful api in controller.

Frontend is built with React + Hooks + Redux + Redux-thunk + React-router + styled-component + material UI

A simple demo

HomePage

If you just want to a MVP(Minimal Valuable Product) to learn Spring , I will recommend you to my class-project which is simplier and implemented all CRUD functions(and pure HTML && CSS as frontend).


This application includes :

  • user registration/login/Change Account Info/logout function

  • Users can add/delete posts/comments,the action above will trigger notifications that can be read

  • topic creation/deletion

  • article classification by tag

  • page search based on MySQL Full-text Search or Fuzzy matching keyword with Lucene.


Some APIs will be like:

  • get single article by slug
get /api/articles/get/single/{slug}

return:
{
    'id':{id},
    'name':{name},
    'tag':[1,2,3]
}
  • get batch articles by multiple conditions :
get /api/articles/get/batch?tag=xx&author=yy
  • push notifications to certain user
post /api/read/notice/{userId}
  • add permissions for user
/api/permission/add/{user}/2
  • set roles for user
/api/role/add/{user}/2
  • search by keyword
/api/search/{keyWord}

... etc


Except using @ControllerAdvice to handle global exception and @ResponseEntity to return the header and data both.There are also some other features:

  1. LightWeight:

Lightweight here refers to components other than Springboot+Spring JPA+Spring MVC are not involved. Two more important features :authentication and Authorization are implemented based on Spring framework without rely on third-party packages(e.g. spring-security or shrio)

authentication is achieved by JWT(Json Web Token). You can check the verification-code by filter and judgement-code by interceptor. Results calculated will be read by backend application after request.setAttribute to avoid duplicate verification.

authorization is achieved by @annotation+AspectJ to do the AOP(aspect-oriented programming). Two annotations are @RequirePermissiona(code) and @RequireRoles(code) managed by RolesAndPermissionsChecker(code).If you need to add permission manage for your logical code , you only need to add the permissions like @RequirePermission("youPermission") without intrusion to original code(Python-decorator like,e.g. in code ,only people with create_post permission are allowed to publish the post )

@RequirePermissions("create_post")
@Transactional
@PostMapping("permission/add/{userName}/{pNumber}")
public void addUserPermission(@PathVariable String userName, @PathVariable Integer pNumber) {
   // logic
}


  1. UnitTest And IntegrationTest
  • Integration Test is essential because spring application needs to interact with real world.

  • Unit Test is also important when testing the correctness of single function(e.g. article-slug-test-code)

Main frameworks are JunitMockito IntegrationTest is on Repository layer to judge whether the data can really be inserted to database(code).UnitTest is on Service layer to judge whethere the controller will invoke corresponding Repository(code).

@Test
public void whenUserSave_thenCheckSuccess(){
     userServiceMock.save(user);
     verify(userRepositoryMock).save(user);
}

This code will test service reaction.

  • Test Results:

FrontEnd is developed by Angular , and more pages are in the progress, you can check the Lara/FE for more details.

Below is the postman screenshots.


Project Structure

├── main
│   ├── java
│   │   └── com
│   │       └── laraforum
│   │           ├── authentication
│   │           │   ├── GetJwtTokenFilter.java
│   │           │   ├── JwtProvider.java
│   │           │   ├── ParseJwtTokenFilter.java
│   │           │   └── ParseJwtTokenInterceptor.java
│   │           ├── authorization
│   │           │   ├── RequirePermissions.java
│   │           │   ├── RequireRoles.java
│   │           │   └── RolesAndPermissionsChecker.java
│   │           ├── configuration
│   │           │   ├── FilterConfigure.java
│   │           │   ├── InterceptorConfigure.java
│   │           │   ├── MySqlRepositoryConfigure.java
│   │           │   ├── RepositoryConfig.java
│   │           │   └── SearchConfiguration.java
│   │           ├── controller
│   │           │   ├── ArticleController.java
│   │           │   ├── CommentController.java
│   │           │   ├── OtherController.java
│   │           │   └── UserContoller.java
│   │           ├── exception
│   │           │   ├── CustomException.java
│   │           │   ├── Handle
│   │           │   │   └── ResponseEntityException.java
│   │           │   └── UnAuthorizedException.java
│   │           ├── LaraApplication.java
│   │           ├── model
│   │           │   ├── ArticleComment.java
│   │           │   ├── Article.java
│   │           │   ├── Comment.java
│   │           │   ├── dto
│   │           │   │   ├── ArticleView.java
│   │           │   │   ├── ArticleWhenCreated.java
│   │           │   │   └── UserWithEmailAndPassWord.java
│   │           │   ├── enums
│   │           │   │   ├── Permission.java
│   │           │   │   └── Role.java
│   │           │   ├── Favorite.java
│   │           │   ├── Notification.java
│   │           │   ├── Tag.java
│   │           │   ├── Token.java
│   │           │   └── User.java
│   │           ├── repository
│   │           │   ├── ArticleCommentRepository.java
│   │           │   ├── ArticleRepository.java
│   │           │   ├── CommentRepository.java
│   │           │   ├── FavoriteRepository.java
│   │           │   ├── NotificationRepository.java
│   │           │   ├── PermissionRepository.java
│   │           │   ├── RoleRepository.java
│   │           │   ├── TagRepocitory.java
│   │           │   ├── TokenRepository.java
│   │           │   └── UserRepository.java
│   │           ├── service
│   │           │   ├── ArticleCommentService.java
│   │           │   ├── ArticleService.java
│   │           │   ├── CommentService.java
│   │           │   ├── FavoriteService.java
│   │           │   ├── impl
│   │           │   │   ├── ArticleCommentServiceImpl.java
│   │           │   │   ├── ArticleServiceImpl.java
│   │           │   │   ├── CommentServiceImpl.java
│   │           │   │   ├── FavoriteServiceImpl.java
│   │           │   │   ├── NotificationServiceImpl.java
│   │           │   │   ├── PermissionServiceImpl.java
│   │           │   │   ├── RoleServiceImpl.java
│   │           │   │   ├── SearchServiceImpl.java
│   │           │   │   ├── TokenServiceImpl.java
│   │           │   │   └── UserServiceImpl.java
│   │           │   ├── NotificationService.java
│   │           │   ├── PermissionService.java
│   │           │   ├── RoleService.java
│   │           │   ├── SearchService.java
│   │           │   ├── TokenService.java
│   │           │   └── UserService.java
│   │           └── util
│   │               ├── ArticleUtils.java
│   │               └── TestUtils.java
│   └── resources
│       ├── application.properties
│       ├── db-schema.sql
│       └── static
│           └── images
│               └── register.png
└── test
    └── java
        └── com
            └── laraforum
                ├── authentication
                │   └── JwtTokenTest.java
                ├── configuration
                │   └── ServiceTestConfiguration.java
                ├── controller
                │   └── UserControllerMockitoTest.java
                ├── LaraApplicationTests.java
                ├── repository
                │   └── UserRepositoryTest.java
                ├── service
                │   └── UserServiceMockitoTest.java
                ├── UserEntityTest.java
                └── utils
                    └── ArticleUtilsTest.java
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].