Skip to content

Latest commit

 

History

History
96 lines (60 loc) · 4.1 KB

File metadata and controls

96 lines (60 loc) · 4.1 KB

Task 3 (First API with AWS API Gateway and AWS Lambda)

Prerequisites


  • Install the latest version of Serverless Framework (https://www.serverless.com/).
  • Configure credentials for AWS to make them accessible by Serverless.
  • Create your own public Github repository for all future backend work (you might call it how you would like). You will have 2 repos - 1 for frontend, 1 for backend till the end of course.

NOTE: You should create branch from master and work in branch (f.e. branch name - task-3) in BE (backend) and in FE (frontend) repositories.

NOTE: Don't forget to add dynamic product representation on FE side.

NOTE: This microservice needs to be created using Serverless Framework, AWS API Gateway, AWS Lambda.

Architecture

Find the entire program architecture: here.

Task Focus

The following image provides more info about task focus.

Tasks


Task 3.1

  1. Create a lambda function called getProductsList under the same Serverless config file (i.e. serverless.yaml) of Product Service which will be triggered by the HTTP GET method.
  2. The requested URL should be /products.
  3. The response from the lambda should be a full array of products (mock data should be used - this mock data should be stored in Product Service).
  4. This endpoint should be integrated with Frontend app for PLP (Product List Page) representation.

Task 3.2

  1. Create a lambda function called getProductsById under the same Serverless config file (i.e. serverless.yaml) of Product Service which will be triggered by the HTTP GET method.
  2. The requested URL should be /products/{productId} (what productId is in your application is up to you - productName, UUID, etc.).
  3. The response from the lambda should be 1 searched product from an array of products (mock data should be used - this mock data should be stored in Product Service).
  4. This endpoint is not needed to be integrated with Frontend right now.

Task 3.3

  1. Commit all your work to separate branch (e.g. task-3 from the latest master) in your own repository.
  2. Create a pull request to the master branch.
  3. Submit the link to the pull request for crosscheck

Evaluation criteria (70 points for covering all criteria)


Reviewers should verify the lambda functions by invoking them through provided URLs.

  • Product Service Serverless config contains configuration for 2 lambda functions, API is not working at all, but YAML configuration is correct
  • The getProductsList OR getProductsById lambda function returns a correct response (POINT1)
  • The getProductsById AND getProductsList lambda functions return a correct response code (POINT2)
  • Your own Frontend application is integrated with Product Service (/products API) and products from Product Service are represented on Frontend. AND POINT1 and POINT2 are done.

Additional (optional) tasks


  • +5 - Async/await is used in lambda functions
  • +5 - ES6 modules are used for Product Service implementation
  • +4 - Custom Webpack/ESBuild/etc is manually configured for Product Service. Not applicable for preconfigured/built-in bundlers that come with templates, plugins, etc.
  • +4 (All languages) - SWAGGER documentation is created for Product Service
  • +4 (All languages) - Lambda handlers are covered by basic UNIT tests (NO infrastructure logic is needed to be covered)
  • +4 (All languages) - Lambda handlers (getProductsList, getProductsById) code is written not in 1 single module (file) and separated in codebase.
  • +4 (All languages) - Main error scenarios are handled by API ("Product not found" error).

Description Teamplate for PRs


The following should be present in PR's description field:

  1. What was done?

    Example:

   Service is done, but FE is not working...

   Additional scope - webpack, swagger, unit tests
  1. Link to Product Service API - .....

  2. Link to FE PR (YOUR OWN REPOSITORY) - ...

  3. In case SWAGGER file is not provided - please provide product schema in PR description