Welcome to ReviewHood, a Django-based REST API platform designed for managing movies, actors, genres, and reviews! The API allows you to perform CRUD operations on movies, actors, genres, and reviews, with JWT authentication for secure access.
ReviewHood is a REST API backend built with Django and Django REST Framework (DRF). It serves as a database and interface for applications needing information about movies, genres, and actors. It supports:
- CRUD operations for Movies, Actors, Genres, and Reviews.
- JWT-based authentication for secure API calls.
- Movies: Manage movies with details like name, rating, release date, associated genres, and actors.
- Actors: Create, retrieve, update, and delete actors.
- Genres: Categorize movies into genres and retrieve movies by genre.
- Reviews: Add and manage reviews for movies.
- Authentication: Secure access using JWT authentication.
- Python >= 3.12
- PostgreSQL
- Virtual Environment (optional but recommended)
-
Clone the repository:
git clone /~https://github.com/AmulyaParitosh/ReviewHood.git cd reviewhood
-
Install dependencies:
pip install .
-
Create a
.env
file in the root directory and set up environment variables (see Environment Variables). -
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
-
Access the API at:
http://127.0.0.1:8000/api/
Below is an overview of the endpoints available in ReviewHood.
Method | Endpoint | Description |
---|---|---|
GET | /api/actors |
Get all actors |
GET | /api/actors/:id |
Get an actor by ID |
POST | /api/actors |
Create a new actor |
PUT | /api/actors/:id |
Update an actor by ID |
DELETE | /api/actors/:id |
Delete an actor by ID |
Method | Endpoint | Description |
---|---|---|
GET | /api/movies |
Get all movies |
GET | /api/movies/:id |
Get a movie by ID |
POST | /api/movies |
Create a new movie |
PUT | /api/movies/:id |
Update a movie by ID |
DELETE | /api/movies/:id |
Delete a movie by ID |
Method | Endpoint | Description |
---|---|---|
GET | /api/genres |
Get all genres |
GET | /api/genres/:id |
Get a genre by ID |
POST | /api/genres |
Create a new genre |
PUT | /api/genres/:id |
Update a genre by ID |
DELETE | /api/genres/:id |
Delete a genre by ID |
Method | Endpoint | Description |
---|---|---|
GET | /api/movies/:movie_id/reviews |
Get all reviews for a movie |
POST | /api/movies/:movie_id/reviews |
Add a review for a movie |
GET | /api/movies/:movie_id/reviews/:id |
Get a review by ID |
PUT | /api/movies/:movie_id/reviews/:id |
Update a review by ID |
DELETE | /api/movies/:movie_id/reviews/:id |
Delete a review by ID |
Method | Endpoint | Description |
---|---|---|
POST | /api/token |
Obtain JWT token |
JWT Authentication is used for secured endpoints:
- Obtain a JWT token via the
/api/token
endpoint. - Use the token in the
Authorization
header as:Authorization: Bearer <your-token>
Create a .env
file in the root directory with the following keys:
POSTGRES_DB_NAME=db-name
POSTGRES_USER=db_user_name
POSTGRES_PASSWORD=db_password
POSTGRES_HOST="127.0.0.1"
POSTGRES_PORT="5432"
This project is licensed under the MIT License.