Giter Site home page Giter Site logo

a7medayman6 / rest-fetch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adityabisoi/json-hub

0.0 0.0 0.0 848 KB

A REST API service for development and testing

License: GNU General Public License v3.0

TypeScript 80.77% Shell 1.08% Dockerfile 0.14% JavaScript 8.93% CSS 4.44% EJS 4.34% HTML 0.31%

rest-fetch's Introduction

About Us

GitHub contributors Issues PRs Forks Stars Join the chat at https://gitter.im/fetch-lobby/community

A community-owned REST API service for testers and developers. Fetch provides REST API endpoints for different types of placeholders, which can be easily used during testing and development without the need for creating sample data manually.

Technology Stack

  • MongoDB
  • Express
  • NodeJS
  • Typescript
  • CI/CD

Try it out

Installation

Before you setup project, make sure you have pre-commit installed on your machine. Skip the following if you have already installed.

There are 3 ways to install pre-commit package manager

  • Using pip:

$ pip install pre-commit

  • Using homebrew:

$ brew install pre-commit

  • Using conda (via conda-forge):

$ conda install -c conda-forge pre-commit

After completing the above steps, verify your installation by running

$ pre-commit --version

Maintaining Consistency

It is absolutely necessary for us to maintain consistent coding styles for multiple developers working on this same project across various editors and IDEs. We have created a editorconfig file and urge you to download editorconfig plugin before further installation.

Setup for 3 major editors

  • For vscode

    • Download the following plugin on your editor
  • For atom

    • Download the following plugin on your editor
  • For Sublime text

    • Download the following plugin on your editor

Project Installation

There are two ways of installing the project on your local Machine ๐Ÿš€

  • Using Docker

    • Fork and clone the project
    • Install and configure your Docker, following this.
    • Rename .env.example to .env.
    • Install the git hook scripts
      • pre-commit install on terminal
    • Once docker is installed run the followig commands.
      • docker-compose build
      • Once the build is complete, run docker-compose up
  • Conventional Setup

    • Fork and clone the project
    • cd fetch/ and run npm install to install dependencies
    • Setup mongodb atlas following this tutorial
    • Enter the credentials in .env.example and rename it to .env.
    • Make sure to set USE_DOCKER= false in .env file.
    • Install the git hook scripts
      • pre-commit install on terminal
    • Run npm run dev to run the project in development

Installation of mongoDB in different OS and its set-up instructions

Windows

  • Install MongoDB Community Edition using the MongoDB Installer wizard which installs both the MongoDB binaries as well as the default configuration file \bin\mongod.cfg.
  • Download the installer which is the MongoDB Community .msi installer
  • Run the MongoDB installer.
  • Follow the MongoDB Community Edition installation wizard.
    • Choose Setup Type the Complete Custom setup type which installs MongoDB and the MongoDB tools to the default location.
    • Starting in MongoDB 4.0,configure and start MongoDB as a Windows service during the install and the MongoDB service is started upon successful installation.
  • To begin using MongoDB, connect a <mongo.exe shell> to the running MongoDB instance.
    • From Windows Explorer/File Explorer, go to <C:\Program Files\MongoDB\Server\4.4\bin\ directory> and double-click on mongo.exe.
  • The MongoDB instance is configured using the configuration file \bin\mongod. cfg.
  • Run MongoDB Community Edition as a Windows Service.

Linux

  • Update the packages list and install the mongodb-org meta-package
    • Run $ sudo apt update
  • To install mongoDB
    • Run $ sudo apt install mongodb-org
  • To start MongoDB service
    • Run $ sudo systemctl start mongod.service
  • To start the service on boot
    • Run $ sudo systemctl enable mongod
  • To know the status of the service
    • Run $ sudo systemctl status mongod

Mac

  • Install and Run MongoDB with Homebrew
  • Open the Terminal app and type $ brew update
  • After updating Homebrew use $ brew install mongodb
  • After downloading Mongo,create the โ€œdbโ€ directory where the Mongo data files will live in the default location by running <mkdir -p /data/db>
  • Run sudo chown -R id -un /data/db and enter your password for checking that that the </data/db
    directory> has the right permissions.
  • Run the Mongo daemon which starts the Mongo server
    • $ run mongod
  • Run the Mongo shell with the Mongo daemon running in one terminal,type mongo in another terminal window which runs the Mongo shell which is an application to access data in MongoDB.
  • To exit the Mongo shell run quit()
  • To stop the Mongo daemon hit ctrl-c

Documentation on setting up ESLint in VSCode

  • Go to VSCode
  • Extensions (on left sidebar)
  • Search for ESLint
  • Install the extension
  • Enable it across the JavaScript project

Testing

  • The endpoint usertest which follows the same schema as the users/ endpoint, must be used for testing
  • All other endpoints except usertest should involve methods which must not change the data on the server (read-only)
  • To test the endpoints provided by the application, tools such as postman can be used

Documentation

To understand the aim, scope and technologies used in the project, please see the documentation

Help & support

If you are stuck somewhere or do not understand what to do, feel free to reach out to mentors/ admin in discord.

Contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please refer the contribution guideline before making any contribution.

Contributors

License

This project is licensed under the GPL V3 License - see the LICENSE.md file for details

rest-fetch's People

Contributors

a7medayman6 avatar adityabisoi avatar ahk4815 avatar akshay1027 avatar anjali041 avatar ashukv avatar chiragasawa avatar eanimesha avatar gitter-badger avatar jain-rishabh-21 avatar kartikpuri99 avatar khareyash05 avatar muthuannamalai12 avatar paramsiddharth avatar rithgan avatar ritik307 avatar rohan-kulkarni-25 avatar samridhi-98 avatar shauryaag avatar subhangi2731 avatar sukriti-sood avatar tejan-singh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.