Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal Blog

A personal blog built with Go for writing and publishing articles. Features a guest section for reading articles and an admin section for managing content.

Features

  • Guest Section

    • Home page with list of all published articles
    • Individual article pages with full content
  • Admin Section

    • Dashboard with article list and management actions
    • Add, edit, and delete articles
    • Protected routes with session-based authentication
  • Storage

    • Filesystem-based storage using JSON files
    • No external database dependencies

Getting Started

Prerequisites

  • Go 1.21 or later

Installation

git clone https://github.com/pranampagi/personal-blog.git
cd personal-blog
go build -o blog .
./blog

The server starts on http://localhost:3000.

Default Admin Credentials

  • Username: admin
  • Password: password123

These can be overridden with environment variables:

export ADMIN_USERNAME=myuser
export ADMIN_PASSWORD=mypassword
./blog

Project Structure

personal-blog/
├── main.go          # Server entry point, routes, and guest handlers
├── session.go       # Authentication and session management
├── admin.go         # Admin dashboard and article CRUD handlers
├── models/
│   └── article.go   # Article model and filesystem operations
├── templates/       # HTML templates
├── static/          # CSS files
└── articles/        # Article JSON storage

Usage

  1. Visit http://localhost:3000 to browse articles
  2. Navigate to /login to access the admin panel
  3. Use the dashboard to create, edit, or delete articles

About

A simple personal blog built with Go (standard library) featuring file-based JSON storage, session-based admin authentication, and full CRUD for articles. No external dependencies required.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages