Giter Site home page Giter Site logo

wtc-test's Introduction

Specifications:

Develop an endpoint /user/:id that get and edit the user profile (Name, Email, Avatar)

URL: /user/:id

GET - to get user account

in: id (as parameter)
out: success, name, email, avatar  

POST: - to update and create a user account

in: id (to update), name, email, avatar  

For code, see server/api/getUser.js

We will need a frontend interface to display and edit the user profile

http://localhost:3000/#/createUser --> creates user  
http://localhost:3000/#/getUser --> gets user, edits user if found  

For code, see app/components

On the frontend, we need to be able to display and edit the user profile offline.

You can both create a user offline, as well as update a user profile offline (after getting it). First, get a user details (http://localhost:3000/#/getUser), then update name, email and avatar. Offline functionality was built using a service worker (https://developers.google.com/web/fundamentals/primers/service-workers/).
For code, see public/sw.js

We need to be able to have the user profile synchronized between the frontend and the backend when we or online

Any POST request made when the user is offline is queued up in IndexedDB. Any time connectivity is re-established, those requests are re-played, which allows the user profile to be synchronized when the user is back online.

Instructions

Install

make sure MongoDB is running on port 27017
npm install -g webpack
npm install

Run

npm start

wtc-test's People

Contributors

gadicohen93 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.