This repository is a proof of concept (POC) and a template for a health and smooth development enviroment for a Web App using Spring Boot as backend and Vue3 as frontend.
It uses a customized Ubuntu Image from Docker to create a minimazed container with Java and NodeJS, to standarize versions across developer computers, NPM package NX for task management, and a default Postgres container as database.
You can see versions used in .env
The container also uses the custom Oh My ZSH theme, Flower Dance, to make the development process fun :D
Setup Container
1.1. Create image and container using command:
docker compose up -d
This will create image from Dockerfile.dev
, and create containers using docker-compose.yml
1.2. If Dockerfile.dev
changes, execute:
docker compose up -d --build
This will rebuild the image.
Install Docker extension in VSCode;
2.1. Click the remote icon icon (Two Arrows at the bottom-left corner);
2.2. Select Attach to Running container...
> <your-folder-name>-dev-env-1
;
2.3. Open /home/<your-username>
/app/.
Install npm packages.
npm i
From there, you have some tasks predefined with npm run <command>
, that will make you development exprience easier.
Command | Description |
---|---|
dev:back | Runs Spring Boot Web Server in back-end folder |
dev:front | Runs Vue3 Dev server with hot-reload in front-end folder |
dev | Runs both dev:back and dev:front |
build:back | Creates a build folder with a .jar from Spring Boot Web server in ./backend/target |
build:front | Creates a Vue3 wepage in /frontend/dist |
build | Build the frontend pages, copy's it to backend as a Spring Boot Static and then builds backend |
bump | Increses project version as a Major (Read More) in files package.json and backend/pom.xml |
publish | Bumps project, build it, commit's version changes, creates tags and publishes changes and tag to remote origin main (In that order) |