Git Product home page Git Product logo

project-102's Introduction

repository data is

[
  {
    "user_id": "583c3ac3f38e84297c002546",
    "email": "[email protected]",
    "name": "[email protected]",
    "given_name": "Hello",
    "family_name": "Test",
    "nickname": "test",
    "last_ip": "94.121.163.63",
    "logins_count": 15,
    "created_at": "2016-11-28T14:10:11.338Z",
    "updated_at": "2016-12-02T01:17:29.310Z",
    "last_login": "2016-12-02T01:17:29.310Z",
    "email_verified": true
  },
  {
    "user_id": "583c5484cb79a5fe593425a9",
    "email": "[email protected]",
    "name": "[email protected]",
    "given_name": "Hello1",
    "family_name": "Test1",
    "nickname": "test1",
    "last_ip": "94.121.168.53",
    "logins_count": 1,
    "created_at": "2016-11-28T16:00:04.209Z",
    "updated_at": "2016-11-28T16:00:47.203Z",
    "last_login": "2016-11-28T16:00:47.203Z",
    "email_verified": true
  },
  {
    "user_id": "583c57672c7686377d2f66c9",
    "email": "[email protected]",
    "name": "[email protected]",
    "given_name": "John",
    "family_name": "Dough",
    "nickname": "aaa",
    "last_ip": "94.121.168.53",
    "logins_count": 2,
    "created_at": "2016-11-28T16:12:23.777Z",
    "updated_at": "2016-11-28T16:12:52.353Z",
    "last_login": "2016-11-28T16:12:52.353Z",
    "email_verified": true
  },
  {
    "user_id": "5840b954da0529cd293d76fe",
    "email": "[email protected]",
    "name": "[email protected]",
    "given_name": "Jane",
    "family_name": "Dough",
    "nickname": "a",
    "last_ip": "94.121.163.63",
    "logins_count": 3,
    "created_at": "2016-12-01T23:59:16.473Z",
    "updated_at": "2016-12-01T23:59:53.474Z",
    "last_login": "2016-12-01T23:59:53.474Z",
    "email_verified": true
  },
  {
    "user_id": "584a9d13e808bcf75f05f580",
    "email": "[email protected]",
    "given_name": "Dummy",
    "family_name": "User",
    "created_at": "2016-12-09T12:01:23.787Z",
    "updated_at": "2016-12-09T12:01:23.787Z",
    "email_verified": false
  }
]

Assignment: Backend Development using Dart and Shelf Package

In this assignment, you will create a backend server using Dart programming language and the Shelf package to handle HTTP requests and responses. The server will have endpoints to display all users, display one user by id, display one user by email, and remove one user by id. You should use the shelf_hotreload and dart_code_metrics packages to ensure good coding practices and ease of development.

Requirements:

  1. Create a Dart project and install the Shelf and shelf_hotreload packages.
  2. Create a "model" file to represent the user object with the required properties.
  3. Create a "repository" file to store the users in memory and handle CRUD operations on the user objects.
  4. Create a "routes" folder to contain the router handlers for each endpoint.
  5. Create a "response" folder to contain the handler methods for each endpoint.
  6. Implement an endpoint to display all users. This endpoint should return a JSON response containing all user objects.
  7. Implement an endpoint to display one user by id. This endpoint should accept an id parameter in the request URL and return a JSON response containing the user object with the matching id.
  8. Implement an endpoint to display one user by email. This endpoint should accept an email parameter in the request URL and return a JSON response containing the user object with the matching email.
  9. Implement an endpoint to remove one user by id. This endpoint should accept an id parameter in the request URL and remove the user object with the matching id from the repository.

Grading Criteria:

  1. Correct implementation of all four endpoints.
  2. Use of the Shelf package to handle HTTP requests and responses.
  3. Use of the shelf_hotreload and dart_code_metrics packages to ensure good coding practices and ease of development.
  4. Use of a "model" file to represent the user object with the required properties.
  5. Use of a "repository" file to store the users in memory and handle CRUD operations on the user objects.
  6. Use of a "routes" folder to contain the router handlers for each endpoint.
  7. Use of a "response" folder to contain the handler methods for each endpoint.
  8. Code readability and documentation.
  9. Proper error handling.

Note:

You can use the provided JSON data to create test users and test the endpoints.

project-102's People

Contributors

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