Skip to content

Siddhant2713/DAYOS.V1

Repository files navigation

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.


🚀 Running the project locally

Follow these steps to get the project up and running on your machine.

1) Prerequisites

  • Node.js v18+ and npm (or Yarn/pnpm). Confirm with node -v and npm -v.
  • (Optional) Supabase account or Supabase CLI if you want to run a local Postgres instance.

2) Clone & install

# clone the repo
git clone <repo-url> dayos-v1
cd dayos-v1

# install dependencies
npm install

3) Environment variables

This project reads config from Vite env vars prefixed with VITE_. Create a local env file .env.local (do NOT commit it) and add:

VITE_SUPABASE_URL=<your-supabase-url>
VITE_SUPABASE_ANON_KEY=<your-supabase-anon-key>
VITE_GOOGLE_CLIENT_ID=<your-google-oauth-client-id>

Notes:

  • Example values already exist in .env for development, but you should replace them with your own keys for production or private development.
  • Keep secrets out of source control (add .env.local to .gitignore).

4) Supabase / Database setup

This project uses Supabase (Postgres). To initialize the DB schema:

  • Create a Supabase project (https://app.supabase.com/).
  • Open the SQL Editor in the Supabase dashboard and run the SQL files in the database/ folder in order:
    1. database/schema.sql
    2. database/calendar_accounts_migration.sql
    3. database/focus_sessions_migration.sql

Alternatively, if you use psql or the Supabase CLI, run:

psql "postgresql://<user>:<pass>@<host>:<port>/<db>" -f database/schema.sql
# then run the other migration files

5) Google OAuth setup

  • In the Google Cloud Console, create OAuth 2.0 credentials (OAuth Client ID).
  • Set the Authorized JavaScript origins to http://localhost:5173 (Vite default) and add any production domains.
  • Copy the client ID into VITE_GOOGLE_CLIENT_ID.

6) Run the dev server

npm run dev
# open: http://localhost:5173

7) Build & Preview

# build for production
npm run build

# preview the production build locally
npm run preview

8) Linting

npm run lint

⚠️ Troubleshooting

  • If the app shows authentication or DB errors, verify VITE_SUPABASE_* env vars are correct and the SQL schema was applied.
  • If Google login fails, double-check the OAuth client setup and authorized origins.
  • Dev server default port is 5173. If already in use, Vite will prompt to use another.

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors