Skip to content

mspiess/fullstack-demo-app

 
 

Repository files navigation

Demo Application

This application demonstrates how to set up a web application. The backend consists of a Spring Boot web application with an embedded Tomcat server and a Postgres database. The frontend consists of a single page application built with Angular and nginx as reverse proxy. To run all parts of the application, docker compose is used.

How to start the application

During development (local)

  • Start Postgres docker container: docker-compose -f backend/docker-compose.postgres.yml up (append -d to run in daemon mode)
  • Start Backend: cd backend && mvnw spring-boot:run
  • Start Frontend (with webpack dev server, not nginx): cd frontend && npm run start

Local production like

  • run ./build-an-run-local.sh (see script for more on how things work)

Reverse proxy

To avoid CORS issues due to different ports of frontend and backend, a reverse proxy is employed. This is done by using nginx, shipped within the frontend Dockerfile. See Dockerfile and nginx.conf for more.

For development, the webpack dev server ist configured to proxy requests to http://localhost:8080. See here for more.

HTTPS

To prevent man-in-the-middle attacks and sniffing of plain-text network traffic, SSL is configured in this demo application. The following resources are helpful to understand how HTTPS can be configured:

Run ./create-self-signed-certificate.sh to create a self signed certificate for use in a non-production environment.

Room for improvement

  • Dockerize Spring Boot not as minimalistic as currently done (e.g. read this guide)
  • Give this a read

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 44.5%
  • Java 44.2%
  • JavaScript 5.7%
  • HTML 2.9%
  • Shell 1.6%
  • Dockerfile 0.8%
  • CSS 0.3%