Skip to content

A solution for "Todo app" challenge on frontendmentor.io

Notifications You must be signed in to change notification settings

alex-kim-dev/todo-app

Repository files navigation

CD

Todo app

This is a solution to the Todo app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Why a todo app? Because you're not a frontend dev, if you haven't made one.

The challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Add new todos to the list
  • Mark todos as complete
  • Delete todos from the list
  • Filter by all/active/complete todos
  • Clear all completed todos
  • Toggle light and dark mode
  • Bonus: Drag and drop to reorder items on the list

Built with

  • semantic html markup & aria
  • mobile-first workflow
  • Vite (build tool)
  • Typescript & React
  • Emotion - styling library (css-in-js), using its styled API
  • React context & Immer for organizing global immutable state
  • linting (Eslint, Prettier, Commitlint)
  • testing (Jest, React Testing library)
  • pre-commit hooks
  • CI (Github Actions) for running tests & deploying to Github Pages

What I learned

Typescript - typing stuff is not easy, but it greatly helps finding errors even before I hit the ctrl + s, and it's nice to have more accurate auto suggestions.

Emotion - the 2nd css-in-js library I've tried (after JSS). This time I used the styled API, and I liked it much more than JSS, however, there's more work to do naming all those styled components. I also faced an issue running Stylelint v14 for linting the css template strings. Sadly, the emmet support for css in js (in vscode) is mixed with html and it's hard to be as productive in writing as in a regular css file.

Useful resources

Docs, docs, docs and a bit of google