Sign inSign up

oyedejipeace/stackoverflow-backend

By oyedejipeace

Updated almost 7 years ago

Image
0

1.0K

oyedejipeace/stackoverflow-backend repository overview

A StackOverflow Backend Challenge

Build Status

Table of Contents

Project Overview

StackOverflow-Backend is the backend implementation of a simple clone of Stackoverflow. It was built from scratch using MongoDB , mongoosejs , JavaScript and Node.js

Features

  • Users can register/login using website custom forms, or through facebook
  • Users can ask questions
  • Users can view questions.
  • Users can upvote or downvote questions
  • Users can answer questions
  • Users can search for questions, answers and other users
  • Users can subscribe to questions

Built with

  • MongoDB
  • mongoosejs
  • JavaScript
  • Node.js
  • Express framework

Link to app on heroku.

API Documentation

POSTMAN API documentation here

API End Points

HTTPSENDPOINTDESCRIPTION
GET/Default route
POST/usersUser Registration
POSTusers/loginLogin User
POST/users/facebookSocial login
POST/questionsCreate a question
GET/questions/Fetch all questions
GET/questions/:questionIdFetch the details of a particular question
POST/questions/:questionId/upvoteUpvote a question
POST/questions/:questionId/downvoteDownvote a question
POST/questions/:questionId/answersAnswer a question
GET/searchSearch for questions, answers or users
POST/questions/:questionId/subscribeSubscribe to a question

Known issues

Everything works as expected; However:

  • This project is just a backend app, i.e. no frontend implementation.

Getting started

Prerequisites

In order to install and run this project locally, you would need to have the following installed on your local machine.

Installation
  • Clone this repository
	git clone https://github.com/oyedejipeace/stackoverflow-backend.git
  • Navigate to the project directory
	cd stackoverflow-backend
  • Run npm install or yarn to install the projects dependencies

  • create a .env file and copy the contents of the .env.sample file into it and supply the values for each variable

	cp .env.sample .env
  • Create a MongoDB database

  • Run npm run dev to start the app in development Once the server starts-up, you can query the api at http://localhost:3001/ using the end points stated above.

Docker

  • Build image

docker build -t stackoverflow-backend .

  • Run container docker run --rm -p 8000:80 stackoverflow-backend

Test

  • Run npm test or yarn test

Contributing

Feel free to 🍴 fork this repository

👯 Clone this repository to your local machine using https://github.com/fire-cracker/stackoverflow-backend.git

Make Contributions

🔃 Create a new pull request using https://github.com/oyedejipeace/stackoverflow-backend/compare

License

GitHub

Tag summary

Content type

Image

Digest

Size

372.2 MB

Last updated

almost 7 years ago

docker pull oyedejipeace/stackoverflow-backend