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.
-
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
- Go 1.21 or later
git clone https://github.com/pranampagi/personal-blog.git
cd personal-blog
go build -o blog .
./blogThe server starts on http://localhost:3000.
- Username:
admin - Password:
password123
These can be overridden with environment variables:
export ADMIN_USERNAME=myuser
export ADMIN_PASSWORD=mypassword
./blogpersonal-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
- Visit
http://localhost:3000to browse articles - Navigate to
/loginto access the admin panel - Use the dashboard to create, edit, or delete articles