NP Revolution

A full-stack Nepali digital news platform combining a public news experience with reporter workflows, authentication, role-based content management, media uploads, weather information, and editorial dashboards.

Status: Functional full-stack projectDuration: March–April 2025Role: Solo Full-Stack DeveloperTeam: 1
NP Revolution banner

Overview

Purpose: Build a modern Nepali news platform serving both readers and reporters from one application.

Target users: News readers; reporters; editorial/admin users.

  • Categorized news homepage
  • Breaking news
  • Video news
  • Trending content
  • Weather
  • Reporter dashboard
  • Content creation
  • Role-based content management
  • Media uploads
  • Authentication
  • Google OAuth
  • Light/dark themes

Tech Stack

No README or docs anywhere in the repo; all of the above is read directly from package.json files and how (or whether) each dependency is actually imported in code, not from documentation.

Frontend

  • Vite
  • React 19
  • React Router
  • Tailwind CSS
  • Radix UI / shadcn-style components
  • Lucide React
  • React Icons

Backend

  • Express 4
  • Joi
  • Multer
  • Helmet

Database

  • MongoDB
  • Mongoose

Auth

  • JWT
  • bcryptjs
  • Passport
  • Google OAuth
  • Cookie sessions

Features

News Homepage

Breaking-news ticker, hero stories, editor's picks, live updates, trusted sources, popular tags, trending topics, category-grouped news, video stories, newsletter signup, weather.

How: The UI is decomposed into reusable content and editorial components.

Reporter Dashboard

Article statistics, view and engagement information, draft/published/review states, content shortcuts, editorial calendar, trending story opportunities, fact-checking tools.

Content CRUD

Structured content management with public article reads, reporter-authorized writes, draft/published/archived states, view tracking, tags and categories, media attachments, ownership validation.

Media Uploads

Multer handles media upload workflows with validation for supported image/video formats and controlled file limits.

Authentication

Email/password registration and login, JWT authentication, reporter role validation, Google OAuth, token verification.

Weather Integration

The homepage integrates current weather data to enrich the local news experience.

Theme System

A persistent light/dark theme preference is stored in the browser and applied at the document level.

Architecture

React/Vite frontend→Axios/API layer→Express→authentication/validation/upload middleware→controllers→Mongoose→MongoDB

Folder structure: Backend separates controllers, middleware, models, routes, upload utilities, and authentication configuration.

Database Design

  • User — Username, email, password hash, role, timestamps
  • Reporter — User reference, verification status, biography
  • Content — Title, body, author, media, category, tags, publication status, views, created/updated timestamps

The model supports a clear reader/reporter/editor workflow.

API Documentation

MethodURLPurposeAuth
POST/api/auth/registerRegister accountPublic
POST/api/auth/loginLoginPublic
GET/api/auth/verify-tokenVerify tokenAuthenticated
GET/api/auth/googleGoogle OAuthPublic
GET/api/auth/google/callbackOAuth callbackGoogle auth
GET/api/contentList contentPublic
GET/api/content/:idRead articlePublic
POST/api/contentCreate contentReporter
PUT/api/content/:idUpdate contentReporter/owner
DELETE/api/content/:idDelete contentReporter/owner

Authentication Flow

login: Email/password → bcrypt verification → JWT issuance → authenticated API request → user resolution → reporter-role validation where required.

notes: Google OAuth provides an additional third-party sign-in path through Passport.

Screenshots

Auth Portal
Auth Portal
Reporter Dashboard
Reporter Dashboard

Challenges

Problem: Aligning Frontend and Backend Contracts — a content-heavy application has many data consumers and can drift if UI and API shapes evolve separately.

Solution: I aligned authentication and content responses behind consistent client/API boundaries and connected editorial views to the backend content lifecycle.

Problem: Combining JWT and OAuth — supporting both first-party credentials and Google OAuth requires a consistent application identity after authentication.

Solution: I normalized both flows into the same user/role model so downstream authorization follows one policy.

Problem: Reporter Authorization — content creation must be protected by more than login status.

Solution: I composed JWT authentication with reporter-role middleware and ownership checks for protected mutations.

Performance

  • Vite development/build pipeline
  • Componentized homepage
  • Tailwind-based styling
  • Client-side routing
  • Reusable content components
  • Efficient API separation between public reads and protected writes

Security

  • Helmet middleware
  • bcrypt password hashing
  • JWT authentication
  • Role-based authorization
  • Joi validation
  • Upload restrictions
  • Environment-based secrets
  • CORS configuration
  • Rate-limiting capability
  • OAuth configuration separated from application logic

Deployment

hosting: Separate frontend and backend packages, allowing independent deployment and scaling while sharing one MongoDB-backed content model.

Future Improvements

  • Editorial review workflows
  • Richer analytics
  • Search
  • Personalized feeds
  • Real-time breaking-news updates
  • Additional fact-checking automation
  • Media processing

Lessons Learned

  • Content systems need stable API contracts because many screens depend on the same entities.
  • Role-based authorization must be enforced in backend middleware, not only in dashboard routing.
  • File upload, authentication, validation, and business logic are easier to reason about when composed as explicit middleware stages.
  • Building both reader and reporter experiences in the same product forces clearer separation between public and privileged capabilities.

Project Metrics

devTime: March–April 2025commits: technologies: Vite, React, React Router, Tailwind, Express, MongoDB, Mongoose, Passport, JWT, Joi, Multer

Timeline

  1. March 2025 — Project initialized with frontend and backend structure
  2. April 2025 — Routing, dashboard, authentication, content workflow, and UI refinement

Ask about this project

Depends on the /api/chat orchestrator and MCP tool server — not built yet (see plan.md).

Recruiter Summary

Role: Solo Full-Stack Developer

Responsibilities:
  • Built a componentized React news portal
  • Built a reporter-focused CMS dashboard
  • Implemented Express/MongoDB content APIs
  • Added JWT authentication and role-based authorization
  • Implemented media uploads and Joi validation
  • Added Google OAuth
  • Integrated weather and theme functionality
  • Connected public content and reporter workflows through one backend model
Impact:
  • Demonstrates rapid full-stack delivery across a public content product and a privileged editorial application
  • Shows experience with authentication, RBAC, media upload, API design, and component-heavy React UI
ReactViteTailwind CSSExpressMongoDBMongoosePassportJWTJoiMulter
Full-stack developmentcontent systemsRBACAPI designauthenticationmedia handlingReact UI architecture
NP Revolution | Himeshchanchal Bhattarai