App that displays a searchable and sortable table of savings
Programming assignment:
Make a React app that fetches JSON data, and displays it in a table.
Features:
- Use responsive web design (RWD).
- Make sure the page can fit a minimum of 650 pixels.
- Do not break long lines, but clip them instead.
- Allow sorting by project ID.
- Allow seaching by description, case-insensitively.
- Show dates in format: "DD.MM.YYYY".
- Show "NULL" values as empty cells.
- Make unit tests.
Note: Since cutting text that does not fit is generally a bad practice, I mitigated it my adding tooltips with the full text.
- Next.js, which includes:
- Enzyme
- ESLint
- Isomorphic Unfetch
- Jest
- Material-UI
- MUI-Datatables
- Moment.js
- React Test Renderer
- remark-lint
Steps:
- Install:
- Run-time environment:
- Node.js 8.x
- (Recommended) Install using Node Version Manager (NVM) (or its Windows-equivalents).
- Node.js 8.x
- Web browser:
- Mozilla Firefox (latest)
or - Chromium / Google Chrome (latest)
- Mozilla Firefox (latest)
- Run-time environment:
- Open a command-line in the root of the project directory.
- Run
npm install
. - Run
npm run dev
. - Open a web browser, and navigate to: http://localhost:3000.
Run: npm test
.
Run: npm run lint
.
- To create the production build, run:
npm run build
. - To run it, run:
npm run start
.
- Make a production build.
- Run:
npm run start
, and leave it running. - Open a new terminal, and run:
npm run export
.
This will create a static HTML export in the out
directory.
The export can then be served using an HTTP server, like Python's http.server.
To do so, run: python3 -m http.server 8000
in the out
directory.