A campus for universities made with reactjs + spring + jersey

Overview

spring-react-campus

This is a campus for universities that consist on a multi-module maven project that bundles both frontend (full-fledged SPA client) and backend (API REST) into a single WAR ready to be deployed and run under the same context.

Backend

Structure

The overall project structure (attempts) to follow DDD (Domain Driven Design by Eric Evans):

  • interfaces: Declares the contracts for both the /services and /persistence implementations
  • models: Declares the domain (ORM-based entities for JPA)
  • persistence: Implements the contracts declared over /interfaces, it's the link between the database and the application
  • services: Implements the contracts declared over /interfaces, it's the link between the controllers and the persistence layer
  • webapp: Implements the API REST endpoints, uses the service layer.

Dependencies

The backend utilizes the following plugins/dependencies:

  • Jersey
  • Jax-RS
  • JUnit4 + Mockito
  • Spring 4 + Spring Security
  • Spring HATEOAS + MapStruct
  • Hibernate JPA + PSQL

Functionality

The backend is an API REST that consists on three main filters that execute in order:

  • Authorization filter (spring-security)
  • Jersey filter (servlet-container)
  • Default spring filter

Every authorized request over /api/** passes through the security filter which checks for either the Basic or Bearer authorization header. In the case the provided header is Basic and the credentials are correct, a JWT token is generated and appended in the response as Authorization: Bearer

After this, the jersey filter takes over and tries to find the endpoint corresponding to the request, in case it's not found, the request is forwarded to the spring default filter which allows serving static content on which we serve the react /index.html as we can see over the web.xml

Build

To build the project just run (you can opt to skip tests):

mvn clean install --DskipTests

Frontend

The frontend uses the following libraries/modules/frameworks:

  • react-typescript
  • react-router
  • i18next
  • jest

For standalone dev deployment you can navigate to the /spa-client folder and run:

npm start

Note: make sure to update the /src/common/constants/index.js API base url if you are doing this

To execute the tests run:

npm test

For a production build run:

npm run build

Authors

Thanks to

You might also like...

Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

Dec 20, 2022

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot Login and Registration example with MongoDB Build a Spring Boot Auth with HttpOnly Cookie, JWT, Spring Security and Spring Data MongoDB. Y

Dec 30, 2022

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login example with Spring Security, MySQL and JWT Appropriate Flow for User Login and Registration with JWT Spring Boot Rest Api Architect

Jan 5, 2023

Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker.

Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker.

spring-microservice Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker. Arc

Sep 13, 2022

Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

Jan 26, 2022

Spring REST service built with Spring initializr and Spring Data.

Spring REST Service Generated with start.spring.io, using Spring Data. Documented using Spring REST Docs. Spring Initializr - Generate new Spring Rest

Jan 28, 2022

The state-of-the-art Dashboard of Apache RoccketMQ provides excellent monitoring capability. Various graphs and statistics of events, performance and system information of clients and application is evidently made available to the user.

RocketMQ Dashboard How To Install With Docker get docker image mvn clean package -Dmaven.test.skip=true docker:build or docker pull apacherocketmq/ro

Dec 30, 2022

Afnan007a's Original Ptero-VM made for Pterodactyl, running lightly in a .jar file.

Ptero-VM in a JAR. This project is a Java implementation of Afnan's Ptero-VM that was made for Pterodactyl, this project was created to support a even

Oct 2, 2022

A simple online Quiz App made by using Firebase firestore database.

A simple online Quiz App made by using Firebase firestore database.

Quiz App Online Description Quiz App is an Online quiz maker app that can be used to create effective quizzes by teachers. This app uses Firebase Fire

Dec 30, 2021
Owner
null
ReactJS, Spring Boot JWT Authentication Example

springboot-reactjs-jwt-authentication ReactJS - SpringBoot - JWT - Flow Local setup Step 1: Download or clone the source code from GitHub to a local m

Sibin Rasiya 16 Dec 2, 2022
A Zombie invasion has occurred at the Code Academy Campus and now Alcatrinha has to fight the zombies to death! (2D TopView Shooter)

Hello everyone, welcome to Zombie ACADalypse!! A Zombie invasion has occurred at the Code Academy Campus and now Alcatrinha has to fight the zombies t

Mario Vieria 1 Dec 17, 2021
Webserver Jersey with Java

Webserver Jersey with Java About Observamos na Unidade 3 que o Jersey facilita a construção de Web Services com Java. Baseado no projeto da unidade 3,

Giovane Santos Silva 3 Aug 11, 2022
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的线上博客项目/企业大型商城系统/前后端分离实践项目等,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。

Spring Boot Projects 该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前

十三 4.5k Dec 30, 2022
A simple blog post api made with spring,mysql.Following tutorial by @FadatareRamesh(Java Guides)

blogAPI A simple blog post api made with spring,mysql.Following tutorial by @FadatareRamesh(Java Guides) Frontend server(made using Angular) can be fo

null 1 Feb 2, 2022
An assistance platform made using Spring framework that analyses your code, and helps you either to start a devops project, or to turn an existing project into a devops project using open source software (Git, Docker, Jenkins..)

DevOpsify Description An assistance platform made using Spring framework that analyses your code, and helps you either to start a devops project, or t

obaydah bouifadene 14 Nov 8, 2022
一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

友情提示:因为提供了 50000+ 行示例代码,所以艿艿默认注释了所有 Maven Module。 胖友可以根据自己的需要,修改 pom.xml 即可。 一个涵盖六个主流技术栈的正经仓库: 《Spring Boot 专栏》 《Spring Cloud Alibaba 专栏》 《Spring Clou

芋道源码 15.7k Dec 31, 2022
参考 DDD/Clean Architecture 设计理念,整合 Spring Boot/Spring Security/Mybatis Plus/Vavr 的 Spring Realworld 应用案例

Demo · 更多项目 · 参考资料 ms-spring-ddd-examples Unified Domain-driven Layered Architecture for MicroService Apps,试图探索一套切实可行的应用架构规范,可以复制、可以理解、可以落地、可以控制复杂性的指导

王下邀月熊 19 Sep 23, 2022
Spring Kurulumundan Başlayarak, Spring IOC ve Dependency Injection, Hibernate, Maven ve Spring Boot Konularına Giriş Yapıyoruz.

Spring Tutorial for Beginners File Directory Apache Tomcat Apache Tomcat - Eclipse Bağlantısı Spring Paketlerinin İndirilmesi ve Projeye Entegrasyonu

İbrahim Can Erdoğan 11 Apr 11, 2022