Skip to content

imkaranks/mern-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Desktop Preview

MERN Blog

 

A simple blog website built using MERN stack

MongoDB Express ReactJS NodeJS Mongoose JWT TailwindCSS
 

Table Of Content

Built Using

Getting Started

First install the required dependencies:

npm install

Then, run the development server in both backend and frontend folder:

npm run dev

Environment Variables

The dotenv package is a helpful tool when working with sensitive data such as API keys, passwords, and other configuration variables that should not be hard-coded into your code. It allows you to load environment variables from a .env file into Node.js process.env object.

To use dotenv, create a .env file in the root directory of backend folder and define your environment variables in it using the KEY=VALUE syntax. Required variables to be initialized given below:

PORT=3000

MONGO_URI=

JWT_SECRET=

JWT_EXPIRY=

Note: If app didn't work, try restarting backend server.