Goal: Understand how to work with code when you need to (Optional for beginners)
Estimated Time: 20-30 minutes
Note: This module is optional for complete beginners. You can build amazing apps without ever touching code! This module is for those who want to understand or customize code directly.
By the end of this module, you will:
- Understand what Code Mode is
- Know when you might need to view code
- Understand when to use Code Mode vs. prompts
- Know how to view your project's code
- Understand how to make direct code edits (paid plans)
- Know when Code Mode is helpful vs. when prompts are better
Code Mode lets you view and edit your project's raw code directly in Lovable. It's like opening the hood of a car - you can see and modify how everything works under the surface.
You don't need Code Mode to build amazing apps! Lovable is designed so you can build everything using prompts. Code Mode is optional and mainly for:
- Advanced customization
- Learning how code works
- Making precise technical changes
- Understanding what Lovable built
💡 Plan Information: Code editing requires a paid plan, but viewing code is free. You can build everything using prompts on the free plan! See the Pricing and Plans Guide for details.
When you open Code Mode, you'll see:
- File structure - All the files in your project
- Code files - The actual code (HTML, CSS, JavaScript, etc.)
- Configuration files - Settings and configurations
- Organized folders - Everything organized logically
💡 Beginner Tip: Don't be intimidated by code! Even if you don't understand it, you can still use Lovable effectively with prompts.
✅ You want to build features - "Add a contact form"
✅ You want to make changes - "Change the colors to blue"
✅ You're learning - Prompts help you understand
✅ You want quick results - Prompts are faster
✅ You're not comfortable with code - Prompts are easier
Prompts are usually the better choice!
✅ You need precise control - Exact positioning, specific values
✅ You want to learn code - See how things are built
✅ You're debugging - Find and fix specific issues
✅ You need advanced customization - Things prompts can't do
✅ You understand code - You know what you're looking for
Code Mode is for advanced users or learners.
For beginners: Use prompts for everything. Only use Code Mode if you're curious about how things work or if a prompt isn't giving you the exact result you need.
For advanced users: Use prompts for most things, Code Mode for fine-tuning.
💡 Beginner Tip: Start with prompts! You can build entire apps without ever opening Code Mode.
- In your Lovable project, look for a "Code" button or tab
- It might be in the top menu, sidebar, or as a toggle
- Click it to enter Code Mode
What you'll see: Your project's file structure and code files.
You'll see folders and files organized like:
your-project/
├── src/
│ ├── components/
│ │ ├── Header.jsx
│ │ ├── Footer.jsx
│ │ └── Button.jsx
│ ├── pages/
│ │ ├── Home.jsx
│ │ └── About.jsx
│ └── App.jsx
├── public/
│ └── images/
└── package.json
Don't worry if this looks confusing! You don't need to understand it to use Lovable.
- Click on a file - It opens in the editor
- See the code - You'll see the actual code
- Read it - Even if you don't understand, you can see what Lovable built
Common file types:
- .jsx or .js - JavaScript/React code (the logic)
- .css - Styling code (how things look)
- .html - Structure code (the layout)
- .json - Configuration files (settings)
💡 Beginner Tip: You don't need to understand the code! Just knowing it exists and that Lovable created it is enough.
Note: Viewing code is available on all plans, but editing code directly requires a paid plan. You can still make all changes using prompts on the free plan!
📊 For complete pricing details: See the Pricing and Plans Guide for a full breakdown of what's included in free vs. paid plans.
- Navigate to the file you want to edit
- Click on it to open it
- Click where you want to edit - The cursor appears
- Type your changes - Just like editing a document
- Save the file - Usually auto-saves or click Save
- Changes appear in the preview
- Your app updates automatically
- You can test immediately
- Precise values - "Change this exact number to 42"
- Complex logic - Advanced functionality
- Quick tweaks - Small changes faster than prompts
- Learning - Understanding how code works
💡 Beginner Tip: Even with a paid plan, prompts are usually easier and faster. Use code edits only when you need precise control.
Even if you don't edit code, viewing it can teach you a lot!
- How Lovable structures projects - See the organization
- How features are built - Understand the implementation
- Code patterns - See common approaches
- Best practices - Learn from Lovable's code quality
You ask Lovable:
Add a blue button that says "Click Me"
Then in Code Mode, you can see:
- How the button is created
- How the color is applied
- How the text is added
- The structure and style
This teaches you how buttons work in code!
After viewing code, you might understand:
- What's possible
- How to describe things better
- What to ask for in prompts
💡 Beginner Tip: Don't feel pressured to understand code! View it out of curiosity, but stick with prompts for building.
Task: Explore your project's code structure
- Open Code Mode - Click the Code button/tab
- Browse the files - Click through different files
- Open a component - Click on a file like "Header.jsx" or "Button.jsx"
- Look at the code - See what Lovable created
- Don't worry about understanding - Just observe!
What you learned: Your project has organized code files, even though you built it with prompts!
Task: Locate code for a feature you built
- Think of a feature - Like "the contact form" or "the navigation menu"
- Look for it in Code Mode - Browse files to find it
- Open the file - See how it's coded
- Notice the structure - See how it's organized
What you learned: Every feature you build with prompts has corresponding code!
Task: See how prompts translate to code
- Make a change with a prompt:
Change the button color to red - Open Code Mode - Find the button file
- See the change - Notice how the code changed
- Understand the connection - Prompts modify code!
What you learned: Prompts and code are connected - prompts modify the code for you!
Before moving to Module 8, make sure you can:
- Explain what Code Mode is
- Know when to use Code Mode vs. prompts
- View your project's code structure
- Open and view code files
- Understand that code editing requires a paid plan
- Know that prompts work for everything on free plans
- Use Code Mode as a learning tool (optional)
A: No! You can build entire apps using only prompts. Code Mode is optional.
A: Yes! Prompts can handle almost everything. Code Mode is mainly for advanced customization.
A: Code Mode is great for learning! View the code Lovable creates to see how things work.
A: Only if you want to edit code directly. You can view code on all plans, and prompts work on all plans.
A: It can be, but you don't need it! Prompts are much easier for beginners.
A: Start with prompts! Only use Code Mode if you're curious, learning, or need precise control.
Great job! You now understand Code Mode and when (or if) you might want to use it. Remember:
- Prompts are usually better - Easier and faster
- Code Mode is optional - You can build everything without it
- It's a learning tool - Great for understanding how things work
Ready for Module 8? In the next module, we'll learn how to deploy and publish your applications - making them live on the internet for the world to see!
-
Stick with prompts - They're easier and work for almost everything
-
Don't be intimidated - Code looks complex, but you don't need to understand it
-
Use Code Mode to learn - View code out of curiosity, not necessity
-
Focus on building - Prompts let you build without code knowledge
-
Learn gradually - If you're interested in code, learn slowly by viewing what Lovable creates
-
Remember: You're not required to use Code Mode - Many successful Lovable users never touch code!
Module 7 Complete! 🎉