Skip to content

Django REST API for managing job listings, built with PostgreSQL and Redis caching. Includes CRUD and stats endpoints.

License

Notifications You must be signed in to change notification settings

Siddharthsinghkumar/jobboard-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JobBoard API

A backend REST API for managing job listings, built with Django, PostgreSQL, and Redis.
Includes CRUD operations and a stats endpoint with caching support.

🚀 Features

  • Create, view, update, and delete job listings (/api/jobs/)
  • View total job count (/api/stats/) with Redis caching
  • Built with Django REST Framework
  • PostgreSQL database
  • Redis cache integration

📦 Tech Stack

  • Django 5.2.4
  • Django REST Framework
  • PostgreSQL
  • Redis
  • Docker (optional for deployment)

🛠️ Setup Instructions

1. Clone the repository

git clone https://github.com/Siddharthsinghkumar/jobboard-api.git
cd jobboard-api

2. Create a virtual environment

python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Setup PostgreSQL

Create a PostgreSQL user and database:

CREATE DATABASE jobdb;
CREATE USER jobuser WITH PASSWORD 'jobpass';
ALTER ROLE jobuser SET client_encoding TO 'utf8';
ALTER ROLE jobuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE jobuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE jobdb TO jobuser;
GRANT ALL ON SCHEMA public TO jobuser;
ALTER SCHEMA public OWNER TO jobuser;
ALTER DATABASE jobdb OWNER TO jobuser;

Update jobboard/settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'jobdb',
        'USER': 'jobuser',
        'PASSWORD': 'jobpass',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

5. Start Redis

sudo apt install redis-server
sudo systemctl enable redis
sudo systemctl start redis

6. Run migrations

python manage.py makemigrations
python manage.py migrate

7. Run the development server

python manage.py runserver

Visit http://127.0.0.1:8000/api/jobs/ to see the API.

📬 API Endpoints

Method Endpoint Description
GET /api/jobs/ List all jobs
POST /api/jobs/ Create a new job
GET /api/jobs/ Retrieve job details
PUT /api/jobs/ Update a job
DELETE /api/jobs/ Delete a job
GET /api/stats/ Get total jobs count

📄 License

MIT License. Free for personal and educational use.

About

Django REST API for managing job listings, built with PostgreSQL and Redis caching. Includes CRUD and stats endpoints.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages