A Mock API made with JSON Server by Typicode for Full Throttle Lab Assessment Project.
A JSON based Backend for Member Activity Viewer Application
Data Generated from Mockaroo Realistic Data Generator
-
Generated Fake Data using Mockaroo, the template is displayed above.
-
As the end_time should be greater then the
start_time
& mockaroo had no such method to generaterelative datetime
, I made custom python script to generaterandom end_time
(greater thanstart_time
but closer to 1-4 hours) for each member's eachactivity_periods
entry. Thus convertingdb_unstructured.json
todb_structured.json
file usinggenerate_end_time.py
. -
Later realized that this structure itself is not suitable as per
JSON Specifications
to have multiple endpoints for fetching data. So in order to make it suitable forjson-server
, I created another python script to restructure the JSON File by separating theactivity_period
as a separate entity in another collection calleddb.activity_periods
having entries with relationship todb.members
collection using a foreign key calledmemberId
. Thus convertingdb_structured.json
todb.json
usingrestructuring_json.py
that will be used byjson-server
to autocreate a JSON API Server. -
Deployed the server on repl at this link.
-
The Frontend Site that uses this mock API is deployed on netlify at this link and a private github repository.
-
Note : Use this link to get JSON similar to Sample File : https://json-server.cyogian.repl.co/members?_embed=activity_periods
-
Started Mocking...