This Tasker full stack maven project uses the following technology:
- React framework for frond-end design. (reference: React Crash Course)
- Dropwizard Framework
- Dropwizard Hibernate for ORM.
- H2 in-memory database
The frontend is designed with 3 main components:
- Task.js - individual task that is created with title and date content shown. If reminder is checked, green ribbon will be shown. Click the delete icon will delete the task.
- Tasks.js - a div container for task list.
- AddTask.js - a form for adding new task and submission.
npm start
The backend is designed with usage of Dropwizard framework, which is a light weight dependency injection framework with handy plugins, such as JDBI, Hibernate, database migration. H2 in-memory database is chosen in this project for demonstration of data persistance.
Three RESTful endpoints are exposed as follow:
- http://localhost:8080/task/all : accepts GET request and return all task stored in database.
- http://localhost:8080/task/{id}: accepts DELETE request and delete task entry with {id}.
- http://localhost:8080/task : accepts POST request with Json content type in the body.
Database preparation by Dropwizard Migration
Since we use H2-in-memory database, it is safe to clean up the database
java -jar target/Tasker-1.2-SNAPSHOT.jar db drop-all --confirm-delete-everything main.yml
After the first build, to apply pending changesets to your database schema, run command,
java -jar target/Tasker-1.2-SNAPSHOT.jar db migrate main.yml
java -jar target/Tasker-1.2-SNAPSHOT.jar server main.yml
docker build -t tasker-app-frontend .
docker images
docker run -p 3000:3000 tasker-app-frontend