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
Use the node package manager to install marketplace
cd backend
npm install
cd ../frontend
npm install
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
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.
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.
- Update the client/src/config.ts credentials to match your Auth0 account (for authentication) and Serverless deployment (for REST API calls)
- The client can be installed and run locally
cd client
npm start
- 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)
- backend (Serverless Stack)
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