Skip to content

Kenneth732/JobFinerKE_

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

JobFinder KE

Premium Access to Government-Registered Startup Opportunities in Kenya

Django Version Python Version PostgreSQL License

πŸ“– Overview

JobFinder KE is a premium job platform that provides 48-hour early access to job openings from government-registered startups and live government tenders in Kenya. Subscribers receive opportunities before they're released to the public, giving them a significant competitive advantage in the job market.

Key Features

  • ** 48-Hour Early Access** – Get jobs before public release
  • ** Government Verified** – All employers verified through Business Registration Service (BRS)
  • ** Live Tender Alerts** – Real-time government procurement notifications
  • ** Multi-Channel Notifications** – Email, SMS, and WhatsApp alerts
  • ** M-Pesa Integration** – Seamless subscription payments
  • ** Automated Web Scraping** – Continuous job sourcing from bebee.com
  • ** Admin Dashboard** – Manual import controls and monitoring

Architecture

JobFinder KE
β”œβ”€β”€ Django 6.0.3 Backend
β”œβ”€β”€ PostgreSQL Database
β”œβ”€β”€ Celery + Redis (Background Tasks)
β”œβ”€β”€ Django REST Framework (API endpoints)
β”œβ”€β”€ BeautifulSoup / Requests (Job scraping)
β”œβ”€β”€ Allauth (Social authentication)
└── Custom CSS (jfke- scoped styling)

Prerequisites

  • Python 3.12+
  • PostgreSQL 16+
  • Redis (for Celery)
  • Virtual environment (recommended)

Quick Start

1. Clone the Repository

git clone https://github.com/yourusername/jobfinder-ke.git
cd jobfinder-ke

2. Create Virtual Environment

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the project root:

# Database
DB_NAME=jobs
DB_USER=your_username
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432

# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret

# Email
EMAIL_HOST_USER=noreply@jobfinder.ke
EMAIL_HOST_PASSWORD=your_email_password

# M‑Pesa
MPESA_CONSUMER_KEY=your_consumer_key
MPESA_CONSUMER_SECRET=your_consumer_secret
MPESA_SHORTCODE=888888

# Security
DJANGO_SECRET_KEY=your_secret_key
DEBUG=True

5. Setup Database

sudo -u postgres psql
CREATE DATABASE jobs;
CREATE USER your_username WITH PASSWORD 'your_password';
ALTER ROLE your_username SET client_encoding TO 'utf8';
ALTER ROLE your_username SET default_transaction_isolation TO 'read committed';
ALTER ROLE your_username SET timezone TO 'Africa/Nairobi';
GRANT ALL PRIVILEGES ON DATABASE jobs TO your_username;
\q

python manage.py makemigrations
python manage.py migrate

6. Create Superuser

python manage.py createsuperuser

7. Collect Static Files

python manage.py collectstatic

8. Run Development Server

python manage.py runserver

Visit http://127.0.0.1:8000


πŸ”§ Data Import & Automation

Manual Import via Admin Dashboard

Access: http://127.0.0.1:8000/admin/ then use the custom admin actions.

Command Line Import

# Import jobs from bebee.com (30 pages = ~600 jobs)
python manage.py import_bebee_jobs --pages 30

# Dry run (preview without saving)
python manage.py import_bebee_jobs --pages 5 --dry-run

Automated Cron Jobs

Add to crontab:

0 2 * * * cd /path/to/jobfinder-ke && python manage.py import_bebee_jobs --pages 30 >> /var/log/job_import.log 2>&1

Project Structure

jobfinder-ke/
β”œβ”€β”€ job_orm/                 # Project configuration
β”‚   β”œβ”€β”€ settings.py
β”‚   β”œβ”€β”€ urls.py
β”‚   └── celery.py
β”œβ”€β”€ jobs/                    # Main application
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ views.py
β”‚   β”œβ”€β”€ urls.py
β”‚   β”œβ”€β”€ admin.py
β”‚   β”œβ”€β”€ bebee_scraper.py
β”‚   β”œβ”€β”€ management/
β”‚   β”‚   └── commands/
β”‚   β”‚       └── import_bebee_jobs.py
β”‚   └── templates/jobs/
β”œβ”€β”€ templates/               # Global templates
β”‚   β”œβ”€β”€ base.html
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ pricing.html
β”‚   └── subscribe.html
β”œβ”€β”€ static/                  # Static files (CSS, JS, images)
β”œβ”€β”€ media/                   # User uploaded files
└── requirements.txt

Database Schema

User (Custom)
β”œβ”€β”€ role (job_seeker/employer/admin)
β”œβ”€β”€ phone_number (unique)
β”œβ”€β”€ is_subscribed
└── subscription_end_date

EmployerProfile
β”œβ”€β”€ company_name
β”œβ”€β”€ business_registration_number (unique)
β”œβ”€β”€ kra_pin
β”œβ”€β”€ sector
β”œβ”€β”€ is_verified (government verified)
└── jobs (ForeignKey)

