Skip to content

Mintbase/minsta

Repository files navigation

Minsta

cover_image

This repository hosts the primary codebase for the Minsta app.

Demo Deploy

Tooling:

Use Case Tools Framework

Author:

Author Organization

Project Walkthrough

This repository hosts the primary codebase for the Minsta App, originally created and developed by @microchipgnu.

All new Minsta instances should be derived from this repository.

Video Tutorial

Deploying.Your.Own.Photo.Minting.NFT.Minting.AI.Connection.App.-.with.Nate.Geier.mp4

Pre-Setup - Proxy Contract

  1. You need to have a NEAR Contract where you add a proxy contract as a minter.
  2. The proxy contract enables non-minter users to mint images on Minsta.
  3. The Near Contract will be where the NFT images will be minted
  4. The proxy contract will be the minter
  5. The user wallet address will be the owner of the NFT.

Deploying a Near Contract on Mintbase:

  1. Login on Mintbase and access Contracts Page
  2. Click on New Contract
  3. Choose Store Name (this will be the contract address to add on your minsta instance, this need to be added on the process.env.NEXT_PUBLIC_NFT_CONTRACT_ADDRESS environment variable) and Store Symbol
  4. Proceed to transaction.
  5. Succeeded
  6. Go to Contract Settings

Add Proxy Minter Contract

  1. Under Contract Settings go to Minters
  2. add 0.drop.proxy.mintbase.near (this is the contract address that need to be added on process.env.NEXT_PUBLIC_PROXY_MINTER_CONTRACT_ADDRESS), and click Add Minters.
  3. Proceed to transaction.
  4. Succeeded

Getting Started

To start with this project:

  1. Clone the repository.

  2. If you don't have pnpm installed, run:

    npm install -g pnpm
  3. Then, install the required dependencies:

    pnpm install

Environment Variables

SETUP Envs ( mandatory Envs )

ENV Variable Type Description Mandatory
NEXT_PUBLIC_APP_TITLE string sets the Title of your deployed application YES
NEXT_PUBLIC_NFT_CONTRACT_ADDRESS string this is the Mintbase NFT contract where you want to showcase the user mints, you can deploy mainnet one here or on testnet YES
NEXT_PUBLIC_NETWORK string sets Wallet login to the desired near network. "testnet" | "mainnet" YES
NEXT_PUBLIC_PROXY_MINTER_CONTRACT_ADDRESS string Can use 0.drop.proxy.mintbase.near as a default. This is the contract address that will do proxy minting so any user on near could mint it. It should be added as a minter on your contract (same as NEXT_PUBLIC_NFT_CONTRACT_ADDRESS) YES

SETUP Envs (not mandatory)

ENV Variable Type Description Mandatory
REPLICATE_API_TOKEN string API token adds replicate functionality that analyzes the image taken by the user and add title + description using AI NO
NEXT_PUBLIC_LEGACY_PROXY_ADDRESSES string contract address of a second proxy address in case first fail NO
NEXT_PUBLIC_MINTBASE_WALLET_URL string "https://testnet.wallet.mintbase.xyz" or "https://wallet.mintbase.xyz" NO
NEXT_PUBLIC_SHOW_REWARDS boolean this is to opt for rewards modal and show users NO
NEXT_PUBLIC_MINTING_CLOSED boolean this is to close the dapp for new mints NO

META Envs

ENV Variable Type What it does? Mandatory
NEXT_PUBLIC_META_DESCRIPTION string OG Meta description NO
NEXT_PUBLIC_META_TITLE string OG Meta Title NO
NEXT_PUBLIC_TWITTER string The message to be shared on twitter share. NO

Theming Envs

you need to pass hex colors as strings.

  • COLOR_PRIMARY
  • COLOR_SECONDARY
  • COLOR_MAIN_BACKGROUND
  • COLOR_GRADONE
  • COLOR_GRADTWO
  • COLOR_CARDONE
  • COLOR_CARDTWO
  • COLOR_LINKCOLOR
  • COLOR_ICON
  • COLOR_CAMERA
  • COLOR_MODAL_TEXT
  • COLOR_LEADERBOARD_TEXT
  • COLOR_HEADER_TEXT
  • COLOR_MAIN_TEXT
  • COLOR_FREE_USE_TEXT
  • COLOR_PRIMARY_BTN_TEXT
  • COLOR_SECONDARY_BTN_TEXT

Rewards Envs

  • NEXT_PUBLIC_TEXT_PRIZE_1ST_VAL
  • NEXT_PUBLIC_TEXT_PRIZE_2ND_VAL
  • NEXT_PUBLIC_TEXT_PRIZE_3RD_VAL
  • NEXT_PUBLIC_TEXT_PRIZE_1ST_TITLE
  • NEXT_PUBLIC_TEXT_PRIZE_2ND_TITLE
  • NEXT_PUBLIC_TEXT_PRIZE_3RD_TITLE

Instruction Envs

  • NEXT_PUBLIC_TEXT_ABOUT_1ST
  • NEXT_PUBLIC_TEXT_ABOUT_2ND
  • NEXT_PUBLIC_TEXT_ABOUT_3RD

Refer to the .env.example file for the environment variables used in this project.

If you don't set up a .env file or environment variables with your provider, the project will retrieve values from the following files:

  1. For CSS generation during build: generate-css.js
  2. For configuration variables: src/constants.ts
  3. For fallback metadata and text values: src/fallback.ts

Local Development

To run the project locally, use:

pnpm dev

Updating Environment Variables

Running Locally

If you're running your project locally, follow these steps to update your environment variables:

  1. Save your changes in the .env file.
  2. Run pnpm dev again to apply the updated environment variables.
  3. Reload the page to reflect the changes.

Deployed on Vercel

If you have deployed your project on Vercel, follow these steps to update your environment variables:

  1. Log in to your Vercel account.
  2. Navigate to the project settings for your deployed app.
  3. Update the environment variables in the Vercel dashboard.
  4. Trigger a redeployment of your app to apply the changes.

By following these steps, you can ensure that your project uses the updated environment variables.

detail_image