Analyze text. Get trust scores. Make informed decisions.
A modern, full-stack web application that analyzes user-submitted text and provides trust credibility scores (0-100) using Google Gemini AI. Track submissions, view detailed analysis reports, and leverage AI-powered insights.
TrustLayer is an AI-powered platform designed to assess the trustworthiness of text submissions through intelligent analysis. Users can submit content (people profiles, company information, transaction details), receive real-time trust scores, and access detailed AI-generated explanations. Built with modern web technologies, it combines secure authentication, real-time data processing, and intuitive UI/UX.
Use Cases:
- Due diligence analysis
- Content credibility verification
- Fraud detection
- Risk assessment
✅ User Authentication — Secure email/password auth via Supabase
✅ AI Trust Scoring — Google Gemini 3 Flash (0-100 scale)
✅ Text Submission — Submit 10-5,000 character entries
✅ Detailed Results — Trust score + AI explanations + original text
✅ Submission History — Complete audit trail with filtering
✅ Dashboard — Stats overview and recent activity
✅ Risk Badges — Visual indicators (low/medium/high)
✅ Responsive Design — Mobile-first, light indigo theme
✅ Row-Level Security — User data isolation at DB level
✅ Lightning Fast — Vite builds, optimized bundle
| Layer | Technology | Version |
|---|---|---|
| Frontend | React | 18.2.0 |
| Language | TypeScript | 5.2.2 |
| Routing | TanStack Router | 1.168.7 |
| State | React Query | 5.28.0 |
| Styling | Tailwind CSS | 4.3.0 |
| UI Components | shadcn/ui | Latest |
| Build | Vite | 5.4.21 |
| Backend | Supabase | Latest |
| Database | PostgreSQL | (via Supabase) |
| AI Engine | Google Gemini 3 Flash | Latest |
| Icons | Lucide React | 0.376.0 |
| Notifications | Sonner | 1.3.1 |
Before you begin, ensure you have:
- Node.js 21.2.0+ (Download)
- npm or yarn (comes with Node)
- Git for version control
- Supabase Account (free tier: supabase.com)
- Google Gemini API Key (Get it)
git clone https://github.com/yourusername/trustlayer.git
cd trustlayer
npm install --legacy-peer-depsCreate .env.local in the project root:
# Supabase
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here
# Google Gemini
GEMINI_API_KEY=your-gemini-api-key-here
# Optional
NODE_ENV=development
VITE_API_URL=http://localhost:4000
⚠️ Never commit.env.local— Add to.gitignore
npm run devOpen http://localhost:4000 — Hot reload enabled
npm run buildOutputs to dist/ — Includes TypeScript type checking + Vite bundling
npm run lintUses ESLint with strict rules (max-warnings: 0)
npm run previewTest the production build locally at http://localhost:4000
trustlayer/
├── src/
│ ├── routes/ # TanStack Router pages (file-based)
│ │ ├── index.tsx # Landing page
│ │ ├── login.tsx # Auth (sign in/up)
│ │ ├── __root.tsx # Root layout + providers
│ │ ├── _authenticated.tsx # Protected routes layout
│ │ ├── results.$id.tsx # Result detail page
│ │ └── _authenticated/
│ │ ├── dashboard.tsx # Dashboard stats
│ │ ├── submit.tsx # Submission form
│ │ └── history.tsx # Submission history
│ │
│ ├── components/ # React components
│ │ ├── app-sidebar.tsx # Main navigation
│ │ ├── risk-badge.tsx # Status/risk indicators
│ │ └── ui/ # shadcn/ui components
│ │ ├── button.tsx
│ │ ├── card.tsx
│ │ ├── input.tsx
│ │ ├── dialog.tsx
│ │ └── ... (27 more)
│ │
│ ├── integrations/ # External service clients
│ │ └── supabase/
│ │ ├── client.ts # Supabase client
│ │ ├── auth-middleware.ts
│ │ └── types.ts
│ │
│ ├── hooks/ # Custom React hooks
│ │ ├── use-auth.tsx # Auth state
│ │ └── use-mobile.tsx # Responsive detection
│ │
│ ├── lib/ # Utilities
│ │ ├── analysis.functions.ts # AI analysis logic
│ │ ├── utils.ts # Helper functions
│ │ └── error-capture.ts # Error handling
│ │
│ ├── styles.css # Global styles + CSS variables
│ ├── start.ts # Entry point
│ └── server.ts # Express server config
│
├── supabase/ # Supabase local setup
│ ├── migrations/ # DB migrations
│ └── config.toml
│
├── public/ # Static assets
├── Dockerfile # Container image
├── docker-compose.yml # Local dev container
├── .env.local # Environment variables (git-ignored)
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── vite.config.ts # Vite config
├── eslint.config.js # ESLint rules
└── README.md # This file
- User signs up/logs in via email/password
- Supabase generates JWT token
- Token stored in localStorage
- Each API request includes token in
Authorizationheader - Supabase Row-Level Security (RLS) isolates user data
- User submits text (10-5000 chars) on
/submitpage - Frontend sends to backend via React Query mutation
- Backend validates input, calls Google Gemini API
- Gemini analyzes text, returns trust score (0-100)
- Result stored in Supabase PostgreSQL
- User redirected to
/results/{id}to view detailed report
- Every table has
user_idcolumn - Supabase RLS policies enforce
user_id = auth.uid() - Users can only access their own data
npm run build # Test locally
git push # Push to GitHubConnect GitHub repo to Vercel Dashboard → auto-deploys on push
Env vars in Vercel Dashboard:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEYGEMINI_API_KEY
docker build -t trustlayer .
docker run -p 4000:4000 \
-e VITE_SUPABASE_URL=... \
-e VITE_SUPABASE_ANON_KEY=... \
-e GEMINI_API_KEY=... \
trustlayer- Connect GitHub repo
- Set env vars in dashboard
- Deploy (auto-builds via Node buildpack)
npm run build
npm run preview # Or use `node dist/server.js` if Express serverUse PM2 or systemd to manage process
Found a bug? Create an issue on GitHub:
https://github.com/yourusername/trustlayer/issues
- Fork the repo
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open Pull Request
- 💬 Discussions: GitHub Discussions
- 📧 Email: alimiazeez400@gmail.com
Before deploying, ensure:
-
VITE_SUPABASE_URL— Your Supabase project URL -
VITE_SUPABASE_ANON_KEY— Supabase anon public key (safe to expose) -
GEMINI_API_KEY— Google AI API key (keep secret on backend) -
.env.localin.gitignore
- React Docs
- TypeScript Handbook
- Vite Guide
- TanStack Router
- Supabase Docs
- Google Gemini API
- Tailwind CSS
- shadcn/ui
MIT License — See LICENSE file
Built by [Alimi Azeez Opeyemi]
Acknowledgments:
- shadcn/ui for beautiful components
- Supabase for backend infrastructure
- Google for Gemini AI API
Happy coding! 🚀 For questions or feedback, open an issue or reach out directly.
- Google Gemini API key
Create .env.local in the root:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_key
VITE_GEMINI_API_KEY=your_gemini_api_key # ⚠️ Exposed in client - use Edge Function in productionnpm run dev # Start dev server on http://localhost:5173/
npm run build # Build for production
npm run lint # Run ESLint
npm run preview # Preview production buildMIT
For issues or questions, please open an issue on GitHub.