Prabhav Negi - GitHub Externship Proposal #1627
prabhavnegi
started this conversation in
Externship
Replies: 1 comment
-
@prabhavnegi thanks for submitting the proposal. Can you list out which libraries, packages you're intended to use with this proposal? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Application number: 27-04_Pra447_tfa_258
Full name: Prabhav Singh Negi
E-mail: prabhav511@gmail.com
GitHub username: prabhavnegi
Prior experience:
Proposal type:
Proposal title: Mock Server
Proposal description: Implement a new section for mock server where user can create and simulate a real server to test and build an API. This section will have a simplified UI for the user to define their server and its behavior. Behind the scenes, Hoppscotch will perform various tasks to implement the server. It will create an openAPI/swagger .json and .yaml file from the inputs given by the user which can also be exported and can also import .json or openAPI specification files to directly build a server from it.
Mentioned below are few libraries to implement mock server -
1. json-server
2. mockserver
3. nise
4. sino
5. MockServer
There are two possible obstacle here -
1. As the above mentioned libraries require a NodeJS server to run and Hopscotch is a client side app
2. Making the implementation as simple and easy for a user.
The possible implementations -
To create a NodeJS server and host it online. Then when the user completes the procedure of creating a mock server, the JSON file generated will be written on Firebase. The user receives the Unique ID of the document created and will then use this unique id to connect to our NodeJS server.
Our Node server will have a endpoint say ' /:id '. When it gets a request from the user, it will check if the id given is present in Firebase database or not. If yes then it will fetch that JSON file and will provide it to the our mock server library and then our mock server will be ready for that user based on his/her configuration. The endpoint for the user will '/:id/url_defined_by_the_user'. If the request is a valid endpoint our Node server will run like a mock server. Once the user is done with their testing it will tell the server or firebase to delete the JSON file from the database. This will also delete our the mock server configuration and will also make the endpoint invalid. If the user forgets to trigger delete command, we can set our server to weekly check and delete old files so that their endpoints become invalid. This JSON file can then be used to create .yaml or openAPI/swagger file and can be exported before the user or the server deletes it.
This can work both locally and for Hoppscotch.io and the user doesn't need to login.
For the UI part we can build it like a form with a drop menu for different options to minimize typing so that the user has to select options more than typing them out.
Another implementation can be to make Hopscotch run with Nodejs simultaneously on same port. We can use Express with node.js server and build our app and use the Nodejs features too. I am searching all the possibilities with this implementation idea.
Proposal roadmap:
Beta Was this translation helpful? Give feedback.
All reactions