clay-assignment
A sample react assignment. Feel free to fork, copy and modify as needed.
Example
See https://clenemt.github.io/clay-assignment/ for a look at the code live. 🚀
How to
To run the sample locally, do the following:
npm install
npm run start
It will install dependencies, build the docs/
folder and launch a small server at localhost:9000.
Explanation
When launching the app for the first time, it will load the initial .json
s into your localstorage. Take a look at users.json or login with admin
/ root
.
It only runs thanks to:
- React Router v4 for handling the navigation
- store.js for the Cross-browser storage API
- webpack-dev-server for the simple http server
- Formik and Yup for the form validation
- axios for the promise based HTTP client
- mitt for the tiny event emitter
Attention: Since there is no real backend and because everything is stored inside your local storage, if you ever get stuck in a bad state or want the dummy data back, simply clear your local storage.
Guidelines
- Prettier is used for style consistencies in all files
- ESlint is used for linting the
.js
files - EditorConfig is used to enforce correct spacings on all files
- The above is enforced when you try to commit
- Commits should be in the form of:
<emoji> <title>
# 📝 Update README.md
# ✅ Add unit test for inputs
For ease of use you can use the template provided above. The following command will add it as default for this repo only:
git config commit.template .gitmessage
License
Licensed under MIT.