Code kata in JavaScript where you have to write a library of books and magazines.
-
You have exact 2.5 hours of time - no minute longer.
If you reach this time limit stop your work immediately.
It is one part of the kata to respect this time limit.
There are no restrictions on how to use the provided time.
If you want to code the entire time, take a break or a cigaret - it’s up to you. -
There is no complete or incomplete, most likely it'll be impossible to close all the tasks in the first run (that's the point of kata as a type of practice). Keep in mind following priorities though:
- Code quality and structure.
- Functionality.
- UI/UX.
-
This is a real world situation. You are allowed to consult the Internet, use every library you want, call a friend...
BUT you're NOT allowed to:- do pair programming
- have a look at your previous implementation of this kata if you've done it before
-
Given resources:
authors.csv
: Contains authors with itsemail
,firstName
andlastName
.books.csv
: Contains books with itstitle
,description
, one or moreauthors
and anisbn
.magazines.csv
: Contains magazines with itstitle
, one or moreauthors
, apublishedAt
and anisbn
.
-
Parse the data from the given CSV files in a meaningful structure.
-
Print out a merged list of books and magazines with all their details sorted by
title
. -
Implement search:
- By
isbn
. - By
authors
' email.
- By
-
Add unit tests.
-
Implement adding a book/magazine to the data structure of your software.
-
Implement exporting of the new list to a CSV file.
-
Get the code. There are several ways for it:
-
With fork (makes it possible to preserve your work):
- Fork this repository
- Clone this fork to your computer:
git clone <your github url> # Example: git clone https://github.com/echocat/javascript-kata-1.git
-
Just download it from here
-
-
Open in your favorite text editor/IDE.
-
Start the kata.
-
Discuss with your friends and/or colleges your solution.
-
Repeat after some days/weeks.
-
Install dependencies:
npm i
-
Run
start
script:npm run start
This command will run dev server. After this the project is accessible on http://localhost:9000/
Important!
react
andreact-dom
are already included inpackage.json
. If you want to use other libraries/frameworks, you have to install and include them manually.
-
webpack
for building and bundling:.js
and.css
files work out of the box.- entry point is
src/index.js
file. - bundle is being written in
dist/main.js
.
-
jest
for testing. -
eslint
for code checking. -
webpack-dev-server
for hacking:- configured to serve content of
dist
,data
andstatic
folders. If you run server, CSV files are gonna be available from the root, e.g.data/authors.csv
will be served over http://localhost:9000/authors.csv - supports live reload
- configured to serve content of
-
babel
for code transpiling:- preconfigured with
preset-env
andpreset-react
. plugin-transform-runtime
plugin to supportasync
/await
.
- preconfigured with
Hint: if you prefer using another build tool/bundler/test suite/etc: feel free to modify whatever you need.
For code check:
npm run lint
To fix the linting errors:
npm run lint:fix
npm run test
See LICENSE file.