logo

Task Manager Fullstack

A task management app built with cutting-edge tech for fluid user experience 🚀

ViteJSExpressJSSQLiteTanstack Query & Router
post_image
12/10/2024
0
Source Code
Live Demo

⚠️ Note that the Backend is hosted on render.com. This means that it might take some seconds before coming back online as per free tier limitation!

The Story

Every developer's journey includes building a task manager - it's almost a rite of passage. But instead of creating just another todo list, I saw an opportunity to explore the latest tech stack while solving a common problem. The goal? Create a task manager that's not only functional but also serves as a playground for modern web technologies and best practices.

What Makes It Special

Picture a task manager that's as responsive as your thoughts. Add a task? It's there instantly. Update its status? The UI updates seamlessly. Delete something? Gone without a page refresh. All this magic happens through the power of TanStack Query's real-time synchronization, making the app feel less like a web page and more like a native application. ✨

The Technical Craft

Core Features

The Secret Sauce

Frontend Magic:

Backend Power:

Challenges & Solutions

The State Management Puzzle 🧩

The TypeScript Architecture 🎯

Technical Deep Dive

Frontend Architecture

Example of a task mutation using TanStack Query

Code
Copied!
const addTask = useMutation({
  mutationFn: (newTask: Task) => {
    return axios.post('/api/tasks', newTask)
  },
  onSuccess: () => {
    queryClient.invalidateQueries({ queryKey: ['tasks'] })
  }
})

Backend Structure

Task route handler with proper error handling

Code
Copied!
router.post('/tasks', async (req: Request, res: Response) => {
  try {
    const task = await db.create(req.body)
    res.status(201).json(task)
  } catch (error) {
    handleError(error, res)
  }
})

Behind the Scenes

This project was an exercise in balancing modern development practices with practical functionality. Every technical decision, from choosing Vite for the build system to implementing TanStack Query for state management, was made with both developer experience and end-user performance in mind.

What's Next?