This is a Next.js application for decentralized voting on the Solana blockchain, built in Firebase Studio.
-
Install Dependencies:
npm install
-
Set up Environment Variables: Create a
.env.localfile in the root directory and add your Google Generative AI API key:GOOGLE_GENAI_API_KEY=YOUR_API_KEY -
Run Development Server:
npm run dev
This will start the Next.js development server, typically on
http://localhost:9002. -
(Optional) Run Genkit Development Server: If you modify or add Genkit flows, you might need to run the Genkit dev server separately for inspection or specific debugging:
npm run genkit:dev
Or with watching:
npm run genkit:watch
npm run buildThis command builds the application for production usage. The output will be in the .next directory.
This project includes a netlify.toml file configured for deploying Next.js applications on Netlify.
Steps to Deploy:
- Push to Git Repository: Ensure your code is pushed to a Git provider supported by Netlify (GitHub, GitLab, Bitbucket).
- Connect to Netlify:
- Log in to your Netlify account.
- Click on "Add new site" -> "Import an existing project".
- Connect to your Git provider and select the repository for this project.
- Configure Build Settings:
- Netlify should automatically detect the
netlify.tomlfile and configure the build settings:- Build command:
npm run build - Publish directory:
.next
- Build command:
- The
@netlify/plugin-nextjswill be installed automatically to handle Next.js routing, SSR, ISR, etc.
- Netlify should automatically detect the
- Add Environment Variables:
- In the Netlify site dashboard, go to "Site configuration" -> "Build & deploy" -> "Environment".
- Add your
GOOGLE_GENAI_API_KEYas an environment variable. Important: Keep your API keys secret and do not commit them directly to your repository.
- Deploy Site: Click the "Deploy site" button. Netlify will build and deploy your application.
Once deployed, Netlify will provide you with a live URL for your SolanaVote application.