An open API service indexing awesome lists of open source software.

https://github.com/kayleigh-page/blogger

A backend API for all my websites.
https://github.com/kayleigh-page/blogger

api apollo axios express graphql mongodb mongoose next-pwa nextjs nodejs react tailwindcss

Last synced: 6 months ago
JSON representation

A backend API for all my websites.

Awesome Lists containing this project

README

          

# Blogger API & Dashboard
This project is a custom **GraphQL backend and dashboard** I built to manage the blog posts, portfolio items, and newsletter subscribers across all my websites. It also serves SEO metadata and image assets, making it a centralized and efficient solution for content management.

## 🧩 Overview
- **GraphQL API** for querying and managing:
- Blog posts
- Portfolio items
- Newsletter subscribers
- SEO data
- Site settings and domains
- **Frontend dashboard** built with Next.js for easy admin control over content.
- **Image hosting** for uploaded media used in blog posts and portfolios.

## 🔐 Security
- Password-based login with **2FA using TOTP** (Microsoft Authenticator or similar).
- **Rate limiting**: login is blocked after 3 failed attempts in 15 minutes.
- Uses `helmet` and other security best practices.

## ⚙️ Tech Stack
### Backend
- **Node.js** with **Express**
- **GraphQL** (no Apollo/Mercurius – custom setup)
- **MongoDB Atlas** (hosted cloud DB)
- **Mongoose** for data modeling
- **Authentication** with JWT + bcryptjs
- **Two-Factor Auth** with speakeasy + qrcode
- **Rate limiting** with express-rate-limit
- **File uploads** with multer
- **Security headers** with helmet
- **Other utilities**: axios, dotenv, cors

### Frontend
- **Next.js** for the admin dashboard
- **next-pwa** progressive web app
- **SWR** for fetching GraphQL data
- **Quill** for rich text editing that stores as HTML (blog post and portfolio item content)

## ✨ Features
- Add, edit, and delete:
- Blog posts
- Portfolio items
- Newsletter subscribers
- Websites/domains
- Upload and manage images for use in content
- Add SEO metadata per post or item
- Responsive, modern admin dashboard
- PWA support for mobile-friendly editing

## 🔧 Future Plans
- Email campaign management for newsletter subscribers
- React-native app

## 🚀 Deployment
This project is designed for deployment on a VPS or cloud server. MongoDB is hosted via MongoDB Atlas, and environment variables are managed through .env files on both backend and frontend.

### .env example for backend
```
PORT=5001
MONGO_URI=mongodb+srv://:@/blogger?retryWrites=true&w=majority&appName=Blogger

PUBLIC_IMAGE_URL=https:///uploads/

JWT_SECRET=SuperLongAndSecureSecret
LOGIN_ATTEMPTS=3 # 3 Login attempts
LOGIN_WINDOW=10 # in 10 minutes
```
### .env.local example for backend
```
NEXT_PUBLIC_GRAPHQL_API_URL=https:///graphql
NEXT_PUBLIC_IMAGE_URL=https:///uploads/
```

---

Feel free to fork or star.
Or reach out if you'd like to work together.