A Progressive Web App (PWA) for healthy habits while working at your computer. Take care of your posture and well-being while working, without pain.
The app is deployed on GitHub Pages: View Live
This project is built with:
- Vite - Build tool and dev server
- React 18 - UI library
- TypeScript - Type safety
- React Router - Client-side routing
- shadcn/ui - UI component library
- Tailwind CSS - Styling
- Vite PWA Plugin - Progressive Web App support
- Supabase - Authentication and backend services
- Node.js 20+ (recommended: use nvm)
- npm or bun
- Supabase project (for authentication)
Create a .env.local file in the root directory with the following variables:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_keyHow to get these values:
- Go to Supabase Dashboard
- Select your project (or create a new one)
- Go to Settings → API
- Copy the following:
- "Project URL" → Use for
VITE_SUPABASE_URL - "anon public" key → Use for
VITE_SUPABASE_ANON_KEY
- "Project URL" → Use for
Important: Never commit .env.local to version control. It's already in .gitignore.
Before using authentication, configure the following in your Supabase project:
- Go to Authentication → Providers
- Ensure Email provider is enabled
- Configure email templates if needed
For Local Development (Optional):
- To disable email confirmation for faster testing:
- Go to Authentication → Settings
- Under Email Auth, toggle "Enable email confirmations" to OFF
- This allows users to sign up and use the app immediately without email verification
- Note: Keep this enabled for production for security
- Go to Authentication → Providers
- Enable Google provider
- Click Configure and add:
- Client ID (from Google Cloud Console)
- Client Secret (from Google Cloud Console)
- Important: The redirect URL in Google Cloud Console must match:
- For local dev:
http://localhost:5173/auth/callback - For production:
https://federicosecchi.github.io/calm-desk-companion/auth/callback
- For local dev:
- Go to Authentication → URL Configuration
- Add to Redirect URLs (one per line):
http://localhost:5173/auth/callback https://federicosecchi.github.io/calm-desk-companion/auth/callback - Site URL should be set to your production URL:
https://federicosecchi.github.io/calm-desk-companion
The app expects a profiles table with the following structure. Run this SQL in your Supabase SQL Editor:
-- Create profiles table
CREATE TABLE IF NOT EXISTS profiles (
id UUID REFERENCES auth.users(id) ON DELETE CASCADE PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE DEFAULT TIMEZONE('utc'::text, NOW()) NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT TIMEZONE('utc'::text, NOW()) NOT NULL
);
-- Enable Row Level Security
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;
-- Drop existing policies if they exist (for idempotency)
DROP POLICY IF EXISTS "Users can read own profile" ON profiles;
DROP POLICY IF EXISTS "Users can insert own profile" ON profiles;
DROP POLICY IF EXISTS "Users can update own profile" ON profiles;
-- Policy: Users can read their own profile
CREATE POLICY "Users can read own profile"
ON profiles FOR SELECT
USING (auth.uid() = id);
-- Policy: Users can insert their own profile
CREATE POLICY "Users can insert own profile"
ON profiles FOR INSERT
WITH CHECK (auth.uid() = id);
-- Policy: Users can update their own profile
CREATE POLICY "Users can update own profile"
ON profiles FOR UPDATE
USING (auth.uid() = id);Important Notes:
- The
idcolumn referencesauth.users(id)- this is automatically set by Supabase - The app will automatically create a profile row when a user signs in for the first time
- RLS policies ensure users can only access their own profile
- The
ON DELETE CASCADEensures profiles are deleted when users are deleted
# Clone the repository
git clone https://github.com/FedericoSecchi/calm-desk-companion.git
# Navigate to the project directory
cd calm-desk-companion
# Install dependencies
npm install
# Create .env.local file with your Supabase credentials
# (See Environment Variables section above)
# Start the development server
npm run devThe app will be available at http://localhost:5173
# Build for production
npm run build
# Preview production build locally
npm run preview- Installable - Can be installed on desktop and mobile devices
- Offline Support - Service worker caches assets for offline use
- App-like Experience - Standalone display mode
This project is automatically deployed to GitHub Pages via GitHub Actions when changes are pushed to the main branch.
- Build the project:
npm run build - The
distfolder contains the production-ready files - GitHub Actions will automatically deploy on push to
main
- Go to repository Settings > Pages
- Source should be set to "GitHub Actions"
- The workflow will automatically deploy on each push to
main
calm-desk-companion/
├── public/ # Static assets
├── src/
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── layouts/ # Layout components
│ ├── hooks/ # Custom React hooks
│ └── lib/ # Utilities
└── dist/ # Build output (generated)
This project is private and proprietary.