Code-Challenge-ReactJS-SPA
Challenge 1:
Objective - Generate capital for applied learn & earn opportunities for gig workers in the Washington, DC area.
align digital infrastructure needs with local-first workforce development opportunities.
Goal - Define step-by-step process of cloning and exchanging endpoint.
Goal - Render data from a JSON REST API endpoint into a static frontend HTML webpage template.
Goal - Demonstrate that any frontend language can be used to fetch posts from an API endpoint across distributed network of repositories.
Goal - Map out all platform and package dependencies.
Other Challenge Ideas:
- Update implementation of this template and dependencies.
- Use a different JavaScript framework (other than React) to render posts from this endpoint. New repo will need to be cloned.
- Extend functionality of site by adding additional endpoints.
- Search and Filter posts by post categories.
- Add global CSS styling to all pages.
- Propose your own idea at coopdevcenter.org (coming soon)
Related Reading: https://smartbear.com/learn/performance-monitoring/api-endpoints/
Keywords: REST API, JSON, WordPress, Headless CMS, Micro-Frontend. JavaScript
Request to be added as a contributor to CrowdWork on GitHub to be added to the codesandbox.io project URL for live coding environment.
Changelog 0.2 - 0.1 - Replaced homepage content. Replaced REST endpoint to fetch dcstakeholders.coop posts
Thanks to the original code sponsors - Technical Documentation Below.
Create an single page app using the WordPress REST API and Create React App.
Clone the repo:
git clone [email protected]:gregrickaby/React-WordPress-API-Demo.git
Install dependencies:
cd React-WordPress-API-Demo && yarn
Start dev server:
yarn start
Build a production ready app:
yarn build
It's because your web broswer is blocking CORS. Disable tracking protection in Firefox and/or any ad blockers.
- Open
/src/config.js
- Change
wordPressURL
to match your website
options: {
wordPressUrl: "https://YOUR-WORDPRESS-WEBSITE-URL/wp-json/wp/v2/posts",
},
- Run
yarn start
oryarn build
to view your data
Built with Create React App, WordPress, and hosted on Netlify