Simplified clone of Stackoverflow. This repo holds the Server. See client here.
- NodeJs
- TypeScript
- Express
- MongoDB
- Mongoose
- node
- npm/yarn
- mongodb
# Clone this repository
$ git clone git@github.com:ajthinking/stackoverflow-server.git
# Go into the repository
$ cd stackoverflow-server
# Start mongodb locally
$ mongod
# Install dependencies
$ yarn install
# Start the backend server
$ yarn dev
# Your API should now be running, try:
$ open http://localhost:3000/api/question
Make sure mongodb is running before testing the server.
$ yarn test
There are missing tests.
-
You will need to have setup a MongoDB Atlas account and database.
-
Make sure that the cluster has allowlisted connections from anywhere.
-
Create a Heroku new app.
-
Go to app settings
-
Add the following enviroments.
- DATABASE_URL (to use your MongoDB connection string)
- JWT_SECRET
-
Add Nodejs to buildpacks
-
# Go into the repository $ cd stackoverflow-server # Heroku Setup $ yarn install -g heroku $ heroku login $ heroku git:remote -a your-app-name # push subdirectory repository with subtree $ git subtree push --prefix server heroku master
This is a continuation of salihozdemir/stackoverflow-clone
This project is made available under the MIT License.