https://github.com/ajthinking/stackoverflow-server
https://github.com/ajthinking/stackoverflow-server
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ajthinking/stackoverflow-server
- Owner: ajthinking
- License: mit
- Created: 2022-11-05T08:27:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-05T09:32:42.000Z (over 3 years ago)
- Last Synced: 2025-02-11T10:47:24.529Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 99.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Stackoverflow: server :dizzy:
Simplified clone of Stackoverflow. This repo holds the _Server_. [See client here](https://github.com/ajthinking/stackoverflow-client).
## :rocket: Tech Stack
- NodeJs
- TypeScript
- Express
- MongoDB
- Mongoose
## :warning: Prerequisite
- node
- npm/yarn
- mongodb
## :cd: How to run local
```bash
# 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
```
## :mag_right: Testing
Make sure mongodb is running before testing the server.
```bash
$ yarn test
```
There are missing tests.
## :globe_with_meridians: Deploy
#### Deploying Server App on Heroku
- You will need to have setup a [MongoDB Atlas account and database](https://docs.atlas.mongodb.com/getting-started/).
- Make sure that the cluster has allowlisted connections from anywhere.
- Create a [Heroku](https://dashboard.heroku.com/new-app) 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
## :crown: Acknowledgments
This is a continuation of [salihozdemir/stackoverflow-clone](https://github.com/salihozdemir/stackoverflow-clone)
## :memo: License
This project is made available under the MIT License.