Based on the mail both tasks were completed.
Frontend challenge: https://github.com/squirro/frontend-coding-challenge
Backend challenge: Attached
This repository contains both frontend and backend projects for the Squirro coding challenge. The backend serves as a mock API for bookstores, and the frontend displays the best-selling books for each bookstore as provided by the backend.
The project is divided into two main directories:
frontend-coding-challenge
: Contains the frontend React application and the mock backend API.newyork_times
: Contains a Python script for fetching and processing articles from the New York Times API.
The frontend is built with React and fetches data from the mock backend to present a list of bookstores and their best-selling books.
- Navigate to
frontend-coding-challenge/bookstore-frontend
. - Run
npm install
to install dependencies. - Start the app with
npm start
.
A mock JSON:API server implemented in index.js
providing bookstore data.
- Navigate to
frontend-coding-challenge/book-store-api
. - Run
npm install
to install dependencies. - Start the server with
npm start
.
- Ensure the backend server is running before starting the frontend application.
- Adjust the API endpoints in the frontend configuration if backend runs on a different port or if you are using an external API service.
-
App that lists best-selling books for each bookstore: The frontend should make use of App.js and Bookstore.js to render this information.
-
JSON:API based application (Backend): The backend API is provided in index.js.
-
Wireframe representation: The frontend should match the wireframe provided in the task description.
-
Circle markers representation: Each requirement represented by the circle markers in the wireframe should be implemented.
-
Usage of the REST Countries API for flags: The App.js file contains a function that constructs the URL for the country flags, and Bookstore.js uses this URL to display the flag image.
-
output.png is the screenshot of the wireframe based frontend page.
A Python script for fetching and processing articles from the New York Times API.
- Ensure you have Python installed.
- Navigate to
newyork_times
. - Run
pip3 install -r requirements.txt
to install dependencies. - API-KEY-VALUE needs to be updated with key value in
NewYork.py
. - Execute the script with
python3 NewYork.py
.
Each part of the project includes its own README.md with detailed instructions. Please follow the instructions in each subdirectory to get each part of the project running.
-
New York Times API Utilization: The NewYork.py file you provided earlier appears to handle the communication with the New York Times API. It fetches articles based on a query and processes them in batches as required.
-
NYTimesSource Class Structure: The class in NewYork.py matches the expectation for a data loader plugin for the NY Times API.
-
Batched Results: The getDataBatch method in NewYork.py uses a generator to yield articles in batches.
-
Dictionary Flattening: The flatten_dict method in NewYork.py is implemented without third-party libraries, which satisfies the requirement.
-
No Third-Party Libraries for Flattening: Confirmed by reviewing NewYork.py; the flattening is custom-coded.
-
requirements.txt: This file is needed to specify dependencies. Since the requests library is used, this should be listed in requirements.txt.
-
output.txt has the output of the script execution.