This is a monorepo comprising of code that creates a React front end, a spring boot backend and a postgres database using docker
Disclaimer: This is not intended to be a production hardened system but a framwork around which a simple application can be created
- Docker Desktop
- Java 11
- NodeJS
- An RDBMS eg. DBeaver, DbSchema etc... (optional)
- A http client eg. Postman (optional)
It's a colllection of lean services that solve some problem from end to end. It represents a minimal implementation that will produce some valuable outcome.
- In the project root, run the command
make db
to get the postgres image and start the container that will hold it (the database will run on port5432
) cd
into thesimpleWebservice
directory- run the command
./gradlew bootRun
(the service should run on port8080
by default) - We can verify this was successful by going to
http://localhost:8080/getUsers
using a http client or more simply via a browser - In another terminal
cd
into thesimpleFrontEnd
directory - If this is our first time running the service we need to retrieve our dependencies using
npm install
ornpm i
- We then run the front end locally by using the command
npm start
- This should automatically open a browser on port
http://localhost:3000
where we will see a simple webpage - If we click on the button it will make a
get
request to our locally running webservice where we retrieve data and display it on the page
- Run
make all up
to build docker images for both front-end and back-end applications and start containers for each application, including database. - Run
make down
to stop all containers.
- The ports we use are hardcoded, so if we wish to run these services on other ports we will need to update our code accordingly
- The optional RDBMS is suggested if you wish to connect directly to the database running on port
5432
- The optional http client is suggested if we wish to more closely inspect the responses we get from our running webservice