A modern React application for tracking wasted time, built with Vite and featuring a beautiful, responsive UI.
This is the frontend component of the Your Lost Time project—a minimalist web application that helps users track and visualize the time they've lost or wasted. The React frontend communicates with a Flask backend API to persist user data and manage authentication.
- User Authentication: Simple registration and persistent 7-day sessions via cookies
- Time Tracking Dashboard:
- Submit time lost entries in minutes
- View accumulated lost time in hours and minutes
- Real-time counter display
- Responsive Design:
- Desktop and mobile layouts (separate CSS and HTML files)
- Random background images for visual variety
- Smooth animations and transitions
- User Feedback: Flash message system with progress bar notifications
- Modern Tech Stack:
- React 19 with hooks
- Vite build tool for fast development
- ESLint for code quality
- dotenv for environment configuration
react/
├── public/ # Static assets (images, fonts)
├── src/
│ ├── components/ # React components
│ │ ├── Flashes.jsx # Flash message notifications
│ │ ├── LandH1.jsx # Landing page header
│ │ ├── LossesBook.jsx # Time entries log
│ │ ├── LostTimeForm.jsx # Form to submit time lost
│ │ ├── PopupRegister.jsx # Registration modal
│ │ └── TimeLostCounter.jsx # Time counter display
│ ├── App.jsx # Main app component
│ ├── BackendURLContext.js # Backend URL context provider
│ ├── UserContext.js # User data context
│ ├── cookies.js # Cookie management utilities
│ ├── fetchData.js # API client utilities
│ ├── main.jsx # React entry point
│ └── index.css # Global styles
├── eslint.config.js # ESLint configuration
├── index.html # HTML template
├── package.json # Dependencies and scripts
└── vite.config.js # Vite configuration
- Node.js (v18 or higher)
- npm or yarn
- Backend API running (see ../back directory)
- Navigate to the react directory:
cd react- Install dependencies:
npm install- Create a
.envfile in thereact/directory with the backend URL:
VITE_BACKEND_URL=http://localhost:5000
Start the development server:
npm run devThe application will be available at http://localhost:5173 (or another port if 5173 is in use).
Build the application:
npm run buildPreview the production build:
npm run previewLint the code:
npm run lintESLint is configured to check for React best practices and code style issues.
The frontend communicates with the Flask backend at the URL specified in the .env file. Key endpoints used:
POST /get/user_data- Fetch user's time tracking dataPOST /add/lost_time- Submit new time lost entryPOST /auth/register- Register or login the user (will create if no such username is in the database)
- App.jsx: Main component managing app state and routing
- TimeLostCounter: Displays total accumulated lost time
- LostTimeForm: Form input for submitting new time entries
- LossesBook: Table/list view of all time entries
- Flashes: Toast notification system for user feedback
- PopupRegister: Modal for user registration
- LandH1: Landing page header component
The website can absolutely be used with desktop and mobile. It's up to you.
- React 19 - UI library
- Vite 7 - Build tool and dev server
- ESLint - Code linting
- dotenv - Environment variable management
See the main project LICENSE file.
For issues or improvements, please refer to the main project documentation. (to be honest i don't know what did the ai mean by main project documentation. Yes, the ai wrote readme)