Skip to content

backend for creating NFT and thus registering an asset via an API

License

Notifications You must be signed in to change notification settings

kette-io/nft-asset-registry-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KETTE Asset registry backend

This repository contains the backend for the KETTE registry. The backend is responsible for providing an API for charging a credit card and registrering assets on behalf of a user by minting a ERC721 compliant token in the KETTE registry smart contract.

Requirements

AWS Lambda

The backend is using AWS Lambda and requires a AWS account as well as the AWS CLI

Stripe

For charging credit cards we use Stripe. A Stripe account is necessary to interact with the stripe API.

Run

    npm install
    sls dynamodb install
    npm run start-local-env

API Documentation

Swagger description

Architecture Overview

The project comprises of four modules. Each module with its individual repository:

Architecture Overview

Deployment

Serverless deploy needs to be run twice for the very first deploy. Not ALL creation of resources is automated yet. That´s why the first run creates the initial resource. Then we have to manually create additinal resources and add references in config/secret files. Afterwards we have to run deploy again to deploy the finished serverless.yml with all the correct settings. Additionally creation of identity pools requires the API gateway ID, which is created when deploying for the first time.

  • [local] run "serverless deploy"

  • [AWS Console - IAM] create encryption key id

  • [AWS Console - Cognito] create user with admin access for backend APIs (backend-admin) for end2end-tests

  • [local] run "npm run prepare" to copy template files to the correct folders

  • [local] update .env

  • [local] update ./_end2endTests/test-secrets.js

  • [local] update _end2EndTest/awsConfig with Cognito and API Gateway information

  • [local] run "serverless deploy" again with updates in config files

Misc

Setting different stages

this will set the self:provider.stage variable either to given --stage parameter value or defaults to dev

Todo

  • automated tests
  • error handling
  • data validation