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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

answering-forum-backend

License Contributors GitHub forks GitHub Repo stars Last Commit Node.js CI

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

Setup

  1. Install NodeJS and any NodeJS package manager.

  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 for details.

Contributing

Feel free to contribute pull requests, issues for either APIs or tests. See the 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.

About

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.

License:MIT License


Languages

Language:JavaScript 100.0%