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.
- MongoDB
- Express
- NodeJS
- Typescript
- CI/CD
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
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
There are two ways of installing the project on your local Machine ๐
-
Using Docker
-
Conventional Setup
- Fork and clone the project
cd fetch/
and runnpm 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
- 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.
- Update the packages list and install the mongodb-org meta-package
- Run
$ sudo apt update
- Run
- To install mongoDB
- Run
$ sudo apt install mongodb-org
- Run
- To start MongoDB service
- Run
$ sudo systemctl start mongod.service
- Run
- To start the service on boot
- Run
$ sudo systemctl enable mongod
- Run
- To know the status of the service
- Run
$ sudo systemctl status mongod
- Run
- 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
- Go to VSCode
- Extensions (on left sidebar)
- Search for ESLint
- Install the extension
- Enable it across the JavaScript project
- The endpoint
usertest
which follows the same schema as theusers/
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
To understand the aim, scope and technologies used in the project, please see the documentation
If you are stuck somewhere or do not understand what to do, feel free to reach out to mentors/ admin in discord.
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.
|
This project is licensed under the GPL V3 License - see the LICENSE.md file for details