Giter Site home page Giter Site logo

blogapp2's Introduction

MERN Blog App

A MERN application using basic CRUD operations , authentication and authorization.

Table of Contents

Features

User-side features

  • Signup
  • Login
  • Logout
  • Add Post
  • Similar Posts
  • View Post
  • Update Post
  • Delete Post

Developer-side features

  • Form validations in frontend and backend
  • Token based Authentication
  • Use of 404 page for wrong urls
  • Relevant redirects
  • Use of layout component for pages
  • Use of various React hooks
  • Routes protection
  • Use of different HTTP status codes for sending responses
  • Standard pratices followed

Tools and Technologies

  • HTML
  • CSS
  • Javascript
  • Node.js
  • Express.js
  • React
  • Context-API
  • Mongodb

Dependencies

Following are the major dependencies of the project:

  • axios
  • react
  • react-dom
  • react-router-dom
  • sass
  • bcrypt
  • dotenv
  • cors
  • dotenv
  • express
  • jsonwebtoken
  • mongoose

Dev-dependencies

Following are the major dev-dependencies of the project:

  • nodemon

Prerequisites

  • Node.js must be installed on the system.
  • You should have a MongoDB database.
  • You should have a code editor (preferred: VS Code)

Installation and Setup

  1. Install all the dependencies

    npm run install-all
  2. Create a file named ".env" inside the Config folder of backend. Add data from .env.example file and substitute your credentials there.

  3. Start the application

    npm run dev
  4. Go to http://localhost:3000

Backend API

- POST     /api/auth/register
- POST     /api/auth/login
- GET      /api/posts
- POST     /api/posts
- GET      /api/posts/:postId
- PUT      /api/posts/:postId
- DELETE   /api/tasks/:postId

Frontend pages

- /                 Home Screen (Public home page for guests and private dashboard (tasks) for logged-in users)
- /register           Signup page
- /login            Login page
- /write        Add new post
- /post/postId   post Details
- /write/?edit=2   update a post

npm scripts

At root:

  • npm run dev: Starts both backend and frontend
  • npm run dev-server: Starts only backend
  • npm run dev-client: Starts only frontend
  • npm run install-all: Installs all dependencies and dev-dependencies required at root, at frontend and at backend.

Inside frontend folder:

  • npm start: Starts frontend in development mode
  • npm run build: Builds the frontend for production to the build folder
  • npm test: Launches the test runner in the interactive watch mode
  • npm run eject: This will remove the single build dependency from the frontend.

Inside backend folder:

  • npm run dev: Starts backend using nodemon.
  • npm start: Starts backend without nodemon.

Useful Links

blogapp2's People

Contributors

sachinsingh3232 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.