A multi-user, visually appealing focus timer web app (Pomodoro style), featuring Google OAuth login, per-user cloud data storage with Supabase, integrated task management, and session statistics dashboards.
- Google OAuth login via Supabase Auth
- Secure user authentication
- Per-user data isolation with Row Level Security (RLS)
- Pomodoro-style countdown (default 25 min focus/5 min break)
- Adjustable durations for work and break sessions
- Large, clear timer display with progress visualization
- Start, pause, reset controls
- Visual and sound feedback on session completion
- Automatic session logging
- Add, edit, mark done, and remove tasks
- Task list associated with logged-in user
- Persistent storage in Supabase
- Task filtering (all/active/completed)
- Task association with focus sessions
- Automatic session logging on completion
- Statistics dashboard with:
- Daily/weekly/monthly session counts
- Interactive charts and visualizations
- Streak tracking (current and longest)
- Task completion statistics
- Record highs (most sessions per day/week/month)
- Modern, clean interface
- Light/dark theme support (via Streamlit config)
- Responsive design (works on desktop, tablet, mobile)
- Celebratory effects for milestones
- Smooth animations and transitions
- Frontend/UI: Streamlit (Python)
- Authentication: Supabase Auth (Google provider)
- Backend/Database: Supabase (PostgreSQL with Row Level Security)
- Visualization: Plotly
- Data Storage: Supabase tables (tasks, sessions)
- Python 3.8 or higher
- A Supabase account and project
- Google OAuth credentials configured in Supabase
git clone <repository-url>
cd FocusTimerpip install -r requirements.txt-
Create a new Supabase project at supabase.com
-
Enable Google OAuth in Supabase Dashboard:
- Go to Authentication > Providers
- Enable Google provider
- Add your Google OAuth credentials (Client ID and Client Secret)
- Set redirect URL to your app URL (e.g.,
http://localhost:8501for local development)
-
Run the database schema:
- Go to SQL Editor in Supabase Dashboard
- Copy and paste the contents of
sql/schema.sql - Execute the script to create tables and RLS policies
-
Get your Supabase credentials:
- Go to Project Settings > API
- Copy your Project URL and anon/public key
Create a .env file in the project root (you can copy from .env.example):
SUPABASE_URL=your_supabase_project_url
SUPABASE_KEY=your_supabase_anon_key
REDIRECT_URL=http://localhost:8501Note: For production deployment, update REDIRECT_URL to your production URL.
streamlit run app.pyThe app will open in your browser at http://localhost:8501.
The application uses three main tables:
id(UUID, Primary Key)user_id(UUID, Foreign Key to auth.users)text(TEXT)done(BOOLEAN)created_at(TIMESTAMP)completed_at(TIMESTAMP, nullable)
id(UUID, Primary Key)user_id(UUID, Foreign Key to auth.users)session_type(TEXT: 'focus' or 'break')duration(INTEGER, seconds)timestamp(TIMESTAMP)task_id(UUID, Foreign Key to tasks, nullable)
All tables have RLS enabled, ensuring users can only access their own data. Policies are automatically enforced by Supabase.
FocusTimer/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables template
βββ .streamlit/
β βββ config.toml # Streamlit configuration
βββ src/
β βββ __init__.py
β βββ auth.py # Supabase authentication logic
β βββ database.py # Database operations (tasks, sessions)
β βββ timer.py # Pomodoro timer logic
β βββ analytics.py # Statistics and chart generation
β βββ utils.py # Helper functions (audio, animations)
βββ sql/
β βββ schema.sql # Database schema and RLS policies
βββ README.md # This file
- Launch the app
- Click "Sign in with Google"
- Complete Google OAuth authentication
- You'll be redirected back to the app, now logged in
- Go to the Timer tab
- Adjust work/break durations in the sidebar (optional)
- Select a task to work on (optional)
- Click Start to begin a focus session
- The timer will count down with visual progress
- When the session completes, it's automatically logged
- Switch to break mode or start another focus session
- Go to the Tasks tab
- Add new tasks using the form at the top
- Check off tasks when completed
- Delete tasks you no longer need
- Filter tasks by status (All/Active/Completed)
- Go to the Statistics tab
- Select a time period (Day/Week/Month)
- View:
- Session counts and focus time
- Interactive charts
- Streak information
- Task completion rates
- Record highs
- Push your code to GitHub
- Go to share.streamlit.io
- Connect your GitHub repository
- Add environment variables in the Streamlit Cloud settings:
SUPABASE_URLSUPABASE_KEYREDIRECT_URL(your Streamlit Cloud app URL)
- Deploy!
The app can be deployed on any platform that supports Streamlit:
- Heroku
- AWS
- Google Cloud Platform
- Azure
- Docker containers
Make sure to:
- Set environment variables
- Update
REDIRECT_URLin Supabase OAuth settings - Ensure your database schema is set up
-
Problem: "Error initiating OAuth"
- Solution: Verify Google OAuth is enabled in Supabase and credentials are correct
- Check that redirect URL matches your app URL
-
Problem: User not authenticated after login
- Solution: Check browser console for errors
- Verify Supabase URL and key are correct in
.env
-
Problem: "Permission denied" errors
- Solution: Verify RLS policies are set up correctly
- Check that
sql/schema.sqlwas executed completely
-
Problem: Tables not found
- Solution: Run
sql/schema.sqlin Supabase SQL Editor
- Solution: Run
- Problem: Timer not updating automatically
- Solution: The timer updates on page refresh. For continuous updates, interact with the page or wait for automatic refresh when running.
- All database access is protected by Row Level Security (RLS)
- User authentication is handled securely by Supabase
- Never commit
.envfile to version control - Use environment variables for all sensitive data
Potential features for future versions:
- Custom Pomodoro workflows (long/short breaks)
- Task syncing with Google Tasks
- Push/browser notifications for session end
- Data export (CSV)
- Leaderboard for friendly competition
- Custom themes and personalization
This project is open source and available under the MIT License.
For issues, questions, or contributions, please open an issue on the repository.
Happy Focusing! π β¨