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

Mugeha JacklineMugeha Jackline
3 min read

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

MethodEndpointDescription
GET/tasksGet all tasks
POST/task/saveAdd a new task
GET/task/delete/:idDelete a task
GET/task/edit/:idEdit 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.

0
Subscribe to my newsletter

Read articles from Mugeha Jackline directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mugeha Jackline
Mugeha Jackline