Giter Site home page Giter Site logo

vimson / car-inventory-management Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 237 KB

REST API Development using AWS CDK, TypeScript, AWS Serverless, API Gateway with Custom Authorizer and CI/CD Pipelines with DynamoDB data storage

TypeScript 99.68% JavaScript 0.32%

car-inventory-management's Introduction

ClickDealer - Technical test

Assignment

Create a simple API using  AWS Lambda (Node/TypeScript) + AWS DynamoDb  OR Node/MongoDb to create then retrieve a vehicle record.  Be creative in what data is stored but we want to see the API allowing someone to save a vehicle record, then retrieve it from the database.  Consider validation and unit testing.The AWS free tier should make this a no cost process if available in your region.

by vehicle record we simply mean a database entry about a vehicle i.e.

Make: Ford

Model FiestaReg: AB22 ABC

RegistrationDate: 23/12/22Create/Read/ and possibly Update/Delete via an API.

Project Specification Document

Project title

REST API Development using AWS CDK, TypeScript, AWS Serverless, API Gateway with Custom Authorizer and CI/CD Pipelines with DynamoDB data storage

Project Description

The aim of this project is to develop a REST API for saving cars with various attributes. This API will be built using AWS CDK, TypeScript, AWS Serverless, API Gateway with Custom Authorizer and CI/CD Pipelines with DynamoDB data storage. The API will provide endpoints for GET, POST, PUT and DELETE operations.

Zod is used for request validation and Jest as a testing library.

Car attributes

The following attributes will be saved for each car:

  • Registration number
  • Dealer
  • Make
  • Model
  • Year
  • Color
  • Price
  • Mileage
  • Description
  • RegisteredAt
  • Status
  • UpdatedAt

DynamoDB table design:

The following data access patterns will be considered while planning the API:

  1. Get car details by Registration number
  2. Get cars in the database in the order of created date
  3. Get cars of a particular dealer
  4. Get cars in the database of make and model
  5. Get cars which have registration date in a particular range
  6. Get cars which has make, model and price-wise sorting

Endpoints

  • GET /cars: Search cars we can provide dealer, make, model, registeredAfter, registeredBefore, limit, nextPageOffset, sortBy as parameters
  • GET /cars/{id}: Get a specific car details
  • POST /cars: Create a new car to the inventory
  • PUT /cars/{id}: Update an existing car inventory
  • DELETE /cars/{id}: Delete a specific car

API Gateway Custom Authorizer

All endpoints except GET /cars are secured using the token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. This token will be added as an Authorization header.

CI/CD Pipeline

The CI/CD pipeline will be set up to automatically fetch the code from the CodeCommit repository and deploy it using AWS CDK.

Conclusion

The REST API for car inventory management will be developed using AWS CDK, TypeScript, AWS Serverless, API Gateway with Custom Authorizer and CI/CD Pipelines. The API will provide various endpoints for GET, POST, PUT and DELETE operations to manage cars. The data will be stored in DynamoDB with proper data access patterns. The endpoints will be secured using a custom authorizer and CI/CD pipelines will be set up for automatic deployment.

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template

car-inventory-management's People

Contributors

vimson avatar

Watchers

 avatar  avatar

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.