Giter VIP home page Giter VIP logo

boredapi_fetcher's Introduction

Test task

Assignment: C++ Cross Platform

Problem Statement: Create a library in C++ that retrieves activities from the Bored API. Fetch the values from the server and provide a response in JSON format to the caller. Additionally add functionality to create and delete created activities (local storage only, not server) that can be utilized by a front end.

Requirements for success:

    • C++ layer: fetch activities from the API
    • C++ layer: add and delete activities in local storage
  1. Create 3 frontends (very simple one screen)
    1. iOS , 1 screen to display activities, both fetched and local, 1 screen to create an activity
    2. Android 1 screen to display activities, both fetched and local, 1 screen to create an activity
    3. React JS 1 screen to display activities, both fetched and local, 1 screen to create an activity

Note: the UI frontend is only to demonstrate how the native platform code, ie: swift, Kotlin/java & javascript interact with the C++ code that is written.

Repo will be updated tommorow.

What's missed in library: 1) data validation 2) tests 3) documentation 4) closing of all TODOes.

Multiplatform

  • Scapix will be used. It can automatically create bridge files for all platforms. It converts C++ data types to Kotlin, OBJ C, JS data types. And also it perfectly fits in CMake projects. So, I use the following algorithm to build a portable library.
  1. Creating an idiomatic C++ working draft of a library
  2. Looking at list of compatible types. And writing an API for a library.

And CMake will make the all the rest work for me. It will generate static lib files and launch Scapix, that will remade .h files.

Resources:

Sample Query:

http://www.boredapi.com/api/activity/

Response:

{
	"activity": "Learn Express.js",
	"accessibility": 0.25,
	"type": "education",
	"participants": 1,
	"price": 0.1,
	"link": "https://expressjs.com/",
	"key": "3943506"
} 

Tested on

  • Linux (Ubuntu 19.04)
  • Windows
  • MacOS

Requirements

Linux and MacOS

   If you are running UNIX based system. 
   Run "prepare.sh" and it will install vcpkg with needed packages.
   
   $ chmod +x prepare.sh
   $ ./prepare.sh
   $ mkdir build
   $ cd build
   $ cmake 

Build Requirements

boredapi_fetcher's People

Contributors

valkovich avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.