- Project Overview
- Features
- Built with
- APP Link
- API Documentation
- API End Points
- Known Issues
- Getting Started
- Prerequisites
- Installation
- Docker
- Test
- Contributing
- License
StackOverflow-Backend is the backend implementation of a simple clone of Stackoverflow. It was built from scratch using MongoDB
, mongoosejs
, JavaScript
and Node.js
- 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
MongoDB
mongoosejs
JavaScript
Node.js
Express framework
Link to app on heroku.
POSTMAN API documentation here
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 |
Everything works as expected; However:
- This project is just a backend app, i.e. no frontend implementation.
In order to install and run this project locally, you would need to have the following installed on your local machine.
- Clone this repository
git clone https://github.com/oyedejipeace/stackoverflow-backend.git
- Navigate to the project directory
cd stackoverflow-backend
-
Run
npm install
oryarn
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 athttp://localhost:3001/
using the end points stated above.
- Build image
docker build -t stackoverflow-backend .
- Run container
docker run --rm -p 8000:80 stackoverflow-backend
- Run
npm test
oryarn test
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
- MIT license
- Copyright 2018 © StackOverflow-Backend