Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/tai9/cargo-nft-be

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tai9/cargo-nft-be

  • v0.0.0-20220811053052-edf4e98759b5
  • Source
  • Go
  • Socket score

Version published
Created
Source

CARGO NFT BACKEND

FE integration:

  • Repo: https://github.com/tai9/cargo-nft-fe
  • Preview: https://cargo-nft-fe.vercel.app/

How to start project ?

To start backend service, you need to install docker and golang-migrate first.

  1. Install golang-migrate
brew install golang-migrate
  1. Create dockerdb container
make postgres
  1. Create database instance
make createdb

We also provide a cli to drop database if you need to refresh project

make dropdb
  1. Migrate schema and master data
make migrateup
  1. Generate sqlc
make sqlc
  1. Start web service
make server

Usefull commands

Migrations:

  1. Create migrations:
    make migrations name={ARGS}
    
  2. Migration up:
    make migrationup
    
  3. Migration down:
    make migrationdown
    

Deployment:

  1. Docker build:
    make docker.build
    
  2. Push docker image to registry:
    make docker.push
    
  3. Deploy to staging env:
    make deploy.staging
    

Authorization

Library: https://github.com/casbin/casbin

Model:

  • permission: define all system permissions. Permission can have type or not. Currently, there is only one type, this is CRUD, it represents 4 action: read, update, create, delete with following bitmask. In contrast, if type is null, this means action is can.
actionbit
create8 // 0b1000
read4 // 0b0100
update2 // 0b0010
delete1 // 0b0001

CONVENTION

FAQs

Package last updated on 11 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc