Skip to content

Repository files navigation

NyasaBlog

A digital platform dedicated to promoting positive content created by Malawian content creators and influencers. NyasaBlog aims to be the most trusted source for Malawian content in the areas of Culture, Entertainment, Entrepreneurship, Tourism, Technology, Sports, Lifestyle, Education, Health, and Opinion.

Live site:nyasablog.com

About

NyasaBlog was created and founded by Ephraim Kanyandula, a Malawian national, with the vision of building a platform that amplifies Malawian voices and showcases the best of Malawian creativity and innovation.

Features

  • Blog Posts — Create, edit, delete with rich text editor (CKEditor 5), featured images, draft/publish workflow
  • Categories & Tags — 10 Malawian-focused categories, free-form tags for content organization
  • Comments — Threaded comments with one level of replies
  • Likes & Bookmarks — Like posts and save them for later reading
  • User Profiles — Bio, avatar, location, social links (Twitter, Facebook, Instagram, LinkedIn)
  • Author Pages — Public profile with post grid and stats
  • Search — Dedicated search page with category filtering and related topics
  • Social Sharing — WhatsApp (priority), Facebook, Twitter/X, Copy Link with Open Graph meta tags
  • Dark Mode — Toggle with system preference detection and localStorage persistence
  • Responsive Design — Mobile-first with bottom navigation bar and floating action button
  • REST API — Full API for all features with token authentication

Tech Stack

  • Backend: Django 5.2 LTS, Django REST Framework 3.17
  • Frontend: Tailwind CSS (CDN), Inter font, Material Symbols icons
  • Design System: "The Modern Savanna Editorial" — see DESIGN.md
  • Rich Text: CKEditor 5
  • Database: SQLite
  • Storage: DigitalOcean Spaces (S3-compatible, production)
  • Server: Gunicorn 25.3 + Nginx on DigitalOcean (Ubuntu, Python 3.12)
  • Auth: Custom user model with token-based API authentication

Project Structure

nyasablog/
├── mysite/ # Settings, root URLs, WSGI
├── personal/ # Home, about, contact, search, API docs
│ └── templates/
├── account/ # Custom user model, profiles, auth views
│ ├── api/ # Account REST API
│ └── templates/
├── blog/ # Posts, categories, tags, comments, likes, bookmarks
│ ├── api/ # Blog REST API
│ └── templates/
├── templates/ # Base template, header, footer, 404, registration
├── static/ # Static assets (logo)
├── DESIGN.md # Design system documentation
└── requirements.txt

Local Development Setup

Prerequisites

  • Python 3.12+
  • pip

Installation

git clone https://github.com/Kanyandula/BlogPost.git
cd BlogPost
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp settings.ini.example settings.ini
# Edit settings.ini with your SECRET_KEY and DEBUG=True
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

Visit http://127.0.0.1:8000

Running Tests

python manage.py test blog

55 tests covering models, views, auth, and API.

REST API

All authenticated endpoints require Authorization: Token <token> header.

Blog API

MethodEndpointAuthDescription
GET/api/blog/listYesList posts (search, filter, paginate)
GET/api/blog/<slug>/YesGet post detail
POST/api/blog/createYesCreate post
PUT/api/blog/<slug>/updateYesUpdate post (author only)
DELETE/api/blog/<slug>/deleteYesDelete post (author only)
GET/api/blog/categories/NoList all categories
GET/api/blog/tags/NoList all tags
GET/api/blog/<slug>/comments/NoList threaded comments
POST/api/blog/<slug>/comments/create/YesCreate comment
DELETE/api/blog/comments/<pk>/delete/YesDelete own comment
POST/api/blog/<slug>/like/YesToggle like
POST/api/blog/<slug>/bookmark/YesToggle bookmark
GET/api/blog/bookmarks/YesList bookmarked posts

List filtering:?category=<slug>, ?status=published, ?search=<query>, ?ordering=-date_updated

Account API

MethodEndpointAuthDescription
POST/api/account/registerNoRegister new user
POST/api/account/loginNoGet auth token
GET/api/account/propertiesYesGet user info
PUT/api/account/properties/updateYesUpdate user info
PUT/api/account/change_password/YesChange password
GET/api/account/profile/<username>/NoPublic author profile
PUT/api/account/profile/update/YesUpdate own profile

Full API documentation available at nyasablog.com/api/

Author

Ephraim Kanyandula — Creator & Founder

License

All rights reserved.