/Mocked-API

An API library of useful mocked endpoints to help you get your designs feeling lifelike with real data.

Primary LanguageTypeScriptMIT LicenseMIT

All Contributors

Mocked-API

About

Welcome to Mocked-API, this is a live API that can be accessed by anyone who needs data to test out their website, app, components etc.

Hacktoberfest Contributors

If you would like to contribute during Hacktoberfest please following our contribution guidelines (Which we are still working on) but here is a quick summary of what we expect in the process of dev to raising your PR.

  1. Find a ticket and ask to be assigned, once assigned start work. :) This is so we don't get multiple PR's for the same issue.
  2. Please branch from our active next release dev
  3. Please make sure your new endpoints all have OpenAPI Comments as they will be used to generate our swagger documentation.
  4. Please make sure you have added unit tests for end points and util functions.
  5. MOST importantly, have fun.

If you need help, please leave a comment on the ticket you are assigned to our join our discord by clicking the link below.

Getting Started

First you should head over to https://api.mocked-api.dev and read our live api docs than start calling the api endpoints for the data you need.

Join our discord

Join Our Discord

How to run Mocked-API

Once you've cloned this repository, running Mocked-API is quite easy, there are just 2 steps you have to follow:

  1. Install the dependencies
npm install
  1. Configure the application An example configuration file .env.example is provided.
npm run config
  1. Serve the application
npm run serve

This will show you where the application is running

Mock API is running on port 3000.

Getting Started (Docker)

  1. Ensure you have Docker installed
  2. Open your terminal/command line tool
  3. Run docker-compose up
  4. Open your browser to http://localhost:3000/

Now you should be able to make any request to that port, and get a response back!

💡 If you browse to that port, you'll see our swagger documentation.

Testing

How to write tests

For each module you create you will also need to create a tests folder, Inside this folder there should be a api and utils (if you create any utils) folder.

The utils tests are fairly simple jests tests, the api routes tests are slightly different where you will need to add

import request from 'supertest';
import app from 'path/to/app';

to your tests and make a request in your test instead of calling a normal function.

How to run tests

run npm test run npm run test:watch to run the tests in watch mode.

FAQ

Q: Are you planning to add more end points?
A: I plan to add as many as I can, if there is a specific endpoint of data you would like to see feel free to add a Issue Request.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

I encourage you to contribute to Mocked-API! Feel free to fork the codebase and make a pull request for your changes.

Our contributing guide is currently WIP and available here CONTRIBUTING GUIDE

We use semantic commit messages

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Sponsor

Do you like this project? Support it by donating.

Buy Me A Coffee

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Ahmed Silat
Ahmed Silat

💻
Yasio
Yasio

💻
Alberto Herrera Vargas
Alberto Herrera Vargas

📖
Coşkun Atak
Coşkun Atak

💻
Rizky ian indiarto
Rizky ian indiarto

💻
Evan
Evan

💻
Trigstur
Trigstur

💻
fadkeabhi
fadkeabhi

💻
Thomas Martin
Thomas Martin

💻 ⚠️
Vu
Vu

💻 📖
Kalwabed Rizki
Kalwabed Rizki

⚠️
Talison Fabio
Talison Fabio

💻
Chris Jones
Chris Jones

🔧
jkol7
jkol7

💻
Siddharth Pandey
Siddharth Pandey

💻
Alex Harrison
Alex Harrison

💻
Derzan Chiang
Derzan Chiang

💻
ATH
ATH

📖
Suraj Bhandarkar S
Suraj Bhandarkar S

⚠️
Fernando Guerrero
Fernando Guerrero

📖 ⚠️
Anish De
Anish De

📖
Vaibhav Garje
Vaibhav Garje

💻 ⚠️
Mayank Singh
Mayank Singh

📖
Mike Hingley
Mike Hingley

💻
krishna
krishna

💻
Vadym Yatsyuk
Vadym Yatsyuk

📖
Nicholas Robert Beckham
Nicholas Robert Beckham

⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!