- This Todo App enables users to perform full CRUD operations (Create / Read / Update / Delete) on Todos.
- You can filter Todos based on their status: "Completed" / "In Progress" / "Due Soon" / "Overdue".
- You can also sort Todos based on: "Last Created" / "Last Updated" / "Due Date" / "Title".
- Full specifications for this Todo App project can be found inside CHALLENGE.md.
- This project is hosted on Vercel. You can try it out via this link: https://todo-app-sd.vercel.app/
- Create a fresh PostgreSQL DB instance.
- Clone this project to your local machine.
- Create an
.envfile and copy the contents of.env.exampleinto it. - Fill in the
DATABASE_URLenv variable with your PostgreSQL DB instance URL. - Then run the following scripts:
# install dependencies
npm i
# generate a migration file to create and apply the DB schema to your PostgreSQL instance
npx drizzle-kit generate
# apply the migration to your PostgreSQL instance
npx drizzle-kit migrate
# create a production-ready build locally
npm run build
# start the project
npm startYou can also run the app in development mode:
# run the dev server
npm run dev
# before committing any new changes, run tests
npm testNext.jsApp RouterShadCN UIdesign library- Next.js server actions
date-fnsnpm package for date handlingSupabasewith aPostgreSQLdatabasePrismaDrizzle ORMto interact with the DBJestfor testingVercelfor hosting
You may have noticed Prisma is strikethrough — it was my initial choice, as I’ve used it in previous projects. However, I encountered several issues in this setup. Since I’m using server actions and hosting on Vercel, Prisma worked locally but not in production. I ultimately switched to Drizzle ORM, which was new to me but worked seamlessly both locally and on Vercel.
- Initiated a new Next.js project.
- Downgraded
ReactandReactDOMto version18.x.xdue to compatibility issues withShadCN UI. - Built the UI components: add Todo form, Todo item, Todo list, and add button.
- Configured frontend state management for Todos.
- Attempted to use
Prisma: successful locally, but failed on Vercel. - Regress from using
Prisma - Replaced Prisma with
Drizzle ORMand confirmed functionality both locally and on Vercel. - Implemented server actions: get all Todos, add, delete, update, and toggle completion, and connected them to the frontend.
- Improved Todo item rendering based on status.
- Implemented filtering and sorting UI for Todos.
- Refactored code to move calculation functions into the
/libfolder for better separation of concerns and cleaner testing. - Installed
Jestand wrote unit tests.
- Prevent spam toggling of Todo completion.
- Improve Todo add/edit form validation (e.g., using
Zod). - Implement a global state solution like
Zustandto simplify props passing between parents and child components. - Add more unit tests.
- Add integration and E2E tests.
I really enjoyed working on this project 😊.
I got the chance to deploy a Fullstack App using server actions on the Backend, as I mainly have deployed Fullstack apps using the traditional REST API approach in the past.
I also got the chance to learn how to work with Drizzle ORM.