Skip to content

kendyjm/marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marketplace

Summary

This application is my capstone project for the Udacity Cloud Developer Nanodegree

Marketplace is a collaborative platform that essentially connects individuals wishing to sell or buy anything. As a user, you can login, add a "listing" containing a description of the item(s) you're selling, and also look at listing posted by others, like a P2P marketplace.

It demonstrates

  • AWS
    • Api Gateway (front-door securing, monitoring...the REST API)
    • Lambdas (serverless functions)
    • DynamoDB (database storing the listings)
    • S3 Bucket (storage of images)
    • Cloudformation (infrastructure as code, provisioning a collection of needed resources)
  • Serverless Framework
  • WebApp Client
    • ReactJS
  • Auth0
    • 3rd party OAuth integration
  • Optimisations
    • Global Secondary Indexes on DynamoDB
    • Individual packaging of Lambdas
    • X-ray to analyze and debug production, distributed applications

Requirements

Getting started

Installation

Use the node package manager to install marketplace

cd backend
npm install

cd ../frontend
npm install

Serverless Deployment (Manual)

Firstly, the serverless application should be deployed to AWS. Here I'm assuming that you have an AWS Profile of serverless and are deploying to region eu-west-3. The NODE_OPTIONS setting is to help avoid memory problems in Node when packaging the lambdas as separate deployables.

export NODE_OPTIONS=--max_old_space_size=8192
sls deploy -v

Serverless CD (configure online)

Go to https://dashboard.serverless.com/ and setup account/login. Your deployed app should be available for easy setup of automated CD once it has been deployed manually.

Postman collection

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

Client Local Start

  1. Update the client/src/config.ts credentials to match your Auth0 account (for authentication) and Serverless deployment (for REST API calls)
  2. The client can be installed and run locally
cd client
npm start

Files

  • marketplace
    • backend (Serverless Stack)
      • serverless.yml (Serverless framework config file)
      • src
        • auth (JWT handling)
        • business (business layer)
        • dao (dao layer, crud operations on dynamodb)
        • lambda (Serverless lambdas)
          • auth (API gateway token authorizer)
          • http (separate HTTP handlers)
        • models (Typescript interfaces)
        • requests (Typescript interfaces)
        • utils (Logging module)
        • validation (JSON Schema validation)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change

Please make sure to update tests as appropriate

License

MIT

Screenshots

Result of a Serverless deployment (sls deploy -v)

serverless-deployment

CloudFormation Stack for Serverless deployment

aws-cloudformation-stack

X-ray service map

aws-xray-service-map

Frontend

front-home

front-login-auth0

front-listings

front-my-listings