Giter Site home page Giter Site logo

solygambas / javascript-blogging-platform Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.89 MB

A blogging platform using MongoDB Atlas, Express and Node.js.

Home Page: https://javascript-blogging-platform.onrender.com/

JavaScript 68.03% CSS 8.69% EJS 23.27%
mongodb express expressjs node nodejs javascript ejs socket-io

javascript-blogging-platform's Introduction

Blogging Platform

A blogging platform using MongoDB Atlas, Express and Node.js.

Demo

See Demo deployed on Render

See Demo deployed on Render

Core features

  • using Model–View–Controller (MVC) design pattern.
  • handling routes with Express.
  • handling views with Embedded JavaScript templates (EJS).
  • validating user data with validator.
  • adding registered users to MongoDB Atlas and hashing passwords with bcryptjs.
  • using promises and async/await method.
  • managing connected users with express-session.
  • storing sessions with connect-mongo.
  • displaying error/success messages with connect-flash.
  • displaying profile picture with Gravatar and generating image urls with md5.
  • performing CRUD operations (create, read, update, delete) using MongoDB Atlas for posts.
  • displaying profile with the latest posts published by author.
  • handling markdown in posts with marked.
  • sending email notifications with Sendgrid API.
  • sanitizing data posted by users with sanitize-html.
  • preventing Cross-Site Request Forgery (CSRF) with csurf.

Live Search Feature

  • bundling front-end JavaScript with Webpack and Babel.
  • handling key press events with setTimeout().
  • sending search requests to the server with Axios.
  • creating an index in MongoDB Atlas and building a search request to the database.
  • sanitizing results with DOMPurify.

Follow Feature

  • handling follow and unfollow features on author profile.
  • storing followed users in the database.
  • retrieving followers and followed users from the database.
  • counting posts, followers and followed users with await Promise.all() and countDocuments().
  • displaying a feed on the dashboard with the latest posts published by followed users.

Live Chat

  • handling realtime communication between web clients and server with Socket.IO.
  • sending messages with emit() and waiting for messages with on().
  • broadcasting messages with socket.broadcast.emit().
  • displaying usernames and avatars in the live chat with express-session.
  • sanitizing messages with sanitize-html (server-side) and DOMPurify (client-side).

Live Validation

  • displaying errors on the fly for registration form with regex.
  • checking if username and email are already in the database with Axios.
  • performing a last check before submitting the form.

API

  • granting access to the API with JSON Web Tokens (/api/login).
  • enabling routes for creating (/api/create-post) and deleting posts (/api/post/:id) through the API.
  • enabling public GET requests to retrieve posts by author (/api/posts-by-author/:username).
  • handling Cross-origin resource sharing (CORS).

Render

  • deploying on Render.

Based on Learn JavaScript: Full-Stack from Scratch by Brad Schiff (2019).

javascript-blogging-platform's People

Contributors

solygambas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.