- React app with React Router, Tailwind, DaisyUI and Solana Wallet Adapter.
- Fastify API
- Shared lib/package
- Install node 20+ if you don't have it: https://nodejs.org/en
- Install pnpm if you don't have it:
npm i -g pnpm
. - Install NX CLI if you don't have it:
pnpm i -g nx
.
https://nx.dev/getting-started/intro
Start apps by running npx nx serve [appname]
.
To start the included React app run npx nx serve web
.
To start the included Fastify API run npx nx serve api
.
Put things you want shared across apps such as types and utilities in ./packages/lib
.
Usage
import { lib } from "@template--solana-web-app/lib"
View the available NX generators here. https://nx.dev/nx-api
To deploy the included apps on a platform like Railway, we use the following settings:
To deploy a static website like the React app, you can serve it like this.
Build Command
npx nx build web
Watch Paths
/apps/web
Start Command
npx http-server ./dist/apps/web
To deploy a Node app like the API, you can directly start it like this.
Build Command
npx nx build api
Watch Paths
/apps/api
Start Command
node ./dist/apps/api
WIP
This is still a WIP. It would be nice to add example Anchor integration as well.