https://career-flow-api.onrender.com
An intelligent job matching system that automatically scrapes opportunities from 5+ international sources, matches them to user profiles using AI algorithms, and delivers personalized recommendations via Telegram and email.
π Features β’ π οΈ Tech Stack β’ π¦ Installation β’ π³ Docker β’ π§ͺ Testing β’ π‘ API
- Overview
- Features
- Architecture
- Tech Stack
- Installation
- Docker Deployment
- Usage Guide
- API Documentation
- Testing
- Project Structure
- Security
- Contributing
- License
CareerFlow is a production-ready, full-stack job matching platform that solves the problem of finding relevant job opportunities in a crowded market. It combines:
- Automated Data Collection: Scrapes jobs from 5+ international sources every 30 minutes
- Intelligent Matching: Uses a multi-factor scoring algorithm to match jobs to user profiles
- Real-time Notifications: Delivers personalized recommendations via Telegram bot and email
- Modern UI: Beautiful, responsive dark-themed dashboard with real-time analytics
- Enterprise-Grade Infrastructure: Docker, PostgreSQL, automated testing, and professional logging
-
Multi-Source Job Scraping: Automatically fetches jobs from:
- Remotive API (Remote Python jobs)
- WeWorkRemotely (RSS feed)
- RemoteOK (RSS feed)
- Python.org Jobs (RSS feed)
- Hacker News "Who is Hiring" (RSS feed)
-
Smart Matching Algorithm: Scores jobs based on:
- Skill compatibility (70% weight)
- Target market alignment (15% weight)
- Remote work preference (10% weight)
- Experience level (5% weight)
-
Scheduled Tasks:
- Job scraper runs every 30 minutes
- Daily job delivery to Telegram users at 9 AM
- Configurable via APScheduler
- Modern Frontend: Dark theme with purple gradient, animations, and Chart.js visualizations
- Telegram Bot:
- User verification via activation codes
- On-demand job recommendations (
/matchescommand) - Automated daily job delivery
- Email Notifications: Welcome emails with activation codes (SMTP support)
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- JWT Authentication: Secure token-based authentication
- Password Hashing: bcrypt with automatic salt generation
- Rate Limiting: 60 requests per minute per IP
- IP Blocking: Admin can block malicious IPs
- CORS Protection: Configurable cross-origin resource sharing
- Input Validation: Pydantic schemas for all API endpoints
- SQLAdmin Integration: Professional admin interface
- User Management: View, edit, and manage users
- Job Source Control: Enable/disable job sources
- Job Moderation: Review and manage job opportunities
- IP Blocking: Block/unblock IPs from admin panel
- Statistics API: JSON endpoint for system metrics (
/api/stats)
- Type Safety: Full type hints with Pydantic and SQLAlchemy
- Auto-generated Docs: Swagger UI and ReDoc
- Professional Logging: Loguru with file rotation
- Automated Testing: pytest with 5 comprehensive tests
- Docker Support: One-command deployment
- Hot Reload: Fast development with
--reloadflag
βββββββββββββββββββ
β Frontend β HTML5 + Tailwind CSS + Chart.js
β (Browser) β
ββββββββββ¬βββββββββ
β HTTP/REST
βΌ
βββββββββββββββββββ
β FastAPI β Python 3.12+
β Backend β JWT Auth, Rate Limiting
ββββββββββ¬βββββββββ
β
ββββββ΄βββββ¬βββββββββββββ¬ββββββββββββββ
βΌ βΌ βΌ βΌ
ββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
βPostgreSQLβ βTelegram β βEmail β βBackgroundβ
βDatabase β βBot β βService β βTasks β
β β β(Aiogram) β β(SMTP) β β(APSch.) β
ββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
| Technology | Purpose |
|---|---|
| FastAPI | Modern, fast web framework |
| SQLAlchemy 2.0 | ORM for database management |
| PostgreSQL 15 | Production-ready database |
| Pydantic V2 | Data validation and settings |
| APScheduler | Background task scheduling |
| Aiogram 3.x | Telegram bot framework |
| aiosmtplib | Async email sending |
| python-jose | JWT token handling |
| passlib + bcrypt | Password hashing |
| slowapi | Rate limiting |
| Loguru | Professional logging |
| Technology | Purpose |
|---|---|
| HTML5 | Semantic markup |
| Tailwind CSS | Utility-first CSS framework |
| Chart.js | Interactive charts and graphs |
| Vanilla JavaScript | No framework overhead |
| Technology | Purpose |
|---|---|
| Docker | Containerization |
| Docker Compose | Multi-container orchestration |
| PostgreSQL | Relational database |
| Mailpit | Email testing (development) |
| uv | Fast Python package manager |
| Technology | Purpose |
|---|---|
| pytest | Automated testing framework |
| httpx | Async HTTP client for tests |
| pytest-asyncio | Async test support |
- Python 3.12 or higher
- uv (fast Python package manager)
- Git
- PostgreSQL 15+ (optional, SQLite works for development)
git clone https://github.com/pouriya-py/career_flow_api.git
cd career_flow_apiuv syncCreate a .env file in the root directory:
# Telegram Bot Token (get from @BotFather)
BOT_TOKEN=your_telegram_bot_token_here
# Database (SQLite for development, PostgreSQL for production)
DATABASE_URL=sqlite:///./career_flow.db
# DATABASE_URL=postgresql://user:password@localhost:5432/careerflow
# Email Configuration (Mailpit for local testing)
SMTP_HOST=localhost
SMTP_PORT=1025
FROM_EMAIL=noreply@careerflow.local
# JWT Secret Key (CHANGE THIS IN PRODUCTION!)
SECRET_KEY=your-super-secret-key-change-in-production# Create tables and seed initial data
uv run python seed.py
# Fetch initial jobs from all sources
uv run python test_scraper.pyuv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadThe application will be available at:
- Frontend: http://127.0.0.1:8000
- API Documentation: http://127.0.0.1:8000/docs
- Admin Panel: http://127.0.0.1:8000/admin (credentials:
admin/admin123) - Statistics API: http://127.0.0.1:8000/api/stats
The easiest way to run CareerFlow in production is with Docker Compose.
- Docker Desktop (Mac/Windows) or Docker Engine (Linux)
- Docker Compose v2+
# 1. Clone repository
git clone https://github.com/pouriya-py/career_flow_api.git
cd career_flow_api
# 2. Create .env file
cp .env.example .env
# Edit .env and add your BOT_TOKEN
# 3. Start all services
docker-compose up --build -d
# 4. Initialize database
docker exec -it careerflow_app uv run python seed.py
docker exec -it careerflow_app uv run python test_scraper.py- Frontend: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Admin Panel: http://localhost:8000/admin
- Mailpit UI: http://localhost:8025 (email testing)
- PostgreSQL: localhost:5432
# View logs
docker-compose logs -f app
# Stop services
docker-compose down
# Rebuild after code changes
docker-compose up --build -d
# Reset database (WARNING: deletes all data)
docker-compose down -v
docker-compose up --build -d-
Visit http://127.0.0.1:8000
-
Click "Login / Register"
-
Fill in the registration form:
- Username
- Password (min 6 characters)
- Experience years
- Target market (Global/Iran)
- Skills (comma-separated, e.g., "Python, FastAPI, Docker")
- Favorite job sources
-
After registration, you'll receive an activation code (e.g.,
ACT-A1B2C3D4)
- Open Telegram and search for your bot (created via @BotFather)
- Send
/startcommand - Send your activation code (e.g.,
ACT-A1B2C3D4) - Your account is now connected!
- On-demand: Send
/matchescommand to the bot - Automatic: Receive daily job recommendations at 9 AM
The dashboard shows:
- Total jobs in database
- Remote jobs count
- Active job sources
- Your match score
- Charts: Job distribution by source, Top skills in demand
- Visit http://127.0.0.1:8000/admin
- Login with
admin/admin123 - Manage users, job sources, jobs, and blocked IPs
- View system statistics at http://127.0.0.1:8000/api/stats
Interactive API documentation is available at:
- Swagger UI: http://127.0.0.1:8000/docs
- ReDoc: http://127.0.0.1:8000/redoc
| Method | Endpoint | Description |
|---|---|---|
| POST | /users/ |
Create new user |
| POST | /users/login |
Login and get JWT token |
| GET | /users/me |
Get current user profile |
| PUT | /users/me |
Update user profile |
| Method | Endpoint | Description |
|---|---|---|
| GET | /jobs/ |
Get all jobs (limit: 100) |
| GET | /jobs/matches |
Get personalized job matches (requires auth) |
| POST | /jobs/webhook/jobs |
Receive jobs from external webhook |
| Method | Endpoint | Description |
|---|---|---|
| GET | /sources/ |
Get all job sources |
| GET | /sources/active |
Get active job sources |
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /api/stats |
System statistics (JSON) |
CareerFlow includes comprehensive automated tests to ensure reliability.
uv run pytest -v- β Health check endpoint
- β User registration (success and duplicate prevention)
- β Job matching algorithm (perfect and partial matches)
- β Authentication flow
- β API response validation
tests/test_api.py::test_health_check PASSED
tests/test_api.py::test_user_registration_success PASSED
tests/test_api.py::test_user_registration_duplicate PASSED
tests/test_matching.py::test_matching_algorithm_perfect_match PASSED
tests/test_matching.py::test_matching_algorithm_partial_match PASSED
============================================ 5 passed in 1.23s =============================================
career_flow_api/
βββ app/
β βββ __init__.py
β βββ main.py # FastAPI application entry point
β βββ models.py # SQLAlchemy database models
β βββ schemas.py # Pydantic request/response schemas
β βββ auth.py # JWT authentication logic
β βββ middleware.py # IP blocking middleware
β βββ database.py # Database configuration
β βββ tasks.py # Background tasks (scraper, bot)
β βββ core/
β β βββ logger.py # Loguru configuration
β βββ routes/
β β βββ __init__.py
β β βββ users.py # User endpoints
β β βββ jobs.py # Job endpoints
β β βββ sources.py # Source endpoints
β βββ services/
β βββ email_service.py # Email sending logic
β βββ matching_service.py # Job matching algorithm
βββ static/
β βββ index.html # Frontend application
βββ tests/
β βββ __init__.py
β βββ conftest.py # Pytest configuration
β βββ test_api.py # API endpoint tests
β βββ test_matching.py # Matching algorithm tests
βββ .env # Environment variables (not in git)
βββ .gitignore
βββ Dockerfile # Docker image definition
βββ docker-compose.yml # Multi-container setup
βββ pytest.ini # Pytest configuration
βββ pyproject.toml # Python dependencies
βββ uv.lock # Locked dependencies
βββ seed.py # Database seeder
βββ test_scraper.py # Manual scraper test
βββ README.md # This file
- β Password hashing with bcrypt (automatic salt)
- β JWT token authentication
- β Rate limiting (60 requests/minute)
- β IP blocking system
- β CORS protection
- β Input validation with Pydantic
- β SQL injection prevention (SQLAlchemy ORM)
- β XSS protection (FastAPI default)
Before deploying to production:
- Change SECRET_KEY in
.envto a strong random string - Change admin password in
app/main.py(AdminAuth class) - Use PostgreSQL instead of SQLite
- Enable HTTPS with SSL certificates
- Set up proper email provider (SendGrid, AWS SES, etc.)
- Configure firewall and restrict access
- Enable database backups
- Set up monitoring and alerting
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guide
- Write tests for new features
- Update documentation
- Use type hints
- Keep functions small and focused
This project is licensed under the MIT License - see the LICENSE file for details.
- Job data sourced from: Remotive, WeWorkRemotely, RemoteOK, Python.org, Hacker News
- Built with FastAPI, SQLAlchemy, and Aiogram
- UI inspired by modern dark theme designs
- Icons from Font Awesome
For questions, issues, or feature requests:
- Open an issue on GitHub
- Contact the author: @pouriya-py
β If you find this project useful, please consider giving it a star on GitHub! β
Made with β€οΈ by Pouriya