/udacity-cd-capstone

Udacity AWS Cloud Developer Nanodegree - Capstone project

Primary LanguageTypeScript

Serverless TODO

In this repo, there are 2 services running with AWS Lambda and Serverless:

  • Client application (Frontend)
  • Backend service

Functionality of the application

This application will allow creating/removing/updating/fetching TODO items. Each TODO item can optionally have an attachment image. Each user only has access to TODO items that he/she has created.

TODO items

The application should store TODO items, and each TODO item contains the following fields:

  • todoId (string) - a unique id for an item
  • createdAt (string) - date and time when an item was created
  • name (string) - name of a TODO item (e.g. "Change a light bulb")
  • dueDate (string) - date and time by which an item should be completed
  • done (boolean) - true if an item was completed, false otherwise
  • attachmentUrl (string) (optional) - a URL pointing to an image attached to a TODO item

You might also store an id of a user who created a TODO item.

Prerequisites

  • Auth0 account
  • GitHub account
  • NodeJS version up to 12.xx
  • Serverless
    npm install -g serverless@2.21.1
    serverless --version
    • Login and configure serverless to use the AWS credentials
    # Login to your dashboard from the CLI. It will ask to open your browser and finish the process.
    serverless login
    # Configure serverless to use the AWS credentials to deploy the application
    # You need to have a pair of Access key (YOUR_ACCESS_KEY_ID and YOUR_SECRET_KEY) of an IAM user with Admin access permissions
    sls config credentials --provider aws --key YOUR_ACCESS_KEY_ID --secret YOUR_SECRET_KEY --profile serverless

Getting started

  1. Clone this project by running:
git clone https://github.com/huynhphamduytruong/udacity-cd-capstone
  1. Deploy backend
  • Change working directory to backend e.g. cd .\backend\
  • Install the dependencies for each project npm install
  • Update Serverless app info & environment variables in serverless.yml with your values
  • Deploy to Serverless by running:
serverless deploy -v
  1. Running frontend
  • Change working directory to frontend e.g. cd .\frontend\
  • Install the dependencies for each project npm install
  • Update variables in config.ts with your values
  • Running application by running:
npm run start

Postman collection

An alternative way to test your API, you can use the Postman collection that contains sample requests. You can find a Postman collection in this project. To import this collection, do the following.

Click on the import button:

Alt text

Click on the "Choose Files":

Alt text

Select a file to import:

Alt text

Right click on the imported collection to set variables for the collection:

Alt text

Provide variables for the collection (similarly to how this was done in the course):

Alt text