https://github.com/dhi13man/answering-forum-backend
A Node.js Express backend for a Stackoverflow like answering forum, with RESTful endpoints, written in es6 style with linted and comprehensively unit-tested code. Utilizes a local json database using fs but has full separation of concern to implement anything else.
https://github.com/dhi13man/answering-forum-backend
babel backend backend-api es6 eslint express express-middleware express-router filesystem fs javascript jest json jwt model-view-controller node node-js nodejs rest-api unit-testing
Last synced: 2 months ago
JSON representation
A Node.js Express backend for a Stackoverflow like answering forum, with RESTful endpoints, written in es6 style with linted and comprehensively unit-tested code. Utilizes a local json database using fs but has full separation of concern to implement anything else.
- Host: GitHub
- URL: https://github.com/dhi13man/answering-forum-backend
- Owner: Dhi13man
- License: mit
- Created: 2022-01-06T14:03:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-09T06:25:35.000Z (over 4 years ago)
- Last Synced: 2026-01-03T16:27:39.894Z (5 months ago)
- Topics: babel, backend, backend-api, es6, eslint, express, express-middleware, express-router, filesystem, fs, javascript, jest, json, jwt, model-view-controller, node, node-js, nodejs, rest-api, unit-testing
- Language: JavaScript
- Homepage:
- Size: 696 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# answering-forum-backend
[](https://github.com/Dhi13man/answering-forum-backend/blob/main/LICENSE)
[](https://github.com/Dhi13man/answering-forum-backend/graphs/contributors)
[](https://github.com/Dhi13man/answering-forum-backend/network/members)
[](https://github.com/Dhi13man/answering-forum-backend/stargazers)
[](https://github.com/Dhi13man/answering-forum-backend/commits/main)
[](https://github.com/Dhi13man/answering-forum-backend/actions)
A Node.js Express backend for a Stackoverflow like answering forum, with RESTful endpoints, written in es6 style with linted and comprehensively unit-tested code. Utilizes a local json database using fs but has full separation of concern to implement anything else.
Created as a part of week 0 of Swiggy i++ learning programme, round 2.
## Contents
- [answering-forum-backend](#answering-forum-backend)
- [Contents](#contents)
- [Setup](#setup)
- [Usage](#usage)
- [Project Structure](#project-structure)
- [License](#license)
- [Contributing](#contributing)
- [Tests](#tests)
## Setup
1. Install [NodeJS](https://nodejs.org/en/) and any NodeJS package manager.
- [npm](https://www.npmjs.com/)
- [yarn](https://yarnpkg.com/)
2. Run `npm install` or `yarn install` to install the dependencies.
3. Run `npm run build` or `yarn build` once to let babel build the application on ./lib/.
## Usage
Run `npm run start` or `yarn start` after building to run the application on localhost:4000 (default).
### Project Structure
The project's code structure loosely follows MVC model while maintaing complete seperation of concern.
- answering-forum-backend
- src
- controllers
- login_post.js
- answers
- answer_post.js
- questions
- question_get.js
- question_post.js
- register_post.js
- database
- answers.json
- questions.json
- users.json
- models
- answer_data.js
- question_data.js
- user_data.js
- repositories
- answers.js
- questions.js
- users.js
- routes
- login.js
- question
- questionID
- answer.js
- index.js
- index.js
- register.js
- utils
- validators.js
- index.js
- tests
- controllers
- answer
- answer_post.test.js
- question
- question_get.test.js
- question_post.test.js
- login_post.test.js
- register_post.test.js
- database
- answers.test.json
- questions.test.json
- users.test.json
- repositories
- answers.test.js
- questions.test.js
- users.test.js
- .eslintrc.yml
- babel.config.json
- package.json
- package-lock.json
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/Dhi13man/answering-forum-backend/blob/main/LICENSE) for details.
## Contributing
Feel free to contribute pull requests, issues for either APIs or tests. See the [CONTRIBUTING.md](https://github.com/Dhi13man/answering-forum-backend/blob/main/CONTRIBUTING.md) for details.
## Tests
Run `npm test` or `yarn test` to run the unit tests. Feel free to add your own tests for better test coverage while contributing.