Skip to content

dominikjalowiecki/MERN-forum

Repository files navigation

Preview project

MERN-forum

Full-stack MERN web application. Click here to preview.

Table of contents


Technologies

  • MongoDB
  • Express
  • React
  • Redux
  • NodeJS
  • Formik
  • Bootstrap
  • Winston
  • Docker

Features

  • User login
  • User registration
  • Create new post
  • Add comments to post

Setup

Clone repository

git clone https://github.com/dominikjalowiecki/MERN-forum.git

Change directory

cd ./MERN-forum

Setup .env file

DB_URI=<mongodb-uri>
PORT=5000
COOKIE_SECRET=secret_phrase
FRONTEND_BASE_URL=http://localhost:3000
NODE_ENV=development

Install dependencies

npm ci
cd ./client
npm ci

Run development servers

cd ..
npm run dev

OR

Run docker-compose "production" environment

docker compose up -d

Application available on http://localhost for frontend and http://localhost:5000 for backend.


REST API Endpoints

Endpoint Method Request body Authentication
/api/users/login POST email
password
-
/api/users/logout POST - -
/api/users/register POST username
email
password
confirmPassword
-
/api/users/me GET - +
/api/posts GET - -
/api/posts POST title
content
+
/api/posts/:id GET - -
/api/posts/:id/comments POST content +