A full-stack productivity application built with SvelteKit that allows users to manage tasks, track time with a real-time timer, and view daily productivity summaries.
Pending, In Progress, Completed), and delete taskstask-tracker-app/ โโโ src/ โ โโโ routes/ โ โ โโโ api/ โ โ โ โโโ auth/ โ โ โ โ โโโ login/+server.ts โ โ โ โ โโโ logout/+server.ts โ โ โ โ โโโ signup/+server.ts โ โ โ โโโ tasks/ โ โ โ โ โโโ +server.ts โ โ โ โ โโโ [id]/ โ โ โ โ โโโ +server.ts โ โ โ โโโ time-logs/ โ โ โ โโโ +server.ts โ โ โ โโโ [id]/ โ โ โ โโโ +server.ts โ โ โโโ dashboard/ โ โ โ โโโ +page.svelte โ โ โโโ login/ โ โ โ โโโ +page.svelte โ โ โโโ signup/ โ โ โ โโโ +page.svelte โ โ โโโ +page.svelte โ โโโ lib/ โ โ โโโ mockdb.ts โ โ โโโ auth.ts โ โ โโโ stores.ts โ โโโ app.html โโโ static/ โโโ package.json โโโ svelte.config.js โโโ vite.config.ts โโโ README.md ๐ Tech Stack
๐ Live Demo
# Clone the repository
git clone https://github.com/your-username/task-tracker-app.git
cd task-tracker-app
# Install dependencies
npm install
# Start development server
npm run dev
The application runs on `http://localhost:5173` by default.
๐งช Test Credentials
-------------------
For quick testing, use these credentials:
- Email: `[email protected]`
- Password: `password123`
> Note: Since this uses an in-memory database, all data resets when the server restarts. This is acceptable for demonstration purposes.
๐ Authentication Flow
----------------------
1. Signup: Users can create an account with email and password
2. Login: Users authenticate with credentials and receive a session cookie
3. Session Management: All protected routes validate the session cookie
4. Logout: Session is destroyed and user is redirected to login page
All authentication is handled server-side with proper validation and error handling.
๐ Task & Time Tracking
-----------------------
### Task Management
- Create tasks with title and description
- Update task status between three states:
- `Pending` (default state)
- `In Progress` (when timer is active)
- `Completed` (when task is finished)
- Delete tasks (removes associated time logs)
### Time Tracking
- Start Timer: Begins tracking time for a task and sets status to "In Progress"
- Stop Timer: Saves time log to database and automatically marks task as "Completed"
- Real-time Display: Timer updates every second with live elapsed time
- Persistence: Time logs are stored and displayed in daily summaries
### Daily Summary
The dashboard displays real-time metrics:
- Today's Time: Total time tracked today (including active timer)
- Completed Today: Number of tasks completed today
- In Progress: Tasks currently being worked on
- Pending: Tasks waiting to be started
All metrics update automatically when tasks or time logs change.
๐๏ธ Mock Database Implementation
--------------------------------
The application uses a mock in-memory database stored in `src/lib/mockdb.ts`:
ts
export const db = {
users: [...],
tasks: [...],
timeLogs: [...],
sessions: {}
};
This approach:
- โ
Eliminates need for external database setup
- โ
Keeps the assignment self-contained
- โ
Demonstrates full CRUD functionality
- โ ๏ธ Note: Data resets when server restarts (expected behavior for demo)
๐จ UI/UX Design
---------------
The application features a modern, professional design with:
- Gradient Headers: Beautiful color transitions for visual appeal
- Glassmorphism Cards: Semi-transparent backgrounds with blur effect
- Status Indicators: Color-coded dots and badges for task status
- Responsive Layout: Works on mobile, tablet, and desktop
- Interactive Elements: Hover effects, smooth transitions, and feedback
- Real-time Updates: All data updates instantly without page refresh
๐งช API Endpoints
----------------
### Authentication
- `POST /api/auth/signup` - Create new user account
- `POST /api/auth/login` - Authenticate user and create session
- `POST /api/auth/logout` - Destroy user session
### Tasks
- `GET /api/tasks` - Get all user tasks
- `POST /api/tasks` - Create new task
- `PATCH /api/tasks/:id` - Update task status
- `DELETE /api/tasks/:id` - Delete task and associated time logs
### Time Logs
- `GET /api/time-logs` - Get all user time logs
- `POST /api/time-logs` - Create new time log entry
All endpoints include:
- โ
User authorization checks
- โ
Input validation
- โ
Proper HTTP status codes
- โ
Error handling
๐ Deployment
-------------
Deployed on Vercel with the following configuration:
- Build Command: `npm run build`
- Publish Directory: `build/`
- Environment: Production-ready SvelteKit app
The application is fully functional in production with the same mock database behavior.
๐ค Contributing
---------------
This is a solo assignment project. No external contributions are expected.
๐ License
----------
This project is for educational and demonstration purposes only.
* * * * *
Built with โค๏ธ using SvelteKit