TodolistProject

Frontend Documentation

Overview

The frontend of the project is a React + TypeScript single-page application (SPA) that provides the user interface for managing tasks, teams, and user accounts. It communicates exclusively with the backend microservices through an Nginx reverse proxy that routes /api/* requests to the appropriate services.

The main goals of the frontend are:


Technology Stack


Project Structure

frontend/
├── src/
│   ├── api/                # HTTP clients for backend services
│   │   ├── auth.ts
│   │   ├── team.ts
│   │   ├── task.ts
│   │   └── http.ts
│   ├── layouts/            # Shared layout wrappers
│   │   ├── AppLayout.tsx
│   │   └── AuthLayout.tsx
│   ├── pages/              # Page-level components
│   │   ├── LoginPage.tsx
│   │   ├── RegisterPage.tsx
│   │   ├── WelcomePage.tsx
│   │   ├── tasks/
│   │   │   ├── TasksPage.tsx
│   │   │   ├── DetailedTaskPage.tsx
│   │   │   └── CompletedPage.tsx
│   │   ├── teams/
│   │   │   ├── TeamsPage.tsx
│   │   │   ├── CreateTeamPage.tsx
│   │   │   ├── TeamTasksPage.tsx
│   │   │   └── TeamsDetailedPage.tsx
│   │   └── admin/
│   │       ├── UsersAdminPage.tsx
│   │       ├── TeamsAdminPage.tsx
│   │       └── TeamAdminDetailPage.tsx
│   ├── realtime/           # WebSocket logic
│   │   ├── ws.ts
│   │   ├── useRealtime.ts
│   │   └── RealtimeRoot.tsx
│   ├── routes/             # Auth guards
│   │   ├── RequireAuth.tsx
│   │   └── RequireAdmin.tsx
│   ├── App.tsx             # Router and app root
│   └── main.tsx            # Entry point
├── package.json
├── tsconfig.json
└── vite.config.ts

API Layer

http.ts

A thin wrapper around Axios.

import axios from "axios";

export const http = axios.create({
  baseURL: "/api",
  headers: { "Content-Type": "application/json" },
});

auth.ts

Handles authentication calls to /api/auth/*.


team.ts

Handles team management.


task.ts

Handles task CRUD.


Pages

1. Authentication

2. Teams

3. Tasks

4. Admin


Routing

The router is defined in App.tsx with React Router v6.

Auth guards:


Real-Time Updates

Implemented via WebSockets:


UI/UX Principles


Common Issues Encountered


Lessons Learned


Future Improvements

  1. Better Error Messages – expose validation errors from backend to help debugging.
  2. Consistent API – unify invite endpoints (username + ID).
  3. CI/CD Stability – pre-build TypeScript before Docker build to avoid surprises.
  4. Improved UI – add search, sorting, and filtering for tasks.
  5. Testing – unit tests for components, integration tests for API layer.

Conclusion

The frontend demonstrates a working multi-service React application that connects to several backend services via Nginx. Despite unresolved issues, the architecture is extensible and provides a clear separation of concerns.

The project highlights both the strengths of modern SPA development and the challenges of microservice integration under real-world constraints.

\newpage