Unlisted
Like
Prompt_Improver
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v219View latest version
This project uses Val Town Projects architecture for modular deployment.
-
Val Town CLI installed:
npm install -g @valtown/cli -
Authenticate with Val Town:
vt auth -
Environment Variables:
OPENAI_API_KEY- Your OpenAI API keyVAL_TOWN_API_KEY- Automatically provided by Val Town
Prompt_Improver/
βββ index.http.ts # Main HTTP handler
βββ val.json # Project configuration
βββ workers/
β βββ clarifier.ts # Clarification worker
β βββ condenser.ts # Condensation worker
β βββ includer.ts # Enhancement worker
βββ frontend/
β βββ index.html # Frontend UI
β βββ ...
βββ backend/
β βββ backend_logic.js # Orchestration logic
β βββ ...
βββ shared/
β βββ shared_utils.js # Shared utilities
βββ README.md
From the project root directory:
cd /home/toowired/Prompt_Improver vt push
This will:
- Deploy the entire project as a Val Town Project
- Create the main HTTP endpoint
- Bundle all workers, frontend, and backend code
- Set up proper routing and imports
vt status
vt logs
For local development:
vt dev
After deployment, your application will be available at:
https://[username]-prompt-improver.web.val.run
GET /- Frontend interfacePOST /api/improve- Improve prompt endpointGET /health- Health checkGET /api/test-workers- Test all workers
The val.json file configures:
- Entry point:
index.http.ts - Project type: HTTP
- Dependencies: Hono, OpenAI, Val Town utils
- Environment variables required
- Public visibility
- Single Deployment: One
vt pushdeploys everything - Local Workers: All workers run in the same context (fast)
- Relative Imports: Clean import paths within the project
- File Serving: Frontend files served directly from project
- Version Control: Entire project versioned together
vt auth --reset
Check that:
- You're in the correct directory
val.jsonis valid JSON- All imports use correct relative paths
vt logs --tail
Set in Val Town dashboard:
- Go to your val's settings
- Add
OPENAI_API_KEY VAL_TOWN_API_KEYis automatically provided
To update the deployed project:
vt push
This will update the existing deployment with your changes.
Before deployment, test locally:
vt dev
Visit http://localhost:3000 to test the application.
- Frontend files in
/frontend/are served viaserveFile() - Workers are imported directly as TypeScript modules
- Shared utilities available to all components
- Backend logic handles orchestration
This architecture provides the benefits of modular design while keeping everything in a single deployable project.