PS324: SUJEN AI CHATBOT

SUJENDRAN A/L RAJANDRAN DIGIT 360

SUJEN AI 6.0 – Private Admin Backend Prompt

Create a complete, secure backend and admin dashboard for SUJEN AI 6.0.

Admin Access

  • Create a hidden /admin route.

  • The admin page must never appear in the navigation menu.

  • Only my administrator account can access the dashboard after logging in.

  • All other users who try to access /admin must see an Access Denied (403) page.

  • Protect every admin page with server-side authorization.

  • Automatically redirect unauthorized users to the homepage.

Authentication

  • Use Supabase Authentication.

  • Support email and password login.

  • Store user roles securely.

  • Create roles:

    • Admin

    • User

  • Only the Admin role can access the backend.

Admin Dashboard

Display:

  • Total registered users

  • Active users

  • New users today

  • AI chatbot usage

  • AI image generation statistics

  • AI code assistant usage

  • AI presentation generation

  • Storage usage

  • Database status

  • Website status

  • API status

  • Error logs

User Management

Allow the admin to:

  • View all users

  • Search users

  • Edit user profiles

  • Delete users

  • Suspend or reactivate accounts

  • Reset user passwords

  • View login history

AI Management

Allow the admin to:

  • Enable or disable any AI feature

  • Manage AI models

  • Configure AI providers

  • Manage API keys securely on the server

  • View AI usage statistics

  • Set usage limits

Database Management

Allow the admin to:

  • View database tables

  • Export data

  • Import data

  • Create backups

  • Restore backups

  • Delete unnecessary records

Analytics

Show:

  • Daily visitors

  • Monthly visitors

  • Most-used AI tools

  • Chat statistics

  • Image generation statistics

  • User activity

  • Performance charts

File Management

Allow the admin to:

  • Upload files

  • Delete files

  • Manage images

  • Manage documents

  • View storage usage

Website Settings

Allow the admin to:

  • Change the website name

  • Change the logo

  • Update the homepage

  • Manage announcements

  • Manage contact information

  • Configure AI settings

Security

  • Keep all API keys and secrets on the server only.

  • Never expose secrets to the frontend.

  • Record all admin actions in an audit log.

  • Automatically log out inactive admin sessions.

  • Enable two-factor authentication (2FA).

  • Protect against unauthorized access.

Design

  • Use a modern, responsive interface with dark mode.

  • Create a professional dashboard with cards, charts, tables, and navigation.

  • Use React, TypeScript, Tailwind CSS, and Supabase.

Final Requirement

The backend must be completely private. Only my administrator account can access it. Normal users must never be able to see or use the admin dashboard. The backend should be secure, scalable, and suitable for a production AI platform.