|
| 1 | +# CLI Website with Interactive Applications |
| 2 | + |
| 3 | +This fork of the Root VC CLI website adds an interactive job application flow that submits directly to Attio. |
| 4 | + |
| 5 | +## What's New |
| 6 | + |
| 7 | +### Features Added: |
| 8 | +1. **Interactive Application Flow**: Candidates can now apply directly in the terminal using the `apply` command |
| 9 | +2. **Job Listings**: Added a Venture Capital Associate position (in `config/jobs.js`) |
| 10 | +3. **Netlify Functions**: Backend function to proxy Attio API calls |
| 11 | +4. **Terminal Input Collection**: New `collectInput()` helper for interactive data entry |
| 12 | + |
| 13 | +## Testing Locally |
| 14 | + |
| 15 | +The dev server should already be running on http://localhost:8888 |
| 16 | + |
| 17 | +Try these commands in the terminal: |
| 18 | +- `jobs` - See open positions |
| 19 | +- `fg 1` - View the Associate role details |
| 20 | +- `apply 1` - Start the interactive application process |
| 21 | + |
| 22 | +## How It Works |
| 23 | + |
| 24 | +1. User types `apply 1` in the terminal |
| 25 | +2. Terminal prompts for: |
| 26 | + - Name (required) |
| 27 | + - Email (required) |
| 28 | + - LinkedIn URL (optional) |
| 29 | + - GitHub username (optional) |
| 30 | + - Why Root / notes (optional) |
| 31 | +3. Data is submitted to `/.netlify/functions/submit-application` |
| 32 | +4. Netlify function forwards to Attio webhook |
| 33 | +5. Success/error message shown to user |
| 34 | + |
| 35 | +## File Changes |
| 36 | + |
| 37 | +### New Files: |
| 38 | +- `netlify/functions/submit-application.js` - Proxies to Attio API |
| 39 | +- `netlify.toml` - Netlify configuration |
| 40 | +- `DEPLOYMENT.md` - This file |
| 41 | + |
| 42 | +### Modified Files: |
| 43 | +- `config/jobs.js` - Added Associate position |
| 44 | +- `config/commands.js` - Updated `jobs` and `apply` commands |
| 45 | +- `js/terminal-ext.js` - Added `collectInput()` helper |
| 46 | + |
| 47 | +## Deployment to Production |
| 48 | + |
| 49 | +### Option 1: Deploy to Netlify (Recommended) |
| 50 | + |
| 51 | +1. Push this repo to GitHub: |
| 52 | + ```bash |
| 53 | + cd /Users/avidan/Development/cli-website-fork |
| 54 | + git remote set-url origin <your-new-repo-url> |
| 55 | + git add . |
| 56 | + git commit -m "Add interactive job application flow" |
| 57 | + git push origin main |
| 58 | + ``` |
| 59 | + |
| 60 | +2. Connect to Netlify: |
| 61 | + - Go to https://app.netlify.com |
| 62 | + - Click "Add new site" → "Import an existing project" |
| 63 | + - Connect your GitHub repo |
| 64 | + - Build settings should auto-detect from netlify.toml |
| 65 | + - Deploy! |
| 66 | + |
| 67 | +3. The site will be live at `https://your-site-name.netlify.app` |
| 68 | + |
| 69 | +### Option 2: Deploy to Root.vc Domain |
| 70 | + |
| 71 | +If you want this on the main root.vc site: |
| 72 | + |
| 73 | +1. Update the existing root.vc repo with these changes |
| 74 | +2. Netlify will auto-deploy on push (already configured) |
| 75 | + |
| 76 | +## Security Considerations |
| 77 | + |
| 78 | +### Current Setup: |
| 79 | +- Attio webhook URL is hardcoded in the Netlify function |
| 80 | +- This is okay since the webhook is designed to be public |
| 81 | + |
| 82 | +### For Production (Optional): |
| 83 | +You could move the Attio webhook to an environment variable: |
| 84 | + |
| 85 | +1. In `netlify/functions/submit-application.js`, replace the URL with: |
| 86 | + ```javascript |
| 87 | + const attioWebhook = process.env.ATTIO_WEBHOOK_URL; |
| 88 | + ``` |
| 89 | + |
| 90 | +2. Add to Netlify environment variables: |
| 91 | + - Go to Site settings → Environment variables |
| 92 | + - Add `ATTIO_WEBHOOK_URL` = `https://hooks.attio.com/w/...` |
| 93 | + |
| 94 | +## Customization |
| 95 | + |
| 96 | +### Adding More Job Positions: |
| 97 | + |
| 98 | +Edit `config/jobs.js`: |
| 99 | +```javascript |
| 100 | +const jobs = { |
| 101 | + 1: ["Role Title", "Description line 1", "Description line 2", ...], |
| 102 | + 2: ["Another Role", "Description", ...], |
| 103 | +}; |
| 104 | +``` |
| 105 | + |
| 106 | +### Changing Application Fields: |
| 107 | + |
| 108 | +Edit the `apply` command in `config/commands.js` to add/remove fields using `term.collectInput()`. |
| 109 | + |
| 110 | +### Modifying the Terminal Style: |
| 111 | + |
| 112 | +- Colors: Edit `colorText()` function in `js/terminal.js` |
| 113 | +- Prompts: Edit welcome messages in `js/terminal-ext.js` |
| 114 | +- ASCII art: Add images to `images/` and reference in `config/team.js` or `config/portfolio.js` |
| 115 | + |
| 116 | +## Testing the Flow |
| 117 | + |
| 118 | +Open http://localhost:8888 in your browser and try: |
| 119 | + |
| 120 | +```bash |
| 121 | +> help |
| 122 | +> jobs |
| 123 | +> fg 1 |
| 124 | +> apply 1 |
| 125 | +``` |
| 126 | + |
| 127 | +Follow the prompts and submit. Check your Attio to confirm the entry was created. |
| 128 | + |
| 129 | +## Troubleshooting |
| 130 | + |
| 131 | +**Functions not working locally?** |
| 132 | +- Make sure you ran `npm start` (not just `npm run build`) |
| 133 | +- Netlify CLI should show functions being served |
| 134 | + |
| 135 | +**Application submissions failing?** |
| 136 | +- Check browser console for errors |
| 137 | +- Verify Attio webhook URL is correct |
| 138 | +- Test the webhook directly with curl: |
| 139 | + ```bash |
| 140 | + curl -X POST https://hooks.attio.com/w/... \ |
| 141 | + -H "Content-Type: application/json" \ |
| 142 | + -d '{"name":"Test","email":"[email protected]"}' |
| 143 | + ``` |
| 144 | + |
| 145 | +**Terminal not responding?** |
| 146 | +- Try `clear` command to reset |
| 147 | +- Refresh the page |
| 148 | +- Check browser console for JavaScript errors |
0 commit comments