Giter VIP home page Giter VIP logo

hub-starter-mint's Introduction

Holaplex Hub Starter

A template repository to help you build NFT based applications using Holaplex Hub.

Includes:

  • NextJS 13 web framework (app directory enabled)
  • Postgres database management using Prisma ORM
  • User management with social based login through next-auth
  • Style application using Tailwind
  • Holaplex Hub SDK

Folder Structure

/prisma
  schema.prisma # prisma schema file
  /migrations # prisma auto-generated migration files
/src
 /app # next js app directory
  /login # social sign up or login
  page.tsx # home page
 /pages
   /api # next js api routes
    graphql.ts # apps graphql server
 /modules # utility clients and functions
   db.ts # prisma db client
   holaplex.ts # configured holaplex client
 /queries # holaplex and app api queries
 /mutations # holaplex and app api mutations
 tailwind.config.js # color theme

Getting Started

Ensure you have nodejs and docker installed on your workstation.

# start postgres in a docker container
docker compose up -d

# install dependencies
npm install

# setup database
npm run db

# boot up the app
npm run dev

See your app at http://localhost:3000

Environment

Create a .env file at the root of the project. Add the following environment variable.

# setup SSO with Google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# setup SSO with Twitter
TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=

# database
DATABASE_URL=postgres://postgres:holaplex@localhost:5432/hub-starter
POSTGRES_DB=hub-starter
POSTGRES_PASSWORD=holaplex

# holaplex
HOLAPLEX_API_ENDPOINT=https://api.holaplex.com/graphql
HOLAPLEX_AUTH_TOKEN=
HOLAPLEX_PROJECT_ID=
HOLAPLEX_DROP_ID=
HOLAPLEX_WALLET_ASSET_TYPE=
NEXT_PUBLIC_CHAIN_NAME=
NEXTAUTH_URL=

We currently support HOLAPLEX_WALLET_ASSET_TYPE in [SOL, MATIC].

Migrations

Follow the Prisma guide on adjusting the database through migrations. Once the Prisma schema has been adjusted run npm run migrate.

Release

The starter is designed to be deployed to render using their Infrastructure as Code (IaC) configuration file render.yaml. The IaC manifest will set up a web server for the mint page and a database for storing users, sessions, and wallets.

Database

After deploying the environment, access the shell of the web server and run the following command to create and set up the database schema:

npm run db

Environment Variables

Although the IaC will create placeholder environment variables for the web service, you will need to update them to match your Holaplex account.

hub-starter-mint's People

Contributors

kespinola avatar alchemistgo87 avatar mackenziewildman avatar pvams avatar mpwsh avatar

Stargazers

zer0cool  avatar qudo avatar  avatar

Watchers

Brian J. Fox avatar  avatar  avatar

hub-starter-mint's Issues

Single Mint Starter

Goal

Teams looking to get started with the Hub have a single mint page starter they can fork, theme, and deploy in 1 hour (or less).

Requirements

  • Configure hub using environment variables
  • Theme the background, cta, subtle
  • Deployment script targeting render

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.