This repository contains a Flask-based web application designed to help you manage your work hours with built-in diary functionality. The app tracks check‑in/check‑out times, calculates daily and weekly flex time (based on an 8‑hour workday), and lets you log diary entries—including an “active” diary mode for ongoing activities. In addition, it supports user authentication and an admin dashboard for managing users.
-
Time Tracking:
- Check in/out for work sessions.
- Add past entries and edit existing ones.
- Automatic calculation of flex time: each day is compared against an 8‑hour (480‑minute) baseline, and the weekly flex is the sum of daily differences.
-
Diary Functionality:
- Log diary entries for each work session.
- Active Diary Mode: Activate an activity (e.g. “Coding”) which stays active until you deactivate it or check out.
- Diary entries are grouped by day, with a collapsible view to show details for each day.
- Generate reports that break down diary entries and work hours by week and by month.
-
User Authentication:
- Register, log in, and log out.
- Each user’s data (time logs and diary entries) is isolated.
- The logged‑in user’s name is displayed at the top of the dashboard.
-
Admin Dashboard:
- An admin account is automatically created if none exists (username:
admin, password:Inova20!0). - Admin users are automatically redirected to the admin dashboard upon login.
- Admins can view all registered users, reset user passwords, and delete users.
- An admin account is automatically created if none exists (username:
-
Clone the Repository:
git clone https://github.com/yourusername/time-manager.git cd time-manager -
Set Up a Virtual Environment:
python -m venv venv # On Linux/Mac: source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
Note: The
requirements.txtfile should list dependencies such as Flask and Werkzeug. -
Initialize/Reset the Database (if needed):
If you’re running the app for the first time or need to update the schema, delete the existing
time_manager.dbfile or use the/reset_dbroute (visithttp://127.0.0.1:5000/reset_dbafter starting the app).
-
Start the Application:
python app.py
-
Access the App:
Open your browser and navigate to http://127.0.0.1:5000.
-
User Registration & Login:
- New users can register via the registration page.
- For admin access, log in with:
- Username:
admin - Password:
Inova20!0
- Username:
- Admin users are automatically redirected to the admin dashboard.
-
Managing Your Time:
- Use the check‑in/out button to start or end a work session.
- Add past entries manually if needed.
- Your work sessions are compared against an 8‑hour baseline to calculate daily and weekly flex time.
-
Diary Functionality:
- On the main dashboard, an active diary section lets you “Activate” an activity (e.g., “Coding”). When active, your activity is displayed along with its start time.
- Press the "Deactivate" button to finish the activity.
- Visit the
/diaryroute to see diary entries grouped by day. - The
/diary_reportroute provides a weekly and monthly breakdown of your diary entries and work hours.
-
Admin Dashboard:
- The
/adminroute displays a list of all users. - Admins can reset any user’s password or delete a user account (except their own).
- The
-
Secret Key:
- Update
app.secret_keyinapp.pywith a secure key before deploying to production.
- Update
-
Database:
- The application uses SQLite. The database file is named
time_manager.db.
- The application uses SQLite. The database file is named
- Enhance the diary UI with JavaScript for smooth collapsible/expandable day views.
- Add more detailed reporting and analytics.
- Improve error handling and validation.
This project is licensed under the MIT License. See the LICENSE file for details.