JobPosting
β”œβ”€β”€ title, description, requirements
β”œβ”€β”€ location, salary_range
β”œβ”€β”€ application_deadline
β”œβ”€β”€ is_pre_public (48‑hour early access)
β”œβ”€β”€ public_at
└── status (draft/published/closed)

GovernmentTender
β”œβ”€β”€ tender_number (unique)
β”œβ”€β”€ title, description
β”œβ”€β”€ ministry, value_estimate
β”œβ”€β”€ deadline, published_at
└── is_active

UserSubscription
β”œβ”€β”€ user, amount_paid
β”œβ”€β”€ mpesa_transaction_id (unique)
β”œβ”€β”€ start_date, end_date
└── is_active

JobApplication
β”œβ”€β”€ job, applicant
β”œβ”€β”€ cover_letter, cv_file
β”œβ”€β”€ status
└── is_priority

Data Sources

Source Type Frequency Method
bebee.com Jobs Every 6 hours API (REST)
BRS Kenya Startups Daily Web scraping (planned)
KEPSA Member Jobs Weekly Web scraping (planned)

Frontend Features

  • Responsive design (mobile, tablet, desktop)
  • Live job feed with slide‑in animations
  • Animated stats counters (from live API)
  • Early access badges
  • M‑Pesa payment flow
  • Scoped CSS (jfke- prefix) – no conflicts with other pages

Authentication & Security

  • Google OAuth2 (social login)
  • Phone number verification
  • Role‑based access (job seeker / employer / admin)
  • CSRF protection
  • SQL injection prevention (Django ORM)
  • XSS protection (auto‑escaping)

Subscription & Payments

Pricing Plans:

  • Monthly: KES 500 / month
  • Annual: KES 5,000 / year (17% savings)

Payment Methods:

  • M‑Pesa (PayBill number: 888888)
  • Card payments (coming soon)

Features:

  • 7‑day free trial
  • Cancel anytime
  • Automatic billing
  • Transaction history

API Endpoints

Endpoint Method Description
/api/stats/ GET Live stats (jobs, tenders, subscribers)
/api/jobs/ GET Job listings with filters
/api/tenders/ GET Tender listings
/api/subscribe/ POST Subscription activation

Testing

# Run all tests
python manage.py test

# Run jobs app tests
python manage.py test jobs

# With coverage
coverage run manage.py test
coverage report
coverage html

πŸ“ˆ Performance Optimizations

  • Database indexes on foreign keys and frequently filtered fields
  • select_related() and prefetch_related() for related objects
  • Redis caching for session storage and API responses
  • Pagination (20 items per page)
  • Lazy loading of images
  • CDN for fonts and static assets

πŸ› Troubleshooting

No jobs on /jobs/

python manage.py shell -c "from jobs.models import JobPosting; from django.utils import timezone; print(JobPosting.objects.filter(status='published', application_deadline__gt=timezone.now()).count())"
python manage.py import_bebee_jobs --pages 5

Cron jobs not running

sudo systemctl status cron
tail -f /var/log/syslog | grep CRON

Sector filter shows no results

Run the sector updater script (provided in the codebase) to assign sectors from job titles.


πŸš€ Deployment (Ubuntu/Debian)

sudo apt update
sudo apt install nginx postgresql redis-server supervisor

pip install gunicorn
gunicorn --bind 0.0.0.0:8000 job_orm.wsgi:application

sudo nano /etc/nginx/sites-available/jobfinder

Nginx config:

server {
    listen 80;
    server_name jobfinder.ke;
    
    location /static/ {
        alias /path/to/static/;
    }
    
    location /media/ {
        alias /path/to/media/;
    }
    
    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
sudo ln -s /etc/nginx/sites-available/jobfinder /etc/nginx/sites-enabled/
sudo systemctl restart nginx

πŸ“ Environment Variables Reference

Variable Required Default Description
DB_NAME Yes – PostgreSQL database name
DB_USER Yes – Database username
DB_PASSWORD Yes – Database password
GOOGLE_CLIENT_ID Yes – Google OAuth client ID
GOOGLE_CLIENT_SECRET Yes – Google OAuth secret
MPESA_CONSUMER_KEY For payments – M‑Pesa API key
MPESA_CONSUMER_SECRET For payments – M‑Pesa API secret
EMAIL_HOST_USER For digests – SMTP username
EMAIL_HOST_PASSWORD For digests – SMTP password
DJANGO_SECRET_KEY Yes – Django secret key
DEBUG No False Debug mode

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Coding standards:

  • PEP 8
  • Black formatting
  • Docstrings for functions
  • Tests for new features

License

Distributed under the MIT License. See LICENSE for more information.


Contact & Support


πŸ™ Acknowledgments

  • Business Registration Service (BRS) Kenya
  • Kenya Private Sector Alliance (KEPSA)
  • bebee for job listings
  • All our subscribers and partners

Built with ❀️ for Kenyan job seekers and businesses

"First Access. Zero Competition."

About

JobFinder KE is a premium job platform that provides 48-hour early access to job openings from government-registered startups and live government tenders in Kenya

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors