XOKP / Stack-Overflow-Clone

Clone project of a famous Q/A website for developers which is stackoverflow built in a MERN Stack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StackOverflowClone

Version NPM NODE MYSQL License

As the name suggests, this project is a clone of a famous Q/A website for professional and enthusiast programmers built solely by me using a completely different stack.

🆕 New Update: newly added features are mentioned in issue(#15)

Table of Contents

My Tech Stack (MERN)

Front-end

  • Front-end Framework: React.js (with Redux)
  • Styling: SASS and BOOTSTRAP

Back-end

  • For handling server requests: Node.js with Express.js Framework
  • As Database: MySQL
  • API tested using: POSTMAN

Original Tech Stack

  • For handling server requests: C#
  • As Database: Microsoft SQL Server
  • .NET as well

Contributing

  • Go to Contributing.md

Guidelines to setup

  1. Create a .env file and the format should be as given in .env.example.
  2. Run these commands then -
    npm run installDep (To install all the dependencies)
    
    npm run auditDep (Run this to audit fix all the vulnerabilities)
    
  3. Run databaseConfig.sql file in the mysql client
    source <file path>/databaseConfig.sql
    
  4. (Optional) Run seed.sql file in the mysql client for seed data
    source <file path>/seed.sql
    
    Note: Change the database name in databaseConfig.sql & seed.sql under USE command
  5. Start the servers
    Option 1 (for running both the servers simultaneously):
    
    npm run dev
    
    Option 2 (for running both the servers individually):
    
    npm run server (for backend server only)
    
    npm run client (for frontend server only)
    

NOTE: Might take sometime to start as there will be 2 servers running.

API Endpoints

Base Url - http://localhost:5000/api

Users

  • GET /auth
  • POST /auth
  • POST /users/:id
  • GET /users
  • GET /users/:id

Posts

  • GET /posts
  • GET /posts/top
  • GET /posts/tag/:tagname
  • GET /posts/:id
  • POST /posts/
  • DELETE /posts/:id

Answers

  • GET /posts/answers/:id
  • POST /posts/answers/:id
  • DELETE /posts/answers/:id

Comments

  • GET /posts/comments/:id
  • POST /posts/comments/:id
  • DELETE /posts/comments/:id

Tags

  • GET /tags
  • GET /tags/:tag_name

Future Scope

  • Setup Sequelize with MySQL in the API.
  • Deploy the database to cloud, API, and client-side.

DEMO

Video Last Updated on 18th July, 2020

IMAGES

About

Clone project of a famous Q/A website for developers which is stackoverflow built in a MERN Stack

License:MIT License


Languages

Language:JavaScript 74.9%Language:SCSS 23.7%Language:HTML 1.2%Language:CSS 0.2%Language:Shell 0.1%