Here's what's happening with your API510 account today
âī¸
Supabase Status
Checking...
Loading library...
đ
Database
Not Connected
Configure below
đĨ
Total Users
0
Registered users
â
Active Sections
0
Visible to users
đ
Total Sections
0
Exam categories
â
Total Questions
0
Question bank
Quick Actions
Manage your exam platform
â ī¸ Row Level Security (RLS) Error Detected
Your database has Row Level Security enabled, which is blocking operations.
To fix this, run the following SQL in your Supabase SQL Editor:
ALTER TABLE api510_users DISABLE ROW LEVEL SECURITY; ALTER TABLE api510_sections DISABLE ROW LEVEL SECURITY; ALTER TABLE api510_questions DISABLE ROW LEVEL SECURITY; ALTER TABLE api510_notifications DISABLE ROW LEVEL SECURITY; ALTER TABLE api510_user_progress DISABLE ROW LEVEL SECURITY;
Then refresh this page and try again.
User Management
Manage user accounts and subscriptions
Total Users
0
All registered users
Active
0
Paid subscriptions
Trial
0
Free trial users
Users
NAME
EMAIL
APP NAME
REGISTER DATE
SUBSCRIPTION START
SUBSCRIPTION END
STATUS
ACTIONS
No users found
Notifications
Send system-wide notifications to all users
Send New Notification
Notification History
MESSAGE
SENT BY
SENT AT
ACTIONS
No notifications found
Sections
Manage exam sections and categories
Sections
SEQUENCE
SECTION NAME
SECTION TAG
DESCRIPTION
TOTAL MINUTES
ISEXAM
ISACTIVE
DELETE
No sections found
đ Bulk Upload Sections
Upload an Excel file (.xlsx) to create multiple sections at once. Required columns: Sequence, Name, Tag, Description, TotalMinutes, ExamMode, IsActive
Upload Progress:
Ready to upload...
âī¸ Add Single Section Manually
Questions Management
Add and manage exam questions
Questions List
records
SECTION
QUESTION
A
B
C
D
ANS
SOLUTION
OPEN
CLOSE
ACTIVE
ACTION
No questions found
đ Upload Questions from Excel File
Upload an Excel file (.xlsx) with the following columns: Qtag, Question, OptA, OptB, OptC, OptD, Ans, Solution, IsOpen, IsClose, IsActive
Upload Progress:
Ready to upload...
âī¸ Add Single Question Manually
Settings
Configure your Supabase backend connection and authentication
Supabase Configuration
Example: http://192.168.1.100:8000 (use port 8000, not 54321)
Find this in Supabase Studio â Settings â API â anon public key
Connection Status
Library Status:Checking...
Database Status:Not Connected
Supabase URL:Not Set
đĄ
First Time Setup Guide
Make sure Supabase is running: docker ps
Get your server IP address
Open Supabase Studio: http://YOUR_IP:54321
Go to Settings â API â Copy "anon public" key
Enter URL as: http://YOUR_IP:8000 (port 8000)
Paste the anon key
Click "Save Configuration" then "Test Connection"
đ Authentication Testing
Test user account operations: Create Account, Login, OTP Verification, and Password Reset
â ī¸ Database Setup Required
For user registration to work, ensure your api510_users table has:
An id column of type UUID that matches the auth user ID
An email_confirmed column of type BOOLEAN (default false) to track email verification
RLS should be disabled for testing. The signup function will automatically create records in both Supabase Auth and your database.
Create User Account
âšī¸ How it works:
This creates the user in both places:
1. Supabase Auth (auth.users) - for authentication
2. Your database (api510_users) - for app data
Test User Login
OTP Verification
Password Reset
Update Password (After Reset Link)
âī¸ OTP Email Customization
Customize the email content sent to users for both OTP verification and account activation. This unified template will be used for all authentication emails.
This subject will be used for all verification emails
The user's name will be automatically added if available
Initial welcome message shown to all users
Instructions shown before the OTP code and activation link
đĸ OTP Code Section
When enabled, a 6-digit OTP code will be displayed in the email
đ Activation Link Section
When enabled, a clickable activation button/link will be displayed
Additional Options
Email Preview
Current Session
No active session
đą Frontend Integration Guide
Complete guide and code snippets for integrating authentication into your frontend application
import { createClient } from '@supabase/supabase-js'
// Replace with your Supabase URL and Anon Key
const supabaseUrl = 'http://YOUR_IP:8000'
const supabaseAnonKey = 'YOUR_ANON_KEY'
const supabase = createClient(supabaseUrl, supabaseAnonKey)
// Export for use in other files
export default supabase
â ī¸ Important Configuration
Get your credentials from Supabase Studio:
Open Supabase Studio at http://YOUR_IP:54321
Go to Settings â API
Copy the URL (use port 8000, not 54321)
Copy the anon public key
2. Create Account (Sign Up)
âšī¸ What this does:
Creates a user in Supabase Auth and automatically adds them to your api510_users table with default values.
Complete Sign Up Function
async function signUp(email, password, fullName) {
try {
// Step 1: Create auth user
const { data: authData, error: authError } = await supabase.auth.signUp({
email: email,
password: password,
options: {
data: {
full_name: fullName
}
}
})
if (authError) throw authError
// Step 2: Add user to database
const { data: dbData, error: dbError } = await supabase
.from('api510_users')
.insert([{
id: authData.user.id, // Match auth user ID
name: fullName || email.split('@')[0],
email: email,
app_name: 'API 510 Helpmate',
email_confirmed: false,
status: 'Trial',
register_date: new Date().toISOString().split('T')[0]
}])
.select()
if (dbError) throw dbError
console.log('â User created successfully!', authData.user)
alert('Account created! Please check your email for verification.')
return { success: true, user: authData.user }
} catch (error) {
console.error('â Sign up error:', error.message)
alert('Error: ' + error.message)
return { success: false, error: error.message }
}
}
// Usage Example:
// signUp('[email protected]', 'password123', 'John Doe')
Step 1: User requests password reset (sends reset link to email) Step 2: User clicks link in email (redirects to your reset page) Step 3: User enters new password on reset page
async function getCurrentSession() {
const { data: { session }, error } = await supabase.auth.getSession()
if (error) {
console.error('Session error:', error)
return null
}
if (session) {
console.log('â Active session:', session.user.email)
return session
} else {
console.log('â No active session')
return null
}
}
// Usage Example:
// const session = await getCurrentSession()
Get Current User
async function getCurrentUser() {
const { data: { user }, error } = await supabase.auth.getUser()
if (error) {
console.error('Get user error:', error)
return null
}
if (user) {
// Get additional user data from database
const { data: userData } = await supabase
.from('api510_users')
.select('*')
.eq('id', user.id)
.single()
return { authUser: user, dbUser: userData }
}
return null
}
// Usage Example:
// const currentUser = await getCurrentUser()
// console.log(currentUser.dbUser.name)
Protected Route Example
// Check authentication on page load
async function checkAuth() {
const session = await getCurrentSession()
if (!session) {
// Not logged in - redirect to login page
alert('Please log in to access this page')
window.location.href = '/login.html'
return false
}
// User is authenticated
const user = await getCurrentUser()
console.log('Authenticated user:', user.dbUser.name)
// Display user info on page
document.getElementById('user-name').textContent = user.dbUser.name
return true
}
// Call on protected pages
window.addEventListener('DOMContentLoaded', () => {
checkAuth()
})
Listen to Auth State Changes
// Set up auth state listener
supabase.auth.onAuthStateChange((event, session) => {
console.log('Auth event:', event)
if (event === 'SIGNED_IN') {
console.log('â User signed in:', session.user.email)
// Update UI, redirect, etc.
}
if (event === 'SIGNED_OUT') {
console.log('â User signed out')
// Clear UI, redirect to login, etc.
window.location.href = '/login.html'
}
if (event === 'TOKEN_REFRESHED') {
console.log('đ Token refreshed')
}
if (event === 'PASSWORD_RECOVERY') {
console.log('đ Password recovery')
}
})
// This listener will automatically handle session refresh
â Quick Reference
Common Supabase Auth Methods:
supabase.auth.signUp() - Create new account
supabase.auth.signInWithPassword() - Login with email/password