What is Base Path?
The Base Path setting allows you to specify a subdirectory within your repository where your application code resides. This is particularly useful for monorepos or projects where the main application is not located at the repository root.How It Works
What Base Path Affects
The Base Path setting influences: β Flutter app execution - Where to runflutter run or flutter build
β
Svelte app execution - Where to run npm run dev or npm run build
β
React app execution - Where to run development and build commands
β
Web deployment - Where to deploy from when publishing your app
β
Build processes - Which directory to use for build operations
What Base Path Does NOT Affect
β Repository cloning - The entire repository is always cloned β Git operations - Git commands work on the full repository β Sandbox environment - The complete project branch is available in the sandbox β File access - You can still access files outside the base pathConfiguration
Setting Your Base Path
- Open your project in Teta
- Go to App Settings > App Info
- Find the Base Path field
- Enter your desired path
Path Format Rules
Important: Follow these formatting rules: β Correct format:Empty Base Path
If you leave the Base Path field empty:- It defaults to the root of your repository
- Commands will execute from the repository root
- Deployment will use the root directory
Use Cases
Monorepo Structure
If your repository has multiple applications:- For mobile app:
apps/mobile - For web app:
apps/web - For admin app:
apps/admin
Nested Project
If your main app is in a subdirectory:frontend
Root Level Project
If your app is at the repository root:.)
Examples by Framework
Flutter Projects
Typical structure:flutter_app
Effect:
flutter runexecutes influtter_app/flutter buildruns influtter_app/- Deployment uses
flutter_app/build/web
React Projects
Typical structure:react-app
Effect:
npm installruns inreact-app/npm run devexecutes inreact-app/- Deployment uses
react-app/buildorreact-app/dist
Svelte Projects
Typical structure:svelte-app
Effect:
npm installruns insvelte-app/npm run devexecutes insvelte-app/- Deployment uses
svelte-app/build
How Teta Uses Base Path
During Development
When you start your app preview:- Teta clones the entire repository
- Teta navigates to the Base Path directory
- Teta executes framework-specific commands (e.g.,
flutter run,npm run dev) - Your app runs from the specified directory
During Deployment
When you publish your app:- Teta builds your app in the Base Path directory
- Teta collects build artifacts from the Base Path (e.g.,
build/web,dist/) - Teta deploys only the built files
AI Assistance
When working with AI:- AI can access all files in your repository
- AI understands your Base Path configuration
- AI executes commands relative to the Base Path when appropriate
- You can still ask AI to modify files outside the Base Path
Troubleshooting
App Wonβt Start
Problem: Preview shows errors or wonβt start Solutions:- Verify your Base Path is correct
- Check that
pubspec.yamlorpackage.jsonexists in the Base Path - Ensure the path format is correct (no leading/trailing slashes)
- Try leaving Base Path empty if your app is at the root
Build Failures
Problem: Deployment or build commands fail Solutions:- Confirm the Base Path contains the correct build configuration
- Check that all dependencies are properly defined in the Base Path
- Verify build output directories exist (e.g.,
build/,dist/) - Review build logs for path-related errors
Wrong Directory
Problem: Commands are running in the wrong location Solutions:- Double-check the Base Path setting in Settings > Project Settings
- Ensure the path matches your repository structure exactly
- Remember: paths are case-sensitive
- Use forward slashes
/even on Windows
Best Practices
1. Keep It Simple
Use Base Path only when necessary:- β Use for monorepos with multiple apps
- β Use for nested project structures
- β Donβt use if your app is at the root
- β Avoid overly deep nesting
2. Document Your Structure
Add a note in your repositoryβs README:3. Consistent Naming
Use clear, descriptive directory names:- β
apps/mobile,apps/web,packages/ui - β
app1,proj,x
4. Test After Changing
After updating Base Path:- Save the setting
- Restart your preview
- Verify the app runs correctly
- Test deployment if applicable
Advanced Configuration
Multiple Environments
For projects with multiple environments:- Use different Teta projects for each environment
- Set different Base Paths for each project
- Link to different branches if needed
Shared Dependencies
For monorepos with shared code:- Base Path set to
apps/mobile - AI can still access and modify
packages/shared/ - Build tools can reference parent directories
Related Settings
Base Path works alongside other project settings:- Branch: Which branch to clone (entire repo is still cloned)
- GitHub Integration: Repository connection (unaffected by Base Path)
- Environment Variables: Defined for the Base Path context
- Build Commands: Execute relative to the Base Path
FAQs
Can I use absolute paths?
No, Base Path must be relative to the repository root.Can I change Base Path after deployment?
Yes, but youβll need to redeploy your app for changes to take effect.Does Base Path affect Git operations?
No, Git operations (commit, push, pull) always work on the full repository.Can I have multiple Base Paths?
Not in a single Teta project. Create separate projects for different apps in your monorepo.What if my Base Path doesnβt exist?
Teta will show an error. Ensure the path exists in your repository before setting it.Does Base Path affect file uploads?
No, file uploads and AI file operations can access the entire repository.Getting Help
Need assistance with Base Path configuration? π§ Email: support@teta.so π¬ Discord: discord.gg/teta π Docs: docs.teta.so π GitHub: github.com/teta-so/teta/issuesRelated Documentation
- Getting Started - Platform basics
- GitHub Integration - Connect your repository
- Preview Controls - Running your app
Questions? Contact support@teta.so