This is a simple CRUD application built with Spring Boot and Angular for maintaining users. This project is made up of three separate Docker containers for:
- PostgreSQL (Database)
- Spring Boot REST API (Server)
- Angular Frontend (Client)
The entry point for this application is http://localhost:4200/
In order to run this application you need to install two tools: Docker & Docker Compose.
Instructions how to install Docker on Ubuntu, Windows, Mac.
docker-compose up -d
docker-compose up -d --build
docker-compose stop
docker-compose logs server
docker-compose logs client
The PostgreSQL database contains only a single schema with one table - users
.
After running the app it can be accessible using the following criteria:
- Host:
localhost
- Database:
app_db
- User:
admin
- Password:
admin
docker-compose.yml
db:
image: 'postgres:13.3-alpine'
container_name: postgres
volumes:
- postgres:/var/lib/postgresql/data
ports:
- '5432:5432'
environment:
- POSTGRES_DB=app_db
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
restart: always
This is a Spring Boot (Java) based application that connects with a database and exposes some REST endpoints which are being consumed by the angular frontend. It supports multiple HTTP REST methods like GET, POST, PUT and DELETE for a single resource - users
.
docker-compose.yml
server:
build: ./apps/server
container_name: server
environment:
- DB_SERVER=db
- DB_PORT=5432
- POSTGRES_DB=app_db
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
ports:
- '8080:8080'
depends_on:
- db
This is the endpoint for a user to maintain other users. It consumes the REST API endpoints that are being provided by server
.
docker-compose.yml
client:
build: ./apps/client
container_name: client
ports:
- '4200:80'
depends_on:
- server
Created by @scarnett
Copyright © 2021 Scott Carnett. Licensed under the MIT License (MIT)
This project was generated using Nx.