React + Vite + Supabase authentication layer for the ReproLab reproducibility scoring backend.
- Node.js 18+
- Supabase account (free tier available at supabase.com)
-
Install dependencies:
npm install
-
Configure Supabase:
- Copy
.env.exampleto.env.local - Add your Supabase project URL and anon key
- Create auth users in Supabase dashboard
- Copy
-
Start development server:
npm run dev
- Frontend runs on http://localhost:5173
- API proxy forwards
/api/*to http://localhost:8000
npm run build
npm run previewfrontend/
├── src/
│ ├── components/ # React components
│ │ └── ProtocolEditor.jsx # Main editing interface
│ ├── pages/ # Page components
│ │ ├── LoginPage.jsx
│ │ ├── DashboardPage.jsx
│ │ └── ProtocolEditorPage.jsx
│ ├── lib/ # Utilities
│ │ └── supabase.js # Supabase client
│ ├── services/ # API clients
│ │ └── apiClient.js # Axios HTTP client
│ ├── store/ # State management
│ │ └── authStore.js # Zustand auth state
│ ├── App.jsx # Main app component
│ └── main.jsx # Entry point
├── package.json
├── vite.config.js
└── index.html
- Authentication: Supabase email/password auth with session management
- Protocol Editor: Live form editing with real-time reproducibility scoring
- Dashboard: Browse and manage protocols with score visualization
- Live Scoring: Debounced scoring updates as user edits (0-100 scale)
- Responsive Design: Mobile-friendly UI with gradient theme
| Variable | Purpose | Example |
|---|---|---|
VITE_SUPABASE_URL |
Supabase project URL | https://xyz.supabase.co |
VITE_SUPABASE_ANON_KEY |
Supabase anon key | eyJhbGc... |
VITE_API_URL |
Backend API URL | http://localhost:8000 |
- Create component in
src/pages/ - Add route in
App.jsx - Use
useAuthStore()for auth state - Use
protocolAPIfor backend calls
- Create component in
src/components/ - Import and use in pages
- Add corresponding CSS file
All API calls go through apiClient.js with /api prefix:
- Development: proxied to
http://localhost:8000 - Production: set
VITE_API_URLto production backend
npm run lintFrontend can be deployed to Vercel, Netlify, or any static host:
npm run build
# Output in dist/ directoryConfigure VITE_API_URL environment variable to point to production backend.