Skip to content

Elli2022/auth-blog-platform

Repository files navigation

Auth Blog Platform

Deploy to Netlify Live demo

Next.js TypeScript MongoDB JWT Tailwind CI

Full-stack authentication and blog platform
Register, sign in with JWT, and manage personal blog posts from a protected dashboard.

https://auth-blog-platform.netlify.app

Overview

A production-style portfolio project built with Next.js 14, MongoDB Atlas, and JWT authentication. Users can create an account, sign in, and publish blog posts stored in the cloud. API routes run as Netlify serverless functions; the frontend uses TypeScript and Tailwind CSS with a dark/light theme.

This repo consolidates earlier microservice experiments into a single maintainable codebase.

Features

Feature Description
User registration Username, email, and bcrypt-hashed password stored in MongoDB
JWT sign-in Bearer tokens for authenticated API access
Blog dashboard Create and list posts scoped to the signed-in user
Health check /api/health reports database connectivity
CI/CD GitHub Actions deploys to Netlify on push to master

Live demo

Page URL
Home /
Register /register
Sign in /signin
Dashboard /dashboard
About /about
Health /api/health

Screenshots

Home Register Sign in
Home Register Sign in
Dashboard About
Dashboard About

Tech stack

  • Frontend: Next.js 14 (Pages Router), React, TypeScript, Tailwind CSS
  • Backend: Next.js API routes (/api/login, /api/v1/user, /api/v1/user/blog)
  • Database: MongoDB Atlas
  • Auth: JWT + bcrypt (legacy MD5 passwords still accepted for older accounts)
  • Hosting: Netlify with @netlify/plugin-nextjs

Local development

git clone https://github.com/Elli2022/auth-blog-platform.git
cd auth-blog-platform
npm ci
cp .env.example .env.local
# Fill in MONGODB_URI, JWT_SECRET, and optional NEXT_PUBLIC_SITE_URL
npm run dev

Open http://localhost:3000.

Environment variables

Variable Required Description
MONGODB_URI Yes MongoDB Atlas connection string
JWT_SECRET Yes Secret for signing JWTs
MONGODB_DB_NAME No Database name (default: JS3-app)
MONGODB_COLLECTION No Users collection (default: Users)
NEXT_PUBLIC_SITE_URL No Public site URL for metadata and API client

Project structure

src/
├── components/     # Layout, navbar, UI primitives, status pills
├── lib/            # MongoDB client, JWT helpers, site config
└── pages/
    ├── api/        # Auth, user registration, blog CRUD, health
    ├── dashboard.tsx
    ├── register.tsx
    ├── signin.tsx
    └── about.tsx

Project lineage

This repo replaces three archived experiments from 2023–2024:

Archived repo Why archived
fullstack-application Early MERN prototype — MD5 passwords, hardcoded secrets
fullstack-application-legacy Duplicate legacy snapshot
fullstack-app-backend-service Split backend fragment of the same experiment

For a larger full-stack showcase, see community-hub (PostgreSQL, social feed, DMs, OpenAPI).

Related project

authentication-service — an earlier Express-based authentication exercise kept as a separate archive.

License

MIT — see repository for details.

About

JS3 (FE22) major assignment: full-stack auth & blog with MongoDB, Redis history, JWT. First big self-directed project. Live on Netlify.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages