Deployment

Deploying your AgentForge app allows you to share your AI-powered application with the world.
💡
We highly recommend checking out the
ShipFast Integration
ShipFast Integration
if you want to build a Micro SaaS app and monetize your work.
Follow these steps to commit your code, push it to a GitHub repository, and deploy it using a hosting provider like Vercel. This guide also covers setting up the correct environment variables for deployment.

Step 1: Commit and Push Your Code to GitHub

1) Commit Your Code: Ensure all your changes are committed.

1git add .
2git commit -m "Initial commit"
 
2) Push to a Private Repository: Push your committed code to a private repository on GitHub.

1git remote add origin https://github.com/your-username/your-private-repo.git
2git push -u origin main
 

Step 2: Deploy Using a Hosting Provider

You can deploy your Next.js app using various hosting providers that support Next.js, such as Vercel, Netlify, Render, etc. Here’s how to do it with Vercel:

Using Vercel

  1. Sign In to Vercel: Go to Vercel and sign in to your account.
  1. Create a New Project: Click on the "New Project" button and select "Import Git Repository."
  1. Select Your Repository: Connect your GitHub account if prompted, and select the repository where your code is hosted.
  1. Configure Project: Follow the prompts to configure your project settings. Vercel will automatically detect that it’s a Next.js app.
  1. Set Environment Variables: Before deploying, you need to set up the environment variables. These are stored in .env.local and should not be committed to your repository.
      • Go to the "Settings" tab of your project on Vercel.
      • Click on "Environment Variables."
      • Add your environment variables (e.g., OPENAI_API_KEY, GROQ_API_KEY, etc.).
  1. Deploy: Click on the "Deploy" button. Vercel will build and deploy your application. Once the deployment is complete, you will receive a live URL to access your app.

Using Other Hosting Providers

Netlify (not tested)

  1. Sign In to Netlify: Go to Netlify and sign in to your account.
  1. New Site from Git: Click on "New site from Git."
  1. Connect to GitHub: Connect your GitHub account and select your repository.
  1. Configure Build Settings: Set the build command to npm run build and the publish directory to .next.
  1. Set Environment Variables: Go to "Site settings" > "Build & deploy" > "Environment" and add your environment variables.
  1. Deploy Site: Click on "Deploy site."

Render (not tested)

  1. Sign In to Render: Go to Render and sign in to your account.
  1. New Web Service: Click on "New" > "Web Service."
  1. Connect to GitHub: Connect your GitHub account and select your repository.
  1. Configure Build and Environment: Set the build command to npm run build and the start command to npm start. Add environment variables under the "Environment" tab.
  1. Deploy: Click on "Create Web Service."