Skip to content

fire-cracker/stackoverflow-backend

Repository files navigation

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

APP Link

Link to app on heroku.

API Documentation

POSTMAN API documentation here

API End Points

HTTPS ENDPOINT DESCRIPTION
GET / Default route
POST /users User Registration
POST users/login Login User
POST /users/facebook Social login
POST /questions Create a question
GET /questions/ Fetch all questions
GET /questions/:questionId Fetch the details of a particular question
POST /questions/:questionId/upvote Upvote a question
POST /questions/:questionId/downvote Downvote a question
POST /questions/:questionId/answers Answer a question
GET /search Search for questions, answers or users
POST /questions/:questionId/subscribe Subscribe 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

About

Backend implementation of a simple clone of Stackoverflow

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages