Skip to content

mahidulislamnakib/BrightSide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BrightSide Banner

BrightSide

An AI-powered good news aggregation platform that ranks stories by real-world impact β€” not clicks.

Features Β β€’Β  Tech Stack Β β€’Β  Architecture Β β€’Β  Getting Started Β β€’Β  Hope Score Β β€’Β  API


✨ Features

For Readers

Feature Description
Hope Score Every article is ranked by a 5-dimension AI classifier: Verified Facts, Systemic Impact, Actionability, Novelty, Representation
Mood Filtering Select your mood (Motivated, Calm, Informed, Inspired) and stories are re-ranked to match
Social Share Cards Generate beautiful, branded photo cards in 3 themes Γ— 6 platform sizes for Instagram, Twitter, LinkedIn, Facebook
Interactive Dashboard World impact map, trend charts, category breakdowns, animated progress counters
Full-Text Search Search across all article titles, summaries, and content
Reading History Track articles read, time spent, and actions taken
Hope Budget Set daily reading limits for mindful news consumption

For Admins

Feature Description
Admin Panel Article moderation, source management, analytics dashboard
RSS Pipeline Auto-fetch from 5+ good news sources, classify, and store
Source CRUD Add, edit, activate/deactivate news sources with trust scores
Analytics Category/tier breakdowns, daily activity charts, engagement metrics

πŸ›  Tech Stack

Frontend

React 19 + TypeScript + Vite
Tailwind CSS + shadcn/ui (40+ components)
Framer Motion (animations)
Lucide React (icons)
p5.js (particle effects)
Three.js (3D Hope Orb)

Backend

Hono (HTTP framework)
tRPC 11.x (end-to-end type safety)
Drizzle ORM (type-safe MySQL queries)
MySQL (via mysql2)
fast-xml-parser (RSS scraping)

Authentication

OAuth 2.0 (Kimi)
JWT sessions (secure cookies)
Role-based access (user / admin)

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Frontend                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚  Home    β”‚ β”‚  Feed    β”‚ β”‚ Article  β”‚           β”‚
β”‚  β”‚ (Hero)   β”‚ β”‚(Filters) β”‚ β”‚ (Detail) β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚ Dashboardβ”‚ β”‚Bangladeshβ”‚ β”‚  Admin   β”‚           β”‚
β”‚  β”‚ (Charts) β”‚ β”‚ (Focus)  β”‚ β”‚ (Panel)  β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ tRPC (type-safe RPC)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Backend                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚article β”‚ β”‚dashboardβ”‚ β”‚ scraperβ”‚ β”‚  auth  β”‚      β”‚
β”‚  β”‚ router β”‚ β”‚ router β”‚ β”‚ router β”‚ β”‚ router β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚  seed  β”‚ β”‚  admin β”‚ β”‚  Hope  β”‚                  β”‚
β”‚  β”‚ router β”‚ β”‚ router β”‚ β”‚Score AIβ”‚                  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ Drizzle ORM
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Database                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚ articles β”‚ β”‚ sources  β”‚ β”‚  users   β”‚           β”‚
β”‚  β”‚(HopeScore)β”‚ β”‚(Trust)  β”‚ β”‚(OAuth)   β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚categoriesβ”‚ β”‚ user_reading_history β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • MySQL database (local or cloud)

Installation

# Clone the repository
git clone https://github.com/mahidulislamnakib/BrightSide.git
cd BrightSide

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your database URL and OAuth credentials

# Push database schema
npm run db:push

# Seed the database
npx tsx db/seed.ts

# Start development server
npm run dev

The app will be available at http://localhost:3000.

Environment Variables

Variable Description Required
DATABASE_URL MySQL connection string βœ…
VITE_APP_ID OAuth app ID βœ…
VITE_KIMI_AUTH_URL OAuth provider URL βœ…
APP_SECRET JWT signing secret βœ…
OWNER_UNION_ID Admin user union ID

🧠 Hope Score

The proprietary Hope Score is BrightSide's core innovation. Every article is analyzed across 5 dimensions:

Dimension Weight How it's measured
Verified Facts 25% Source trust score + keyword analysis ("study", "data shows", "peer-reviewed")
Systemic Impact 25% Impact keywords ("vaccine", "eradicated", "renewable", "peace treaty")
Actionability 20% Action keywords ("donate", "volunteer", "how to", "get involved")
Novelty 15% Recency + uniqueness score
Representation 15% Region tier (underreported: 0.9, developing: 0.7, western: 0.4)

Score Tiers

Tier Range Color
πŸ₯‡ Gold Standard 0.80 - 1.00 #F4A261
πŸ”΅ Verified 0.65 - 0.79 #E8644B
🟒 Constructive 0.50 - 0.64 #F4D0C4

πŸ“‘ API

tRPC Routers

Router Endpoints Auth
article list, byId, featured, related, search, morningBrief, classify, whyItMatters Public
dashboard stats, regions, metrics, impactMap Public
scraper scrape, scrapeSource, sources Public
auth url, me, logout, updatePrefs OAuth
admin stats, articles, updateArticle, deleteArticle, sources, createSource, analytics Admin only
seed run Public

Example Query

import { trpc } from "@/providers/trpc";

function ArticleList() {
  const { data: articles } = trpc.article.list.useQuery({
    category: "Health",
    mood: "motivated",
  });

  return (
    <div>
      {articles?.map((a) => (
        <ArticleCard key={a.id} article={a} />
      ))}
    </div>
  );
}

🎨 Design System

Color Palette

Token Value Usage
Cream #FFFBF5 Page background
Charcoal #1A1814 Dark sections, text
Coral #E8644B Primary accent, buttons
Amber #F4A261 Gold tier, highlights
Peach #F4D0C4 Cards, soft accents

Typography

  • Display: Oranienbaum (serif) β€” headlines, titles, numbers
  • Body: Inter (sans-serif) β€” UI labels, metadata, body text

πŸ“ Project Structure

β”œβ”€β”€ api/                    # Backend
β”‚   β”œβ”€β”€ routers/            # tRPC routers (article, auth, admin, scraper, dashboard)
β”‚   β”œβ”€β”€ services/           # Business logic (RSS scraper, classifier)
β”‚   β”œβ”€β”€ lib/                # Utilities (env, http, classifier engine)
β”‚   β”œβ”€β”€ queries/            # Database query functions
β”‚   β”œβ”€β”€ boot.ts             # Hono server entry
β”‚   β”œβ”€β”€ router.ts           # tRPC app router
β”‚   └── middleware.ts       # Auth middleware (public, authed, admin)
β”œβ”€β”€ db/                     # Database
β”‚   β”œβ”€β”€ schema.ts           # Drizzle ORM schema
β”‚   β”œβ”€β”€ relations.ts        # Table relations
β”‚   └── seed.ts             # Seed script
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/              # Route pages (Home, Feed, Article, Dashboard, Admin)
β”‚   β”œβ”€β”€ components/         # UI components + effects (Particles, Orb, ShareCard)
β”‚   β”œβ”€β”€ hooks/              # Custom hooks (useAuth)
β”‚   β”œβ”€β”€ data/               # Static data (categories, demo articles)
β”‚   β”œβ”€β”€ lib/                # Frontend utilities (classifier)
β”‚   └── providers/          # tRPC client provider
β”œβ”€β”€ contracts/              # Shared types (frontend ↔ backend)
└── public/assets/          # Generated images

🀝 Contributing

We welcome contributions! Please read our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with hope. Ranked by impact. Shared with the world.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages