Git Product home page Git Product logo

kendyjm / marketplace Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 938 KB

Collaborative platform that essentially connects individuals wishing to sell or buy.

License: MIT License

JavaScript 7.54% TypeScript 87.84% CSS 1.63% HTML 2.99%
aws aws-lambda aws-api-gateway serverless serverless-framework aws-cloudformation auth0 rs256 aws-s3 marketplace aws-dynamodb aws-xray aws-cloudwatch observability winston-logger reactjs typescript

marketplace's Introduction

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

marketplace's People

Contributors

kendyjm avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

campuslegends

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.