Coder Social home page Coder Social logo

blog-fs-mern's Introduction

Blog Full-Stack Web App

This is a full-stack blogging web application using the MERN stack (MongoDB, Express.js, React, Node.js). This was originally built with PostgreSQL instead of MongoDB, but this project has been converted to use MongoDB. It is functionally identical. To see the PERN stack version, go to: https://github.com/Emman-B/blog-fs.

main_view_mobile

Implemented Features (Frontend & Backend)

  • Creating/Editing/Deleting Blog Posts
  • Reading Blog Posts
  • Blog post permissions (e.g., public, private)
  • Authentication (account creation and login) with JWT
  • Rich text editor
  • API Validation using OpenAPI Specification 3

Releases

See: https://github.com/Emman-B/blog-fs-mern/releases for releases.

Regarding a full production release At the moment, I do not have plans to officially deploy this project in a production environment. The current plan is to have the application available to host locally.

Usage

Requirements

The following requirements reflect what I used during the development of this app. Older versions may still be used, though it has not been tested.

  • MongoDB (v6.0.5)
  • Node (v20.1.0)

Installation

First, install the above required software. For local hosting, I installed MongoDB Community Server and followed their corresponding setup. To run the database, you will need to run mongod.exe which will be in the MongoDB installation folder.

Second, you need to create a .env file in the same directory as the .env.example file. I recommend copying the .env.example file and renaming it as .env and then replacing the values as needed.

Then, using the terminal, run the command npm install in the frontend/ and backend/ directories. This installs the required packages.

Running the web application

In the frontend/ and backend/ directories, run the following:

npm start

If running the command above does not work for the frontend/, you can run an alternative command:

npm run local

By default, you access the frontend web application here:

http://localhost:3000

To test the backend API, you can go to the following URL (after replacing <PORT> with the corresponding port of the backend server):

http://localhost:<PORT>/v1/api-docs/

For setting up the database, you can run the following commands:

npm run dbsetup # This will set up the database
npm run dbsetup -- [-d|--dummy] # This will insert dummy data into the database
npm run dbsetup -- [--dangerous=clear] # This will completely clear the database's data.

What I Learned

This was a large project to learn more about full stack web development. I learned about the MERN stack, as well as HTML and CSS, Authentication (with JWT), API validation, and security. I also learned about mobile-first design, as well as responsive web design.

Screenshots

Main View for Desktop

main_view_desktop

Login View for Mobile

login_view_mobile

Signup View for Mobile

signup_view_mobile

Reader View for Mobile

reader_view_mobile

reader_view_mobile_2

Editor View for Mobile

editor_view_mobile

Disclaimer

The structure based off a university assignment that uses the same stack in the creation of a full stack web application. There are similarities in this project to my own implementation of said assignment, but most (if not all) of the similarities are related to project structure and other required setup.

blog-fs-mern's People

Contributors

emman-b avatar

Watchers

 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.