+
Skip to content

zephyn-dr/hari

Repository files navigation

ZENIX - Magic Link Authentication System

🌐 LIVE DEPLOYMENT

Active Links:

⚙️ CRITICAL SETUP - Netlify Environment Variables

Step 1: Get Your Supabase Credentials

  1. Go to your Supabase Dashboard: https://app.supabase.com
  2. Select your project
  3. Go to SettingsAPI
  4. Copy these two values:
    • Project URL (starts with https://...)
    • anon public key (starts with eyJ...)

Step 2: Add to Netlify

  1. Go to Netlify Dashboard: https://app.netlify.com
  2. Select your site: sage-capybara-288448
  3. Go to Site SettingsBuild & DeployEnvironment Variables
  4. Click Add Variable and add:
    VITE_SUPABASE_URL=https://your-project.supabase.co
    VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
    
  5. Save and trigger a new deploy

Step 3: Add Redirect URL to Supabase

  1. In Supabase DashboardAuthenticationURL Configuration
  2. Add to Redirect URLs:
    https://hari-sandy-pi.vercel.app/auth/callback
    https://hari-sandy-pi.vercel.app/dashboard
    https://hari-sandy-pi.vercel.app/**
    http://localhost:5173/auth/callback
    http://localhost:5173/dashboard
    http://localhost:5173/**
    

📧 Magic Link Email Configuration Setup

🔧 CRITICAL: Enable Magic Links and Disable Email OTP

Step 1: Configure Authentication Providers

  1. Go to Supabase DashboardAuthenticationProvidersEmail
  2. ❌ Disable "Email OTP" (this prevents 6-digit codes)
  3. ✅ Enable "Magic Links" (this sends clickable login links)
  4. Save changes

This ensures users only receive magic links, not OTP codes.


⚠️ IMPORTANT: Cloudflare Turnstile CAPTCHA is configured with site key: 0x4AAAAAABwZamBKxT6kBA4N

CAPTCHA Setup in Supabase:

  1. Go to Supabase DashboardSettingsAuthenticationBot and Abuse Protection
  2. Enable CAPTCHA protection
  3. Provider: Cloudflare Turnstile
  4. Site Key: 0x4AAAAAABwZamBKxT6kBA4N
  5. Secret Key: (Get from your Cloudflare Turnstile dashboard)

To enable Magic Link emails sent from "ZENIX" to user email addresses, you need to configure SMTP settings in your Supabase project.

Step 1: Configure SMTP in Supabase Dashboard

  1. Go to your Supabase Dashboard: https://app.supabase.com/project/[your-project-id]
  2. Navigate to AuthenticationSettingsSMTP Settings
  3. Enable Enable custom SMTP
  4. Fill in the following details:
Sender Name: ZENIX
Sender Email: noreply@yourdomain.com (or your preferred sender email)
Host: your-smtp-server.com
Port: 587 (or 465 for SSL)
Username: your-smtp-username
Password: your-smtp-password

Step 2: Popular SMTP Providers

Gmail SMTP:

  • Host: smtp.gmail.com
  • Port: 587
  • Username: your-gmail@gmail.com
  • Password: App-specific password (not your Gmail password)

SendGrid:

  • Host: smtp.sendgrid.net
  • Port: 587
  • Username: apikey
  • Password: Your SendGrid API key

Mailgun:

Step 3: Email Templates (Optional)

In Supabase Dashboard → Authentication → Email Templates, you can customize:

  • Magic Link template for login emails
  • Set subject line: "ZENIX - Click to Login"
  • Customize the email body with ZENIX branding

Step 4: Test the Setup

  1. Complete SMTP configuration
  2. Run the app: npm run dev
  3. Sign up a new user
  4. Try logging in - Magic Link should be sent from "ZENIX" to the user's email

✅ Current Features

  • Automatic database storage on signup
  • Email/Registration validation on login
  • SMTP Magic Link emails with ZENIX branding
  • Personalized emails with recipient's name
  • Role-based dashboards (Student/Staff/Admin)

🔧 Technical Stack

  • Frontend: React + TypeScript + Tailwind CSS
  • Backend: Supabase (PostgreSQL + Auth)
  • Email: Supabase Auth Magic Links with custom SMTP
  • Deployment: Vite + Netlify

Note: Without SMTP configuration, Magic Link emails will be sent from Supabase's default server. Configure custom SMTP to ensure emails are sent from "ZENIX" as requested.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载