AI-powered backend application that helps users manage job applications and analyze job descriptions using Large Language Models (LLMs). Built with FastAPI, PostgreSQL, SQLAlchemy, JWT Authentication, and Groq's Llama 3.1 model.
- User Registration and Login with JWT Authentication
- Secure REST APIs with Protected Endpoints
- Job Application Tracking and Management
- AI-Powered Job Description Analysis
- Extraction of Required Skills, Experience Level, Responsibilities, and Salary Insights
- PostgreSQL Database Integration
- SQLAlchemy ORM for Database Operations
- Database Versioning with Alembic Migrations
- Rate Limiting using SlowAPI
- Dockerized Application Setup
- Automated Testing with Pytest
- Clean Layered Architecture (Routes, Services, Models, Schemas)
- React Frontend Integration Planned
- Replacing Llama 3.8B model with GPT OSS 20B *Adding Rate Limiting
The application follows a layered architecture:
- Client Layer (React Frontend, Swagger UI, Postman)
- FastAPI API Layer
- Authentication & Dependency Layer
- Business Logic Service Layer
- PostgreSQL Persistence Layer
- Groq AI Integration Layer
- Dockerized Deployment Layer
| Layer | Technology |
|---|---|
| Backend | FastAPI |
| Database | PostgreSQL |
| ORM | SQLAlchemy |
| Authentication | JWT (HTTPBearer) |
| AI Model | Groq (Llama 3.1 8B) |
| Migrations | Alembic |
| Rate Limiting | SlowAPI |
| Testing | Pytest |
| Containerization | Docker |
| Deployment | Railway |
ai_analyzer/
│
├── app/
│ ├── core/
│ ├── dependencies/
│ ├── models/
│ ├── routes/
│ ├── schemas/
│ ├── services/
│ └── utils/
│
├── migrations/
├── tests/
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── alembic.ini
└── README.md
Client
│
POST /login
│
JWT Token
│
Authorization: Bearer
│
Protected Endpoint
git clone https://github.com/Farru049/ai_analyzer.git
cd ai_analyzerpython -m venv myenvWindows:
myenv\Scripts\activateLinux / macOS:
source myenv/bin/activatepip install -r requirements.txtanalyzer_db
Create a .env file:
DATABASE_URL=postgresql://username:password@localhost:5432/analyzer_db
SECRET_KEY=your_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
GROQ_API_KEY=your_groq_api_keyalembic upgrade headuvicorn app.main:app --reloadApplication will be available at:
http://127.0.0.1:8000
Swagger Documentation:
http://127.0.0.1:8000/docs
Build and run:
docker-compose up --buildpytest| Method | Endpoint | Description |
|---|---|---|
| POST | /register | Register User |
| POST | /login | Login User |
| Method | Endpoint | Description |
|---|---|---|
| GET | /applications | Get All Applications |
| POST | /applications | Create Application |
| GET | /applications/{id} | Get Application |
| PUT | /applications/{id} | Update Application |
| DELETE | /applications/{id} | Delete Application |
| Method | Endpoint | Description |
|---|---|---|
| POST | /ai/analyze | Analyze Job Description |
- User submits a job description.
- FastAPI validates and authenticates the request.
- AI Service constructs a prompt.
- Prompt is sent to Groq's Llama 3.1 model.
- AI-generated insights are returned.
- Analysis can be stored alongside the application record.
- id
- hashed_password
- created_at
- id
- user_id
- company_name
- role
- status
- description
- analysis
- notes
- applied_at
Relationship:
User (1) ------ (N) Applications
- Dockerized Application
- Railway Deployment
- PostgreSQL Database
- Groq Cloud AI Service
- React Frontend Integration
- Redis Caching
- Token Blacklisting with Redis
- Async SQLAlchemy
- CI/CD using GitHub Actions
- Prometheus Monitoring
- Role-Based Access Control (RBAC)
Mohammad Farhaan Ali
GitHub: https://github.com/Farru049
