π Building a To-Do App with Java Play Framework and MySQL

When I first set out to build a full-stack web app from scratch, I wanted something practical β simple enough to ship, yet complex enough to challenge me. That led me to building a To-Do List web app using Java (Play Framework) and MySQL.
This post walks you through what I built, how I built it, and what I learned.
π§ What I Built
The To-Do App lets users:
β Add tasks with a title, description, and reminders
βοΈ Edit tasks
β Delete tasks
ποΈ View a list of all tasks
Walkthrough video π Watch here
π οΈ Tech Stack
Backend: Java (Play Framework)
Frontend: HTML + CSS (Bootstrap), JavaScript
Database: MySQL
I used sbt as the build tool and the app runs on port 9000
locally.
πΈ Screenshots
Here's what the app looks like in action:
πΉ Homepage
πΉ Add Task View
πΉ Task List with Edit Options
π¦ Project Setup
Prerequisites
Java 11+
Play Framework
MySQL
sbt
Getting Started
git clone https://github.com/yourusername/todo2.git
cd todo2
Configure the Database
Create a MySQL DB called todo_db
, then edit conf/application.conf
:
db.default.driver=com.mysql.cj.jdbc.Driver
db.default.url="jdbc:mysql://localhost:3306/todo_db"
db.default.username="your_mysql_user"
db.default.password="your_mysql_password"
Run the App
sbt run
Then open: http://localhost:9000/
π‘ API Endpoints
Method | Endpoint | Description |
GET | /tasks | Get all tasks |
POST | /task/save | Add a new task |
GET | /task/delete/:id | Delete a task |
GET | /task/edit/:id | Edit a task |
I tested all endpoints using Postman with sample payloads.
π Folder Structure
π app
β£ π controllers # Java controllers
β£ π models # Data models
β£ π views # HTML templates
π conf
β π application.conf # Configs
π public
β£ π stylesheets
β£ π javascript
π migrations
π€ What I Learned
How to structure a Play Framework project from scratch
Integrating MySQL with JDBC and configuration management
Creating and consuming REST APIs in Java
Basic state management and frontend UI rendering
β¨ Whatβs Next?
In the future, Iβm thinking of:
Adding user authentication
Email reminders
A mobile-first redesign
If you'd like to contribute or try it out yourself, check it out here:
π GitHub Repo
π¬ Letβs Talk
Have feedback or ideas? Iβd love to hear from you. Drop a comment here or connect with me on LinkedIn.
If this helped you, consider giving the repo a β on GitHub.
π§ Final Words
This was one of those projects that taught me to break things, fix them, and document the chaos β and honestly, that's what tech is about.
Subscribe to my newsletter
Read articles from Mugeha Jackline directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
