Skip to content

leonardogbxv/blog-md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Blog

Markdown based blog using Node.js and MongoDB. It uses marked library to parse and compile markdown.


Admin view

User view (click here)

Features

A simple useful blog system, you can handle all your needs without leaving the site.

  • Administrator login/logout to save/clear admin sessions on the blog. By logging in, you have access to all the blog's administrative functionalities:
    • Create new posts with a thumbnail, title, category, description and markdown content;
    • Delete button to get rid of specific posts;
    • Edit button to modify specific posts;
    • Upload images/files to the server so you can use it in posts thumbnails, banners, blog content, ...
  • Simple and flexible pagination according to the limit of posts per page.
  • Disqus comment hosting service for discussions and comment posts on the blog.
  • ...

Installation

Cloning a repository

$ git clone https://github.com/leonardogbxv/blog-md.git
$ cd blog-md
$ npm install
$ npm run dev

Enviroment variables

DB_CONNECTION= // db address
PORT= // server port
NODE_ENV= // development or production
SESS_NAME= // session name
SESS_SECRET= // session secret
SESS_TIME= // session time expiration
APP_ID= // store session user id
APP_LOGIN= // admin login
APP_PWD= // admin password

Dependencies

Project dependencies and for what they were used for.

  • Nodemon: Automatically refresh our web page when file changes are made;
  • Express: "..provide small, robust tooling for HTTP servers";
  • Mongoose: MongoDB object modeling;
  • EJS: Template engine;
  • Marked: Markdown parser and compiler;
  • Slugify: Converts a string to a slug;
  • method-override: Use PUT/DELETE/... in places where the client doesn't support it;
  • Dompurify: Sanitizes HTML and prevents XSS attacks;
  • JSDom: Render HTML inside of Node.js;
  • express-session: Assign an unique session to identify the user (in this case, the admin).
  • memorystore: Session store for express (without leaks version).
  • dotenv: Environment variables.
  • Multer: Node.js middleware for handling multipart/form-data, used for uploading files.
  • Bootstrap: Front-end framework with a giant collection of handy CSS codes.

Todo 📝

  • Add post slug
  • Add XSS sanitizer
  • Add admin session authentication
  • Add image upload
  • Add posts pagination
  • Integrate Disqus
  • ...