The Problem
Independent bloggers lacked a professional platform to publish and manage their content, while readers struggled to distinguish authentic news from misinformation. Many existing websites mixed unverified content with little moderation, reducing trust in online publications.
The Solution
Developed a full-stack blogging platform that enables bloggers to create and manage articles while integrating verified news from CNN and trusted Nigerian news providers through external APIs. Readers enjoy reliable news alongside community-written content, while administrators maintain platform quality through moderation tools.
Overview
Project Overview
AfriNews Hub is a full-stack blogging and news platform that combines user-generated articles with verified international and Nigerian news sources.
System Design
System Architecture
Frontend
Backend
Database
External APIs
Deployment
Security
Authentication Flow
User creates an account
Password is securely hashed using bcrypt
User logs in
FastAPI validates credentials
JWT access token is generated
Frontend stores the token
Protected requests include the JWT token
Backend validates the token before returning protected resources
Request Lifecycle
API Request Flow
Visitor opens the application
Frontend requests published blog posts
Backend retrieves blog posts from PostgreSQL
Backend fetches live headlines from CNN News API
Backend retrieves Nigerian news from NewsData.io
Combined data is returned to the frontend
Authors publish articles via protected endpoints
Readers like and comment on posts
Administrators moderate blogs and promotions
Data Layer
Database Design
Users
- id
- full_name
- password_hash
- profile_image
- bio
- created_at
BlogPosts
- id
- author_id
- title
- content
- featured_image
- category
- status
- created_at
Comments
- id
- post_id
- user_id
- comment
- created_at
Likes
- id
- post_id
- user_id
- created_at
Promotions
- id
- user_id
- post_id
- status
- requested_at
Administrators
- id
- full_name
- password_hash
- role
Capabilities
Key Features
Authentication
Secure registration and login using JWT authentication.
Blog Publishing
Create, edit, publish, and manage blog articles.
Live News Integration
Fetch verified headlines from CNN and Nigerian news providers.
Comments
Readers can discuss and engage with published content.
Likes
Users can like articles and interact with authors.
Promotions
Authors can request featured promotion for their posts.
Admin Dashboard
Manage users, blogs, reports, and promotion requests.
Responsive Design
Optimized for desktop, tablet, and mobile devices.
Under The Hood
Engineering Challenges
Challenge
External API Integration
Resolution
Integrated multiple trusted news providers while ensuring consistent API responses and handling unavailable services gracefully.
Challenge
Authentication
Resolution
Implemented JWT authentication with secure password hashing and protected API routes.
Challenge
Content Moderation
Resolution
Designed administrative workflows for removing unauthorized content and reviewing promotion requests.
Challenge
Scalable Architecture
Resolution
Separated frontend, backend, database, and third-party integrations into independent layers for easier maintenance.
Decision Record
Technical Decisions
Chose
Next.js
Over
React
Why
Selected for improved SEO, performance, and server-side rendering capabilities.
Chose
FastAPI
Over
Django
Why
Chosen for its speed, automatic API documentation, and excellent developer experience.
Chose
PostgreSQL
Over
MongoDB
Why
Unknown!
Chose
Trusted News APIs
Over
Web scraping
Why
Integrated CNN News API and NewsData.io instead of scraping websites to ensure accurate and legally accessible news.
Chose
JWT Authentication
Why
Implemented stateless authentication suitable for scalable REST APIs.
Retrospective
Lessons Learned
- 01
Working with multiple external APIs requires robust error handling and fallback strategies.
- 02
Separating blog content from live news feeds improves maintainability.
- 03
A consistent API response structure simplifies frontend integration.
- 04
Planning database relationships early reduces future migration complexity.
- 05
Role-based authorization is essential for secure content moderation.
🌍 Live Project
By The Numbers
Project Statistics
Full Stack
Architecture
JWT
Authentication
CNN + NewsData.io
News Sources
PostgreSQL
Database
REST
API Style
Vercel + Render
Deployment
