Project Aegis is an end‑to‑end fact‑checking and media literacy platform.
It monitors rumours in real time, debunks them using AI + editorial logic, and then teaches users how to spot similar misinformation through curated educational modules.
The stack is:
- Frontend: React (Vite), React Router, Framer Motion, Tailwind‑style utilities
- Backend: FastAPI, MongoDB, Razorpay subscriptions, WebSockets
- Infra / Tooling: Axios, ESLint, Vite dev server
-
Authentication & Profiles
- Email + password signup/login.
- Signup captures: name, email, phone number, age, and domain preferences (Politics, Technology, Health, Crime, Military, Sports, Entertainment, Social Media only).
- User profile shows personal info, interests, subscription tier, and next renewal date.
-
Subscriptions & Billing
- Razorpay subscription integration (Pro / Enterprise vs Free).
- Subscriptions valid for one month; renewal handled via Razorpay subscription lifecycle.
- Subscription data stored in MongoDB, and each user has a
subscription_tier(Free / Pro / Enterprise). - Profile icon + profile page styling respond to tier with distinct colors:
- Free: grey
- Pro: ocean blue / cyan
- Enterprise: deep purple
-
Rumour Feed & Live Alerts
- Real‑time rumours/claims streamed via WebSocket from MongoDB change streams.
- Only verdicts False and Uncertain are displayed in the live alerts section.
- Each rumour shows: claim, mapped verdict, confidence percentage, and time‑ago.
- Clicking a rumour opens a rich Rumour Modal with:
- Claim, Verdict, Verified On
- Confidence percentage
- Long Body section with the reasoning
- Summary section with “Read more / Read less” handling for long text
- Original post link (using
post_content.headinglinked tofinal_source) - Even grid layout for Body/Summary and Verdict/Verified On
-
Chatbot Verification (Verify page)
- Chatbot view allows users to type multi‑line input, attach files, or record audio.
- Frontend preserves multi‑line formatting; backend endpoint
/chatbot/verifyhandles mixed text+files. - Uses an
InputProcessoron the backend to route to the right verification workflow.
-
Educational Modules
- Educational content is generated/stored in MongoDB (
weekly_posts.educational_module) and surfaced via:GET /educational/modules(summaries)GET /educational/modules/{module_id}(detailed module)
- Each module describes a misinformation technique (e.g., manipulation patterns), with:
- Overview & technique explanation
- Red flags
- Verification tips
- Related patterns & user action items
- Real‑world example (heading, claim, verdict, body, tags, source URL)
- Educational content is generated/stored in MongoDB (
-
Personalized Learning (“For You” modules)
- Each educational module has
tags(derived from postmetadata.tags). - The Modules page shows domain tags on the cards and in the module overview.
- Users can:
- Filter by text search (module title/description).
- Filter by domain tags (attractive pill‑style chips).
- Click “For You” to automatically filter modules based on their own
domain_preferencesfrom the profile.
- Each educational module has
-
1. Quick rumour check from social media
- User sees a viral post on X / Instagram and copies the text or link.
- Opens Verify → Chatbot, pastes the claim (multi‑line supported), optionally attaches a screenshot or video.
- The chatbot routes the request to the right verifier and responds with:
- Verdict (False / Uncertain / Mostly True, etc.)
- Reasoning
- Sources and confidence
- If the rumour is part of an existing debunk, it also appears in Live Alerts, with a modal for deep‑dive context.
-
2. Browsing live misinformation to stay ahead
- From any page, the user clicks the alerts icon in the navbar.
- Sees a live stream of only False and Uncertain posts, with confidence percentages.
- Clicks into a card → opens the Rumour Modal with:
- Clean, balanced layout (Claim / Verdict / Verified On / Confidence / Body / Summary).
- “Read more” where needed so long summaries remain readable.
- Direct link to the original post/source.
-
3. Setting up a learning profile
- On Signup, the user selects domains they care about (e.g. Politics + Technology + Health).
- These preferences:
- Shape the “For You” modules list.
- Are visible as tags in the Profile page for transparency.
-
4. Learning with educational modules
- User goes to Modules to understand patterns behind misinformation, not just individual cases.
- On the main Modules page they can:
- Use search to look for specific topics.
- Toggle domain tags to focus on subjects (e.g. “Elections”, “Health”, “Finance” if present in tags).
- Click For You to instantly filter to modules that match their saved domain preferences.
- Each module card shows:
- Title, description, estimated time, difficulty badges, and attractive domain tags.
- Inside a module detail view, the user sees:
- High‑level overview and tags at the top.
- Red flags, verification tips, real‑world example, and concrete “What you can do” actions.
-
5. Managing access and billing
- In the Profile page, the user can see:
- Whether they’re on Free / Pro / Enterprise (with a matching color theme).
- Renewal date and days remaining.
- Clicking Manage Subscription takes them to the subscription page:
- Free users can see what they get by upgrading.
- Pro/Enterprise users can manage billing via Razorpay (create/cancel subscription).
- In the Profile page, the user can see:
These flows are designed so a first‑time user can go from “I saw this claim, is it real?” to “I understand why this pattern of misinformation works and how to defend against it” in a few clicks.
Located under frontend/ (Vite + React).
Key pieces:
-
src/contexts/AuthContext.jsx- Manages
user,isAuthenticated,loading. - Provides
login,logout, andrefreshUser(calls/auth/me). - Pulls
subscription_tierand domain preferences into the global context.
- Manages
-
src/layouts/Navbar.jsx- Top nav with routes: Home, Verify, Modules, Subscription (only when logged in).
- Rumours sidebar and Rumour modal trigger.
- Auth area:
- Shows login button for guests.
- For authenticated users: colored profile icon (tier‑aware) and logout button.
-
src/pages/Auth/Signup.jsx- Signup form collects:
- Full name
- Password + confirm
- Phone number
- Age
- Domain preferences: checkboxes for Politics, Technology, Health, Crime, Military, Sports, Entertainment, Social Media only.
- Calls
/auth/signupwithdomain_preferencesand personal data.
- Signup form collects:
-
src/pages/Profile/Profile.jsx- Protected profile page (via
ProtectedRoute). - Fetches subscription status via
subscriptionService.getSubscriptionStatus(user.id). - Displays:
- Personal info: name, email, phone, age
- Interests (domain preferences) as animated tags
- Subscription card with tier color, status, next renewal date, days remaining
- Razorpay subscription metadata (last payment, subscription ID).
- “Manage Subscription” and “Back to Home” actions.
- Protected profile page (via
-
src/pages/Subscription/Subscription.jsx- Lists Free / Pro / Enterprise plans with a modern pricing table UI.
- Loads Razorpay Checkout script and config.
- For Pro:
- Fetches or creates Razorpay plan.
- Calls
/subscriptions/createwithuser.idand plan ID. - Opens Razorpay checkout for recurring subscription.
- On success, refreshes user (
refreshUser) and shows confirmation.
-
src/pages/Verify/Verify.jsx&src/pages/Verify/ChatbotView.jsx- Full chat layout with message history, file upload, audio recording, and multi‑line textarea.
- Submits messages to
/chatbot/verifyasFormData(text_input+files). - Renders AI and user bubbles, preserves newlines via
whitespace-pre-wrap.
-
src/hooks/useRumoursFeed.js- Connects to WebSocket feed for real‑time rumours.
- Transforms MongoDB documents into frontend shape:
- Maps verdict strings to False or Uncertain.
- Derives numeric confidence from
confidence_percentageor a confidence level string.
- Filters to only include relevant verdicts for live alerts.
-
src/components/RumourCard.jsx&src/components/RumourModal.jsx- Card shows claim snippet, verdict, and confidence percentage between verdict and time‑ago.
- Modal has redesigned layout:
- Balanced grid for Verdict/Verified On and Body/Summary.
- Read‑more / Read‑less for long text.
- Original post link with heading + external‑link icon.
-
src/pages/Modules/Modules.jsx- Fetches the educational modules list.
- Main modules view:
- Search field.
- “For You” button (if logged in & has domain preferences).
- Tag filter chips for domains/tags.
- Module cards using
ModuleCardwith difficulty badges and tags.
- Module detail view:
- Overview header with title, description, and domain tags.
- Stats cards (time, trending score, red flags, verification tips).
- Technique explanation, red flags, verification tips, real‑world example, user actions, related patterns.
Located under backend/ (FastAPI).
Key areas:
-
main.py- Auth endpoints:
POST /auth/signup– creates user in MongoDB (userscollection), hashes password, stores domain & tag preferences.POST /auth/login– verifies credentials, returns mock token and user payload.GET /auth/me– derives user from mock token, attachessubscription_tier(from user doc or active subscription).
- Subscription endpoints (Razorpay):
GET /subscriptions/config– exposes Razorpay key ID to frontend.POST /subscriptions/plans/GET /subscriptions/plans– plan management.POST /subscriptions/create– creates Razorpay subscription + upserts a document intosubscriptionscollection.GET /subscriptions/status– returns latest subscription per user, syncing status with Razorpay.POST /subscriptions/cancel– cancels subscription and updates MongoDB.POST /webhooks/razorpay– processessubscription.activated,subscription.charged,subscription.cancelled,payment.failedevents and updates MongoDB + usersubscription_tier.
- Educational modules:
GET /educational/modules– pulls summarized modules fromweekly_postsviaMongoDBService.get_educational_modules_list().GET /educational/modules/{module_id}– detailed module viaget_educational_module_by_id().
- Chatbot verification:
POST /chatbot/verify– entrypoint that passestext_inputandfilesto anInputProcessor, then routes to proper verification logic.
- Classic verify endpoints:
/verify/text,/verify/image,/verify/video– direct verification routes for text, image, and video evidence.
- Auth endpoints:
-
services/mongodb_service.py- Connects to MongoDB (
aegisDB) with collections:debunk_posts,weekly_posts,subscriptions,users,chat_sessions,chat_messages.
- Rumours:
get_recent_posts,search_similar_rumoursetc.
- Educational modules:
get_educational_modules_list()– returns unique modules by misinformation type with tags, trending score, etc.get_educational_module_by_id()– returns full module content plus example and tags.
- Users:
create_user,get_user_by_email,get_user_by_id.update_user_subscription_tier(user_id, subscription_tier)– keepssubscription_tierin sync with Razorpay events.
- Subscriptions:
upsert_subscription,get_user_subscription,update_subscription_status,get_subscription_by_razorpay_id.
- Connects to MongoDB (
name: stringemail: string (unique)password: sha256 hash (demo; use bcrypt in prod)phone_number: stringage: numberdomain_preferences: string[] (domains chosen at signup)tag_preferences: string[] (e.g., Misinformation, Fact Check, Viral – if extended)subscription_tier:"Free" | "Pro" | "Enterprise"created_at,updated_at: timestamps
user_id: string (ref to user)razorpay_subscription_id: stringrazorpay_plan_id: stringplan_name: string ("Pro","Enterprise", etc.)status: string ("created","active","cancelled","expired", etc.)amount: numbercurrency: string ("INR")current_start,current_end,next_billing_at: unix timestampslast_payment_*fieldscreated_at,updated_at
misinformation_type: human‑readable name (also used for module ID)technique_explanation: stringred_flags: string[]verification_tips: string[]related_patterns: string[]user_action_items: string[]sources_of_technique: string[]trending_score: number- Tags & context:
tags: frompost.metadata.tagsexample.heading,example.body,example.claim,example.verdict,example.tags,example.source_url
These commands may need adjustment depending on your environment; use them as a reference.
- Create and activate a Python virtual environment.
- Install dependencies:
pip install -r requirements.txt- Ensure MongoDB is running and
MONGO_CONNECTION_STRINGis set inbackend/.env. - Ensure Razorpay keys are configured in
backend/.env(RAZORPAY_ID,RAZORPAY_KEY, webhook secret). - Run the FastAPI app (using uvicorn, example):
uvicorn main:app --reloadThe backend will listen on http://127.0.0.1:8000 by default.
- From the
frontend/directory, install dependencies:
npm install- Ensure
VITE_API_BASE_URLis set infrontend/.env(e.g.http://127.0.0.1:8000). - Start the dev server:
npm run devThe app will usually run on http://localhost:5173 (or similar) with HMR.
- User signs up and chooses domain preferences (e.g. Politics, Technology, Health).
- These preferences are stored in MongoDB and returned via
/auth/me. - The Modules page pulls
user.domain_preferencesfromAuthContext. - Clicking For You sets the modules tag filter to those preferences.
- Only modules whose
tagsintersect with the selected preferences are shown.
This links rumours, educational content, and user profile into a cohesive personalized learning path.
- Richer recommendation engine for modules (based on past completions + rumours seen).
- More granular subscription tiers and usage‑based limits.
- Multi‑language support for rumours, chatbot, and educational content.
- Admin UI for curators to manage modules, tags, and verification rules.
Project Aegis is designed to be a high‑signal, high‑trust companion for users navigating today’s information landscape—offering real‑time fact‑checks, deep context, and practical education, all in one place.