Spaces:
Paused
Paused
File size: 8,048 Bytes
56c7b6d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | # Quick Start Guide - Modern React SaaS
Complete setup and run instructions for the new Job Apply AI React frontend.
## π What's New
β¨ **Modern React 18 Frontend**
- Beautiful dark SaaS theme (black + emerald green)
- Smooth Framer Motion animations
- Professional component library
- Responsive design for all devices
π **Improved State Management**
- Zustand for reactive state
- Persistent storage
- Clean API
β‘ **Better Performance**
- Optimized React build
- Code splitting
- CSS-in-JS with Tailwind
π οΈ **REST API Endpoints**
- Proper API structure
- CORS enabled
- Easy to extend
## π Quick Start (5 minutes)
### 1οΈβ£ Install Dependencies
```bash
# Python backend
pip install -r requirements.txt
pip install flask-cors
# React frontend
cd frontend
npm install
```
### 2οΈβ£ Start the Backend (Terminal 1)
```bash
# Activate virtual environment
source venv/bin/activate # Linux/Mac
# OR
venv\Scripts\activate.bat # Windows
# Run Flask server
python -m job_apply_ai.ui.app_new
```
You should see:
```
Running on http://0.0.0.0:5050
```
### 3οΈβ£ Start the Frontend (Terminal 2)
```bash
cd frontend
npm run dev
```
You should see:
```
VITE v5.0.0 ready in 123 ms
β Local: http://localhost:3000/
```
### 4οΈβ£ Open Your Browser
Visit: **http://localhost:3000**
You should see the beautiful Job Apply AI home page! π
## π How to Use
### Home Page
- Overview of features
- Call-to-action buttons
- Statistics
### Workflow
1. **Upload CV** - Drag and drop your .docx file
2. **Search Jobs** - Enter job title and location
3. **Review Jobs** - See matched skills for each job
4. **Generate CVs** - Select jobs and create tailored CVs
5. **Download** - Get all CVs as a ZIP file
### Settings
- Toggle between "Smart Mode" (local) and "AI Mode" (with API)
- Configure LLM provider
- Enable/disable professional summaries
## π¨ Customization
### Change Theme Colors
Edit `frontend/tailwind.config.js`:
```javascript
colors: {
emerald: {
500: '#22c55e', // Change to your color
// ... other shades
},
black: '#0A0E27', // Or your dark color
// Custom colors here
}
```
### Modify Animations
Edit `frontend/src/components/common/Button.tsx`:
```tsx
whileHover={{ y: -2 }} // Change hover distance
whileTap={{ scale: 0.98 }} // Change tap scale
transition={{ duration: 0.3 }} // Change duration
```
### Add New Pages
1. Create `frontend/src/components/pages/NewPage.tsx`
2. Import in `frontend/src/App.tsx`
3. Add route logic in App component
Example:
```tsx
{currentPage === 'newpage' && (
<NewPage onBack={() => setCurrentPage('home')} />
)}
```
## π§ Development Commands
```bash
# Frontend
cd frontend
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
npm run type-check # Check TypeScript
npm run lint # Run ESLint
```
## π Project Structure
```
Job-apply-AI/
βββ frontend/ # React app (NEW)
β βββ src/
β β βββ components/
β β β βββ common/ # Reusable components
β β β βββ pages/ # Full pages
β β β βββ sections/ # Page sections
β β βββ store/ # Zustand store
β β βββ types/ # TypeScript types
β β βββ utils/
β β β βββ api.ts # API calls
β β β βββ helpers.ts # Utilities
β β βββ styles/ # Global CSS
β β βββ App.tsx # Root component
β β βββ main.tsx # Entry point
β βββ tailwind.config.js # Theme config
β βββ vite.config.ts # Build config
β βββ package.json
β
βββ job_apply_ai/ # Python backend
β βββ ui/
β β βββ app_new.py # New Flask app (UPDATED)
β β βββ app.py # Old Flask app (legacy)
β βββ scraper/ # Job scraping
β βββ cv_modifier/ # CV customization
β βββ utils/ # Helpers
β
βββ requirements.txt # Python deps (UPDATED)
βββ DEPLOYMENT_GUIDE.md # Deployment (NEW)
βββ SAAS_FEATURES.md # Features doc (NEW)
βββ README.md # Main docs (UPDATED)
```
## π Deploying to Production
### Build the frontend
```bash
cd frontend
npm run build
```
This creates `frontend/dist/` with optimized files that Flask will serve.
### Run with production settings
```bash
# Set environment variables
export FLASK_ENV=production
export FLASK_DEBUG=False
export SECRET_KEY=your_random_secret_key
# Run with gunicorn
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5050 job_apply_ai.ui.app:app
```
Visit `http://localhost:5050` to see the production build.
## π Troubleshooting
### Frontend won't load
```bash
# Make sure backend is running
curl http://localhost:5050
# Check React dev server
# Should see "Ready in XXX ms" in terminal
```
### API calls failing
```bash
# Check if endpoints exist
curl http://localhost:5050/api/health
# Should return: {"status":"ok","version":"2.0.0"}
```
### Styles look wrong
```bash
# Restart dev server
npm run dev
# Clear cache
rm -rf node_modules/.vite
```
### Port already in use
```bash
# Change port in vite.config.ts or terminal
npm run dev -- --port 3001
# Or change Flask port
export PORT=5051
python -m job_apply_ai.ui.app_new
```
## π Key Files to Know
### Frontend
- **App.tsx** - Main app logic, page routing
- **appStore.ts** - All state management
- **api.ts** - Backend API calls
- **tailwind.config.js** - Colors, themes, animations
- **Job components** - Job search, listing, generation
### Backend
- **app_new.py** - Flask server with React routing + APIs
- **linkedin.py** - Job scraping
- **cv_analyzer.py** - Skill extraction
- **cv_modifier.py** - CV customization
## π― Common Tasks
### Add a new API endpoint
1. Add backend method in `app_new.py`:
```python
@app.route('/api/my-endpoint', methods=['POST'])
def my_endpoint():
return jsonify({'success': True})
```
2. Add frontend call in `api.ts`:
```typescript
async myAPICall() {
const response = await api.post('/my-endpoint');
return response.data;
}
```
3. Use in component:
```tsx
const handleClick = async () => {
const data = await jobsAPI.myAPICall();
setNotification({ type: 'success', message: 'Done!' });
}
```
### Change color scheme
All colors are in `tailwind.config.js` and `globals.css`. Change:
- `emerald` colors for primary actions
- `slate` colors for text/backgrounds
- `black` for dark mode
### Add a loading skeleton
Import Spinner:
```tsx
import { Spinner } from '@/components/common';
<Spinner size="md" /> // sm, md, lg
```
### Create a modal dialog
```tsx
import Modal from '@/components/common/Modal';
<Modal isOpen={isOpen} onClose={onClose} title="Confirm">
Your content here
</Modal>
```
## π Environment Variables
### Backend (.env)
```
FLASK_ENV=development
CV_TAILORING_MODE=local
LLM_PROVIDER=groq
GROQ_API_KEY=xxxxx
```
### Frontend (.env in frontend/)
```
VITE_API_URL=http://localhost:5050
VITE_APP_NAME=Job Apply AI
```
## π Support
Need help?
1. **Check logs** - Terminal output usually shows the issue
2. **Read DEPLOYMENT_GUIDE.md** - Detailed deployment info
3. **Review SAAS_FEATURES.md** - Feature documentation
4. **Check frontend/README.md** - React-specific docs
## β
Checklist
- [ ] Installed Python and Node.js 18+
- [ ] Ran `npm install` in frontend folder
- [ ] Pinned flask-cors in requirements.txt
- [ ] Started backend on port 5050
- [ ] Started frontend on port 3000
- [ ] Opened http://localhost:3000
- [ ] Tested file upload
- [ ] Tested job search
- [ ] Tested CV generation
- [ ] βοΈ Celebrated the beautiful new UI!
---
**Ready to use your amazing new Job Apply AI?** π
Start building better job applications! πΌβ¨
|