This repository contains a frontend and two services to perform CRUD operations on Tasks and Users.
The project consists of both the frontend and backend code for TaskDemo, along with Docker support for easy deployment.
Before running the project locally, ensure you have the following installed:
- Docker for containerized deployment
- Node.js for running the frontend application
- Maven for managing backend dependencies
The backend is set up as a multi-module Maven project, located in the backend directoty, with the following modules:
common-model– Shared models and utilities.task-service– Manages tasks.user-service– Manages users.
The parent pom.xml file handles common dependencies and extends spring-boot-starter-parent for
consistent configuration.
To set up and run the frontend:
Navigate to the frontend directory:
cd frontend
Install frontend dependencies:
npm install
Start the development server:
npm run dev
The frontend will now be available at http://localhost:3000.
To run and test the services locally, use the provided docker-compose.yaml file, which sets up the following components:
A PostgreSQL database with the following tables:
assigned_user_task
tasks
users
Adminer provides a web interface to interact with the database.
- URL:
http://localhost:8080 - Login Credentials:
- Server:
postgres-db - Username:
myuser - Password:
mypassword - Database:
mydatabase
- Server:
Runs the Task API service.
Build the image before running:
mvn -f backend spring-boot:build-image -pl task-service
Runs the User API service.
Build the image before running:
mvn -f backend spring-boot:build-image -pl user-service
Once all services are running, execute the following command to create sample users and tasks:
bash scripts/initial-seed.sh
To start all services and run the project:
Start the services:
docker-compose up -d
Verify Adminer is running at http://localhost:8080.
Run initial-seed.sh to populate the database with test data.
Frontend: ESLint is used for linting. To check for any code style violations, run:
npm run lint
Backend: The backend uses Checkstyle for code style enforcement. The configuration can be found in the checkstyle.xml file.