2.3 KiB
2.3 KiB
Markdown Blog
A modern, cross-platform blog system built with Next.js, Markdown, and Electron. Write posts in Markdown, manage content visually, and deploy to web or desktop.
🚀 Features
- Write and organize posts in Markdown
- Visual admin dashboard
- Responsive UI (Tailwind CSS)
- Electron desktop app
- Dockerized deployment with persistent storage
- Secure admin password (bcrypt)
🛠️ Technologies
- Next.js 14
- TypeScript
- Tailwind CSS
- Electron
- Docker
📦 Project Structure
markdownblog/
├── posts/ # Markdown blog posts
├── src/ # Next.js app code
├── electron/ # Desktop app code
├── public/ # Static assets
├── Dockerfile # Docker configuration
├── .dockerignore # Docker ignore rules
└── manage_container.sh # Docker management script
⚡ Getting Started
Prerequisites
- Node.js 18+
- npm
- Docker (for containerized deployment)
🖥️ Local Development
git clone <repo-url>
cd markdownblog
npm install
npm run dev
- Visit http://localhost:3000 in your browser.
Build for Production (Local)
npm run build
npm start
🐳 Docker Deployment
Build the Docker Image
docker build -t markdownblog .
Run the Container with Persistent Storage
docker run -p 8080:3000 -v markdownblog-posts:/app/docker markdownblog
- The app will be available at http://localhost:8080
- All posts are stored persistently in the Docker volume
markdownblog-posts(mapped to/app/dockerin the container).
Using a Host Directory for Posts
docker run -p 8080:3000 -v /absolute/path/to/posts:/app/docker markdownblog
📝 Writing Posts
- Add Markdown files to the
posts/directory (or the mounted volume). - Each post should have frontmatter:
---
title: "Your Post Title"
date: "YYYY-MM-DD"
tags: ["tag1", "tag2"]
summary: "A brief summary of your post"
---
Your post content here...
🔒 Admin Password Security
- Admin password is securely hashed with bcrypt and stored in
posts/admin.json. - Never commit your
posts/admin.jsonfile.
📄 License
MIT