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
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.
| 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 |
| Page | URL |
|---|---|
| Home | / |
| Register | /register |
| Sign in | /signin |
| Dashboard | /dashboard |
| About | /about |
| Health | /api/health |
| Home | Register | Sign in |
|---|---|---|
![]() |
![]() |
![]() |
| Dashboard | About |
|---|---|
![]() |
![]() |
- 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
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 devOpen http://localhost:3000.
| 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 |
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
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).
authentication-service — an earlier Express-based authentication exercise kept as a separate archive.
MIT — see repository for details.




