This project showcases how to use centralized mock data using React. A centralized mock data file drives three different use cases:
- Storybook stories
- Automated tests
- The app
npm install
npm start // Run app
npm t // Run tests
npm run storybook // Run storybook
- Experiment with data structures before creating an actual API
- Start coding before the API is completed
- Avoid redundant hard coding for each scenario above, or the maintainance of standing up a mock DB.
- High performance since the data is local
- No network connection needed for development of tests, stories, or the real app
Don't want to create hard coded data? Want to simulate creates, updates, and deletes? Create a mock API using json-server and json-schema-faker.