Skip to content

Accept Adapt challenge by Sirnimu #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
npm-debug.log
node_modules
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Seems like you're trying out for a position at
[Adapt](https://adapt.dk/en) or you've found this and would like to
apply. Fork this repo and go at it ;)
apply. Fork this repo and go at it ;)

Your goal is to set up a React application, where users will be able to
edit book info (and create new books, if you have enough time to
Expand All @@ -23,15 +23,15 @@ to date. The form should be split into three steps:

## Requirements

* All steps should be visible on the screen and changable at all times
(when they are available -- step 1 when nothing is picked, step 1
and 2 when step 1 is picked and step 1, 2 and 3 when step 2 is
picked).
- All steps should be visible on the screen and changable at all times
(when they are available -- step 1 when nothing is picked, step 1
and 2 when step 1 is picked and step 1, 2 and 3 when step 2 is
picked).

* You can use whatever libraries, task runners and build processes you
like. React and plain JavaScript are the only requirements (ES6
encouraged, but no TypeScript, CoffeeScript, etc). Redux is strongly
encouraged if you see a need for it.
- You can use whatever libraries, task runners and build processes you
like. React and plain JavaScript are the only requirements (ES6
encouraged, but no TypeScript, CoffeeScript, etc). Redux is strongly
encouraged if you see a need for it.

### Suggested order of completion

Expand All @@ -46,16 +46,14 @@ unless they are marked as optional.

## API Usage

API can be launched using `npm start`. You will need to run `npm
install` once starting working on the project to install dependencies.
API can be launched using `npm start`. You will need to run `npm install` once starting working on the project to install dependencies.

| Endpoint | Result |
|------------------------------|-----------------------------------------------------|
| ---------------------------- | --------------------------------------------------- |
| /books?subjects_like=Fiction | Lists all books that contain "Fiction" as a subject |
| /subjects | Lists all available subjects |

---

More info about API usage can be found at the [json-server
repo](https://github.com/typicode/json-server).

207 changes: 95 additions & 112 deletions api.json
Original file line number Diff line number Diff line change
@@ -1,120 +1,103 @@
{
"subjects": ["Fiction", "Science"],
"books": [
{
"id":1342,
"authors":[
{
"birth_year":1775,
"death_year":1817,
"name":"Austen, Jane"
}
],
"bookshelves":[
"Best Books Ever Listings",
"Harvard Classics"
],
"download_count":45668,
"formats":{
"text/plain; charset=utf-8":"http://www.gutenberg.org/files/1342/1342-0.txt",
"application/pdf":"http://www.gutenberg.org/files/1342/1342-pdf.pdf",
"application/rdf+xml":"http://www.gutenberg.org/ebooks/1342.rdf",
"application/x-mobipocket-ebook":"http://www.gutenberg.org/ebooks/1342.kindle.noimages",
"application/epub+zip":"http://www.gutenberg.org/ebooks/1342.epub.images",
"text/plain; charset=us-ascii":"http://www.gutenberg.org/files/1342/1342.txt",
"text/html; charset=utf-8":"http://www.gutenberg.org/files/1342/1342-h/1342-h.htm"
},
"languages":[
"en"
],
"media_type":"Text",
"subjects": ["Fiction"],
"title":"Pride and Prejudice"
{
"id": 1342,
"authors": [
{
"birth_year": 1775,
"death_year": 1817,
"name": "Austen, Jane"
}
],
"bookshelves": ["Best Books Ever Listings", "Harvard Classics"],
"download_count": 45668,
"formats": {
"text/plain; charset=utf-8": "http://www.gutenberg.org/files/1342/1342-0.txt",
"application/pdf": "http://www.gutenberg.org/files/1342/1342-pdf.pdf",
"application/rdf+xml": "http://www.gutenberg.org/ebooks/1342.rdf",
"application/x-mobipocket-ebook": "http://www.gutenberg.org/ebooks/1342.kindle.noimages",
"application/epub+zip": "http://www.gutenberg.org/ebooks/1342.epub.images",
"text/plain; charset=us-ascii": "http://www.gutenberg.org/files/1342/1342.txt",
"text/html; charset=utf-8": "http://www.gutenberg.org/files/1342/1342-h/1342-h.htm"
},
{
"id":33283,
"authors":[
{
"birth_year":1851,
"death_year":1916,
"name":"Thompson, Silvanus P. (Silvanus Phillips)"
}
],
"bookshelves":[
"Mathematics"
],
"download_count":24344,
"formats":{
"application/prs.tex":"http://www.gutenberg.org/files/33283/33283-t.zip",
"application/rdf+xml":"http://www.gutenberg.org/ebooks/33283.rdf",
"application/pdf":"http://www.gutenberg.org/files/33283/33283-pdf.pdf"
},
"languages":[
"en"
],
"media_type":"Text",
"subjects": ["Fiction"],
"title":"Calculus Made Easy: Being a very-simplest introduction to those beautiful methods which are generally called by the terrifying names of the Differential Calculus and the Integral Calculus"
"languages": ["en"],
"media_type": "Text",
"subjects": ["Fiction"],
"title": "Pride and Prejudice"
},
{
"id": 33283,
"authors": [
{
"birth_year": 1851,
"death_year": 1916,
"name": "Thompson, Silvanus P. (Silvanus Phillips)"
}
],
"bookshelves": ["Mathematics"],
"download_count": 24344,
"formats": {
"application/prs.tex": "http://www.gutenberg.org/files/33283/33283-t.zip",
"application/rdf+xml": "http://www.gutenberg.org/ebooks/33283.rdf",
"application/pdf": "http://www.gutenberg.org/files/33283/33283-pdf.pdf"
},
{
"id":11,
"authors":[
{
"birth_year":1832,
"death_year":1898,
"name":"Carroll, Lewis"
}
],
"bookshelves":[
"Children's Literature"
],
"download_count":17866,
"formats":{
"text/plain; charset=utf-8":"http://www.gutenberg.org/files/11/11-0.zip",
"application/rdf+xml":"http://www.gutenberg.org/ebooks/11.rdf",
"application/pdf":"http://www.gutenberg.org/files/11/11-pdf.pdf",
"application/x-mobipocket-ebook":"http://www.gutenberg.org/ebooks/11.kindle.noimages",
"application/epub+zip":"http://www.gutenberg.org/ebooks/11.epub.images",
"text/plain; charset=us-ascii":"http://www.gutenberg.org/files/11/11.zip",
"application/zip":"http://www.gutenberg.org/files/11/11-h.zip",
"text/html; charset=utf-8":"http://www.gutenberg.org/files/11/11-h/11-h.htm"
},
"languages":[
"en"
],
"media_type":"Text",
"subjects": ["Fiction", "Science"],
"title":"Alice's Adventures in Wonderland"
"languages": ["en"],
"media_type": "Text",
"subjects": ["Science"],
"title": "Calculus Made Easy: Being a very-simplest introduction to those beautiful methods which are generally called by the terrifying names of the Differential Calculus and the Integral Calculus"
},
{
"id": 11,
"authors": [
{
"birth_year": 1832,
"death_year": 1898,
"name": "Carroll, Lewis"
}
],
"bookshelves": ["Children's Literature"],
"download_count": 17866,
"formats": {
"text/plain; charset=utf-8": "http://www.gutenberg.org/files/11/11-0.zip",
"application/rdf+xml": "http://www.gutenberg.org/ebooks/11.rdf",
"application/pdf": "http://www.gutenberg.org/files/11/11-pdf.pdf",
"application/x-mobipocket-ebook": "http://www.gutenberg.org/ebooks/11.kindle.noimages",
"application/epub+zip": "http://www.gutenberg.org/ebooks/11.epub.images",
"text/plain; charset=us-ascii": "http://www.gutenberg.org/files/11/11.zip",
"application/zip": "http://www.gutenberg.org/files/11/11-h.zip",
"text/html; charset=utf-8": "http://www.gutenberg.org/files/11/11-h/11-h.htm"
},
{
"id":74,
"authors":[
{
"birth_year":1835,
"death_year":1910,
"name":"Twain, Mark"
}
],
"bookshelves":[
"Banned Books from Anne Haight's list"
],
"download_count":16204,
"formats":{
"image/jpeg":"http://www.gutenberg.org/cache/epub/74/pg74.cover.medium.jpg",
"text/plain; charset=utf-8":"http://www.gutenberg.org/files/74/74-0.zip",
"application/rdf+xml":"http://www.gutenberg.org/ebooks/74.rdf",
"application/x-mobipocket-ebook":"http://www.gutenberg.org/ebooks/74.kindle.images",
"application/epub+zip":"http://www.gutenberg.org/ebooks/74.epub.noimages",
"text/html; charset=utf-8":"http://www.gutenberg.org/files/74/74-h/74-h.htm",
"text/plain; charset=iso-8859-1":"http://www.gutenberg.org/files/74/74.txt",
"application/zip":"http://www.gutenberg.org/files/74/74.zip"
},
"languages":[
"en"
],
"media_type":"Text",
"subjects": ["Science"],
"title":"The Adventures of Tom Sawyer"
}
"languages": ["en"],
"media_type": "Text",
"subjects": ["Fiction"],
"title": "Alice's Adventures in Wonderland"
},
{
"id": 74,
"authors": [
{
"birth_year": 1835,
"death_year": 1910,
"name": "Twain, Mark"
}
],
"bookshelves": ["Banned Books from Anne Haight's list"],
"download_count": 16204,
"formats": {
"image/jpeg": "http://www.gutenberg.org/cache/epub/74/pg74.cover.medium.jpg",
"text/plain; charset=utf-8": "http://www.gutenberg.org/files/74/74-0.zip",
"application/rdf+xml": "http://www.gutenberg.org/ebooks/74.rdf",
"application/x-mobipocket-ebook": "http://www.gutenberg.org/ebooks/74.kindle.images",
"application/epub+zip": "http://www.gutenberg.org/ebooks/74.epub.noimages",
"text/html; charset=utf-8": "http://www.gutenberg.org/files/74/74-h/74-h.htm",
"text/plain; charset=iso-8859-1": "http://www.gutenberg.org/files/74/74.txt",
"application/zip": "http://www.gutenberg.org/files/74/74.zip"
},
"languages": ["en"],
"media_type": "Text",
"subjects": ["Science", "Fiction"],
"title": "The Adventures of Tom Sawyer"
}
]
}
Loading