Who This Guide Is For
You want to build an AI app — like a chatbot, content generator, or AI assistant — but you don’t know how to code. That’s fine. AI tools can build the entire thing for you. You just need to understand what to tell them and how to connect the pieces.
What You’ll Build
By the end, you’ll have a working AI chatbot that:
- Answers questions about your business
- Uses a custom system prompt (the AI’s personality)
- Works on a live website anyone can visit
The Complete Workflow
Step 1: Get Your Free API Key
An API key is like a password that lets your app talk to the AI. Without it, the app can’t generate responses.
Get a Groq API Key (Fastest & Free)
- Go to console.groq.com
- Click “Sign up” (use Google or GitHub)
- Once logged in, click “API Keys” in the left menu
- Click “Create API Key”
- Copy the key (it starts with
gsk_) - Save it somewhere safe — you’ll only see it once
Why Groq?
| Provider | Speed | Free Tier | Cost After Free |
|---|---|---|---|
| Groq | Fastest | 14,400 tokens/day | Very cheap |
| OpenAI | Fast | $5 credit | ~$0.01 per message |
| Claude | Fast | Limited free | ~$0.01 per message |
Groq is free, fast, and perfect for learning. You can switch to OpenAI or Claude later if you need more power.
Step 2: Write Your System Prompt
A system prompt is a set of instructions that tells the AI who to be and how to behave. This is the most important part of your AI app.
What Is a System Prompt?
Think of it like training a new employee. You tell them:
- Who they are (role)
- What they know (context)
- What they should do (instructions)
- How to respond (output format)
Example: Customer Support Bot
You are a customer support agent for "TechStore", an online electronics store.
You are helpful, friendly, and solution-oriented.
RULES:
- Always greet the customer by name if they share it
- Keep responses under 100 words
- If you don't know the answer, say "Let me connect you with a human agent"
- Never make up information about products or prices
- Never share other customers' information
HOW TO RESPOND:
- Use bullet points for multiple steps
- Always end with "Is there anything else I can help with?"
Example: Personal AI Assistant
You are a personal productivity assistant named "Atlas".
You help users:
- Break down big tasks into small steps
- Prioritize their to-do list
- Stay focused and motivated
RULES:
- Be encouraging but not fake
- Ask clarifying questions when the task is vague
- Suggest time estimates for each step
- If a task seems overwhelming, help them break it down further
TONE: Professional but warm. Like a smart friend who always has a plan.
How to Test Your Prompt
Before building the app, test your prompt in ChatGPT or Claude:
- Copy your system prompt
- Paste it into ChatGPT as a custom instruction
- Send test messages like a real user would
- See if the AI responds the way you want
- Adjust the prompt until it’s perfect
Step 3: Build with AI (Lovable)
Now that you have your system prompt and API key, tell Lovable to build the app.
Your Lovable Prompt
Build me an AI chatbot web app.
Features:
1. A clean chat interface (message bubbles, input field at bottom)
2. When the user sends a message, it calls the Groq API
3. The AI responds using the system prompt I'll provide
4. Conversation history is shown (user messages and AI responses)
5. Loading indicator while AI is thinking
Design:
- Dark theme, modern, clean
- Chat bubbles: user messages on right (green accent), AI messages on left (gray)
- Mobile responsive
Technical details:
- Use Groq API with model "llama-3.3-70b-versatile"
- The API key should be stored in environment variables (not in the code)
- Use React for the frontend
What Lovable Generates
Lovable will create:
- A complete chat interface
- API connection to Groq
- Environment variable configuration
- Responsive design
Add Your System Prompt
After Lovable generates the app, tell it:
Update the system prompt in the code to use this exact prompt:
"You are a customer support agent for TechStore. Be helpful and friendly."
Make sure the system prompt is passed to the Groq API in every request.
Step 4: Connect Your API Key
Your API key should NEVER be in the code. It goes in an environment variable — a secret file that only the server can read.
What Is an Environment Variable?
Think of it like a safe behind the counter. Your code can access it, but nobody looking at your website can see it. If you put the API key directly in the code, anyone can steal it.
How to Set It Up
In Lovable:
- Click the Settings gear icon
- Go to “Environment Variables”
- Add:
GROQ_API_KEY=gsk_your_actual_key_here - Save
In Vercel (after deployment):
- Go to your project in Vercel
- Settings → Environment Variables
- Add:
GROG_API_KEY=gsk_your_actual_key_here - Click “Save”
The rule: Never put API keys in your code. Always use environment variables.
Step 5: Deploy to GitHub and Vercel
Same process as the website guide:
- Push to GitHub: Click the GitHub icon in Lovable → Push to GitHub
- Deploy to Vercel: Go to vercel.com → Import your repository → Deploy
- Add your API key: Settings → Environment Variables → Add your Groq key
- Done: Your AI app is live
How It All Connects
User types message
│
▼
Your app (on Vercel)
│
├──► Sends message + system prompt to Groq API
│ (using your API key from environment variable)
│
▼
Groq API (AI brain)
│
├──► Generates response using your system prompt
│
▼
Your app shows the response to the user
Common Questions
“What is React?” React is a tool that helps build user interfaces (what people see and click on). Lovable uses it behind the scenes. You don’t need to learn React — just describe what you want.
“What is an API key?” A password that lets your app talk to the AI service. Without it, the AI can’t respond. Never share it or put it in your code.
“What is an environment variable?” A secret file that stores sensitive information (like API keys). Your code reads it, but nobody visiting your website can see it. This is how you keep secrets safe.
“How much does this cost?”
- Groq free tier: ~200 messages/day
- Vercel free tier: Enough for most projects
- Total: $0 for learning and prototyping
“Can I make money with this?” Yes. You can:
- Sell AI chatbots to businesses ($500-5000 per project)
- Add it to your portfolio to get hired
- Build AI tools and charge for access
What You Learned
- What an API key is and why you need one
- How to write a system prompt that makes the AI behave correctly
- How to use Lovable to build an AI app without coding
- How environment variables keep your secrets safe
- How to deploy an AI app to the internet
This is the foundation for building any AI-powered product.