Skip to content

zfir-dev/SpringAngTasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringAngTasks

A modern full-stack task management application featuring:

  • Backend: Spring Boot (Java 17) with JWT authentication, H2 database, and Spring Security
  • Frontend: Angular 17 with PrimeNG UI components and responsive design
  • Deployment: Docker Compose for containerized development and deployment

Getting Started

Clone the Repository

git clone https://github.com/zfir-dev/SpringAngTasks.git
cd SpringAngTasks

Run with Docker Compose

docker-compose up --build

Once running, access the application:

The backend exposes the H2 console at: http://localhost:8081/h2 with

  • JDBC URL: jdbc:h2:mem:taskdb
  • Username: sa
  • Password: (empty)

Frontend Usage

  1. Open http://localhost:4200 in your browser.
  2. Register a new user or log in with existing credentials.
  3. Once logged in, you'll see the task dashboard where you can:
    • Create new tasks
    • View your tasks
    • Update task status (Pending → Completed)
    • Delete tasks

Testing the Backend with cURL

Once the backend is running, you can test it using the following commands.

Register a User

curl -X POST http://localhost:8081/auth/register \
  -H "Content-Type: application/json" \
  -d '{"username":"zafir","password":"pass123"}'

Login (get a token)

TOKEN=$(curl -s -X POST http://localhost:8081/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"zafir","password":"pass123"}' | jq -r .token)

echo $TOKEN

Create a Task

curl -X POST http://localhost:8081/api/tasks \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Deploy the app","description":"Using Docker Compose"}'

Get All Tasks

curl -X GET http://localhost:8081/api/tasks \
  -H "Authorization: Bearer $TOKEN"

Get Task by ID

curl -X GET http://localhost:8081/api/tasks/1 \
  -H "Authorization: Bearer $TOKEN"

Update Task

curl -X PUT http://localhost:8081/api/tasks/1 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Deploy backend","description":"Spring Boot on Docker","status":"COMPLETED"}'

Delete Task

curl -X DELETE http://localhost:8081/api/tasks/1 \
  -H "Authorization: Bearer $TOKEN"

Tips

  • Export your token after login so you don't have to copy-paste it:
TOKEN=$(curl -s -X POST http://localhost:8081/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"zafir","password":"pass123"}' | jq -r .token)
  • Use jq to pretty-print JSON responses:
curl -s -X GET http://localhost:8081/api/tasks -H "Authorization: Bearer $TOKEN" | jq

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published