shrey0511 / Mern-Blog-Website

Blog website built using MERN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MERN Blog Website

This is a full-stack application built with React and Express that demonstrates user authentication.

Features

  • User registration
  • User login
  • Protected routes

Technologies Used

  • React
  • Express
  • MongoDB
  • JWT for authentication

Setup Instructions

Prerequisites

Make sure you have the following installed on your system:

  • Node.js
  • npm (Node Package Manager)
  • yarn (optional, but recommended for frontend dependency management)

Cloning the Repository

Clone the repository using the following command:

git clone https://github.com/shrey0511/Mern-Blog-Website-app.git

Backend Setup

  1. Navigate to the backend directory:
cd Mern-Blog-Website/api
  1. Install backend dependencies:
npm install
  1. Create a .env file in the backend directory with the following content:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
  1. Start the backend server:
nodemon index.js

Frontend Setup

  1. Navigate to the frontend directory:
cd ../client
  1. Install frontend dependencies:
yarn install
  1. Start the frontend development server:
yarn start
  1. Open your browser and go to http://localhost:3000.

Usage

  1. Register a new user.
  2. Login with the registered user credentials.
  3. Access protected routes after logging in.

Requirements

Ensure you have the required dependencies by using the provided requirements.txt files for both backend and frontend.

Backend Dependencies

express
mongoose
dotenv
jsonwebtoken
nodemon

Frontend Dependencies

react
react-dom
react-router-dom
axios

To install all required dependencies for the backend and frontend, you can use the following commands:

cd Mern-Blog-Website/api
xargs -a requirements.txt -n 1 npm install

cd ../client
xargs -a requirements.txt -n 1 yarn add

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions, suggestions, or feedback, feel free to contact the repository maintainer:

Thank you for visiting this repository! We hope you find it useful and informative. Happy coding!

About

Blog website built using MERN


Languages

Language:JavaScript 82.4%Language:CSS 11.5%Language:HTML 6.1%