project consisting of a client-side application built with Next.js and a server-side application built with NestJS.
The project use monorepo for multiple packages is organized into the following directories:
- packages/analyzkit: Used for data analysis of BlueberryRing in moonchain.
- packages/frontend: Contains the client-side application built with Next.js.
- packages/solidity: Contains the contracts built with hardhat.
- packages/server: Contains the server-side application built with NestJS.
To get started with the development of the project, follow the steps below:
- Clone the repository.
- Navigate to the root directory of the project.
- Run
pnpm installto install dependencies - Configure the
.envforpackages/server - Configure the
.envforpackages/frontend
To start the development server for the client-side application, run the following command:
pnpm dev:clientTo start the development server for the server-side application, run the following command:
pnpm dev:serverIf the server API is changed, it can be run in the client directory to generate client API code
pnpm build:genapiIf the contracts is changed, run the following command:
pnpm build:solidityThis project uses dotenv to manage all environment variables. You can create a project and link it at vault.dotenv.org. Additionally, you can configure a specific project's .env separately.
When using dotenv, you need to fill in all the following environment variables, which can be found in the corresponding project documentation.
# frontend
NEXT_PUBLIC_DEFAULT_CHAIN= "..."
NEXT_PUBLIC_NFT_URL= "..."
NEXT_PUBLIC_PINATA_SECRET_API_KEY= "..."
NEXT_PUBLIC_PINATA_API_KEY= "..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= "..."
NEXT_PUBLIC_SERVER_URL= "..."
# server
NEST_PRISMA_DATABASE_URL= "..."
NEST_SERVER_PORT= "..."
NEST_DEFAULT_LAST_BLOCK= "..."
NEST_STRIPE_SECRET_KEY= "..."
NEST_WOOC_CONSUMER_KEY= "..."
NEST_WOOC_CONSUMER_SECRET= "..."
NEST_ADVISOR_REST_URL= "..."
# common
VERIFIER_PRIVATE_KEY= "..."
OWNER_PRIVATE_KEY= "..."
NETWORK= "geneva"Locally, you need to obtain the corresponding environment key by running npx dotenv-vault@latest keys, and then fill in the .env.key or .env:
DOTENV_KEY = "..."After that, simply rerun pnpm install, which will load the environment variables via lnv vault -d -r, covering all projects.
If you need to deploy on vercel, you must set the corresponding environment key using npx vercel@latest env add DOTENV_KEY.