Task Manager
A full-stack task manager: a React and Redux frontend, and a Node.js, Express and MySQL REST API behind it. Tasks are organized with tags you create yourself, and with deadlines.
- React
- Redux
- Node.js
- Express
- MySQL
- REST API
Frontend on GitHubBackend on GitHub
Overview
Task Manager is a web app for keeping one big list of tasks, and organizing it with tags and deadlines. I built it because of how I work. In college, I got the most done when I put every assignment in one giant spreadsheet, with a column for the assignment, one for the class and one for the deadline. After college, daily to-do lists never stuck for me. I like one long list better than lots of short ones, so I made a single page where I can create, edit and delete tasks, and sort them out by tag and date.
It comes in two parts. The frontend is a React app. The backend is a REST API written with Node.js and Express, storing everything in MySQL.
What it does
- Create, edit and delete tasks on one page. Task text is edited in place.
- Make your own tags, and choose each tag’s name, text color and background color. A task can have more than one tag.
- Give a task a deadline, or leave it without one.
- Search the list, sort it by description, date or tag, or show only the tasks with one tag.
- The default order puts tasks with deadlines first, then groups the rest by tag.
The tag manager, where tags can be renamed and recolored:
How the backend works
The API has three groups of routes under /api/v1, for tasks, tags and the links between them. The database has a tasks table, a tags table and a task_tags table that joins the two. That is what lets a task carry several tags and a tag be used on many tasks. The queries pass their values as parameters instead of building SQL out of strings.
Because of the foreign keys in task_tags, the order of operations matters. Deleting a task or a tag first removes its rows in task_tags, and then the task or tag itself, since the database would refuse to do it the other way around.
Setting it up
This is the part I’d want someone in IT to look at. The backend reads its settings from a .env file: the port to run on, and the database host, username, password and name. When you run npm start, a script runs first. It connects to MySQL and creates the database and its three tables if they don’t exist yet, so a fresh install needs no manual SQL. The README walks through cloning the repository, writing the .env file and serving it.
The frontend
The frontend keeps its state in Redux Toolkit slices for tasks, tags and the links between them, and it tracks which items have been edited but not saved yet. Sorting, searching and filtering all work on that state. The tag colors come from a color picker.
The frontend repository on GitHub is the demo version of the app. It fills the page with sample tasks and runs entirely in the browser. The backend repository is the API the full version was built to talk to.
What I’d do differently
If I rewrote it today, I’d add automated tests and user accounts, and I’d make the API wait for each database query to finish before it answers. It was a good project for learning how the pieces of a web app fit together: a database, an API and an interface, each set up and configured on its own.