Set up Frontend for Solana Application
Integrate, call, and interact with your Solana on-chain program using Rust and Alchemy RPC
You can check out the project in two ways:
- GitHub Repository: alchemyplatform/solana-hello-world-2025 β Clone this repo to explore or use the code yourself.
- Live Demo: Deployed Application β Interact with the app directly in your browser.
Step 1: Get your Solana program ID
The previous guide shows you how to deploy a program to Solana devnet. Using that guide, we got the following program id:
You can use this in the examples below, or replace it with your own.
Step 2: Create a Next.js app
From your terminal, run:
This sets up:
- Next.js with the App Router
- TypeScript
- Tailwind (optional, but nice for styling)
Step 3: Install Solana web3.js and set environment variables
Install the Solana SDK:
Create a file called .env in the root of solana-hello-frontend folder:
Add your Alchemy RPC URL and program ID:
In a real app, replace the example program ID with the one from your own deployment.
Step 4: Build a minimal client UI that pings your program
Weβll make the homepage (app/page.tsx) a client component that:
-
connects a Solana wallet (e.g. Phantom)
-
builds a transaction with an instruction calling your program
-
sends it via Alchemy RPC
-
shows the signature + status
Open src/app/page.tsx and replace its contents with:
Step 5: Run the Next.js app
π Success
You now have a working Solana program deployed on Solana devnet!
Check out the next guide on how to:
- set up a frontend for this program
- invoke it using Alchemy π