1 ---
2 name: repl_setup
3 description: Setup and configure web applications in the Replit environment. Covers host configuration, frontend/backend connectivity, cache control, and framework-specific setup for Angular, React, Vite, and Vue.
4 ---
5
6 # Repl Setup
7
8 Guidelines for setting up and configuring web applications to work correctly in the Replit environment. Users see your application through a proxy (iframe), which requires specific configuration.
9
10 ## When to Use
11
12 Use this skill when:
13
14 - Setting up a new web application or frontend framework
15 - The user cannot see your frontend changes
16 - Configuring host settings for development servers
17 - Connecting frontend code to backend APIs
18 - Debugging visibility issues with the user's preview
19
20 ## When NOT to Use
21
22 - For non-web applications (CLI tools, scripts, etc.)
23 - When the application is already working correctly
24 - For deployment/publishing issues (use the deployment skill)
25
26 ## Critical Replit Environment Rules
27
28 ### Host Configuration
29
30 The user sees your frontend through a proxy within an iframe. **You must configure your development server to allow all hosts**, otherwise the user will never see your frontend.
31
32 Every web framework needs its development configuration set to allow all hosts. If you don't know the specific configuration for a framework, use web search to find it.
33
34 ### Frontend Server Port
35
36 Bind frontend servers to **0.0.0.0:5000**. Never bind anything else to port 5000.
37
38 ### No Docker or Virtual Environments
39
40 Never use Docker, virtual environments, or containerization. Replit uses a Nix environment that doesn't support nested virtualization.
41
42 ## Stack-Specific Setup
43
44 For framework-specific configuration, refer to these guides:
45
46 - `.local/skills/repl_setup/references/angular.md` - Angular setup with allowedHosts and CLI flags
47 - `.local/skills/repl_setup/references/react_vite.md` - React and Vite configuration
48 - `.local/skills/repl_setup/references/vue.md` - Vue.js setup
49
50 For Microsoft Fabric (MSFT_RAYFIN) apps, the standard Replit dev-server proxy rules don't apply — the project is published to the Microsoft Rayfin backend instead. Use the `msft-rayfin` skill for setup instructions and the `fabric-rayfin` skill for the deploy workflow.
51
52 ## Frontend-Backend Connectivity
53
54 When your frontend calls a local backend API:
55
56 1. **Get the public domain**: Run `env | grep DOMAIN` in the shell to get the website's public URL
57 2. **Use the public URL**: Replace any `localhost` references with the public domain
58 3. **Never use localhost**: You're in a cloud environment - the user cannot access your localhost
59
60 ```bash
61 # Get the public domain for API calls
62 env | grep DOMAIN
63 ```
64
65 ## Debugging Visibility Issues
66
67 If the user reports they cannot see your changes:
68
69 1. **Check workflow status**: Ensure the workflow is running and has been restarted after changes
70 2. **Read console logs**: Check for errors and follow any instructions in the logs
71 3. **Verify host configuration**: Confirm the framework's dev config allows all hosts (most common issue)
72 4. **Cache control** (rare): If above checks pass, the issue may be caching
73 - Modify webserver code to disable cache storage
74 - Instruct user to use "empty cache and hard refresh" in developer tools
75
76 ## Workflow Setup Order
77
78 Always set up frontend workflows first, then backend services. After completing any task:
79
80 1. Re-run the workflows to ensure they're running
81 2. Read the console logs to verify no errors
82 3. Take a screenshot to confirm the frontend is visible
83
84 ## Best Practices
85
86 1. **Verify host config early**: Check framework-specific allowedHosts before writing any code
87 2. **Test visibility immediately**: After setup, verify the user can see the preview
88 3. **Use public URLs**: Never hardcode localhost in frontend code
89 4. **Restart after changes**: Server-side changes require workflow restart
90 5. **Check logs first**: Console logs often reveal the root cause of issues