Skip to content

SaketV8/cine-dots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CineDots

MIT License

Track your movie watchlist...

A simple movie watchlist tracker backend built using the Gin framework and SQLite as the database.

Tip

Keploy Test Suite Integrated

Keploy Test Suite details are mentioned below Keploy Test Suite

Tip

Test cases are covered Total: (85.7%)

Test details are mentioned below Test Cases

💻 Tech Stack

  • Go : Programming language
  • Gin : Web framework
  • SQLite3 : A sqlite3 database driver

📖 How to Use / Run on Your Machine

I am using HttPie for API testing you can use any tool as per your requirement and curl is fine too :D

Important

I am using WSL (Ubuntu).


🧰 Setup Project Locally:

  • Clone the repository:
git clone https://github.com/saketv8/cine-dots.git
  • Navigate to the project directory:
cd cine-dots
  • Install dependencies:
go mod download
  • Generate Database with some default data:

Important

OPTIONAL STEP as I have already included the cine_dots.db

delete the cine_dots.db in DB/cine_dots.db and use below command to generate new one

go run migrations/migration.go
  • Building the Application Binary:
go build -o cine-dots
  • Starting the Application:
./cine-dots

Tip

Now you can Access Swagger at Swagger UI

🚀 You're all set!


📑 Available REST API End Points

Method Endpoint Description
GET http://localhost:9090/api/v1/watchlist/watched Get watched items
GET http://localhost:9090/api/v1/watchlist/watching Get currently watching items
GET http://localhost:9090/api/v1/watchlist/all Get all items in the watchlist
GET http://localhost:9090/api/v1/watchlist/notwatched Get items not yet watched
GET http://localhost:9090/api/v1/watchlist/:watchlist_id Get details of a specific watchlist by ID
POST http://localhost:9090/api/v1/watchlist/add Add a new item to the watchlist
DELETE http://localhost:9090/api/v1/watchlist/delete Delete an item from the watchlist
PATCH http://localhost:9090/api/v1/watchlist/update Update an item in the watchlist
==== ============================================== =========================
GET http://localhost:9090/swagger/index.html Acess Swagger UI

📡 Open the Postman/Httpie and Make Request

GET POST
DELETE PATCH

🧩 Usage Examples

Important

Add these json value as body while making request

🐻‍❄️ POST (Add New WatchList)

body of the request

{
  "title": "Coco",
  "release_year": 2017,
  "genre": "Animation",
  "director": "Lee Unkrich",
  "status": "not watched",
  "added_date": "2025-06-20T00:00:00Z"
}

🐳 DELETE (Delete WatchList by ID)

body of the request

{
  "watchlist_id": 6
}

🐦‍🔥 PATCH (Update WatchLList by ID)

body of the request

{
  "watchlist_id": 7,
  "title": "Coco",
  "release_year": 2017,
  "genre": "Animation",
  "director": "Lee Unkrich",
  "status": "watching"
}

Note

🌸 Assignment - 3

🧪 Running Tests

To run all tests:

go test ./tests/...

To run tests with verbose output:

go test -v ./tests/...

📊 Viewing Test Coverage

Step-1: To generate a coverage report:

go test -v -coverpkg=./pkg/handlers,./pkg/repositories ./tests/... -coverprofile=coverage.out

Step-2: To view a coverage summary in the terminal:

go tool cover -func=coverage.out

Step-3: To view a detailed HTML report:

go tool cover -html=coverage.out -o coverage.html 

Important

After generating the coverage.html file open it in browser to view the report


GET POST
DELETE PATCH

Note

🌸 Assignment - 4

OpenAPI/Swagger ☑️

CI/CD using github workflow ☑️

Keploy Integration ☑️

Tip

Access Swagger at Swagger UI

🐰 Keploy Test Suite

Keploy Test Suite (Keploy Dashboard)


Keploy Test Suite (CLI)


🌱 Todo / Future Improvements

  • Show All WatchList
  • Get Particular WatchList By ID
  • Add New WatchList Data
  • Delete WatchList Data
  • Update WatchList Data
  • Add Test
  • Add Swagger/OpenAPI
  • Add Keploy Test Suite
  • Integrate CI/CD using github workflow with keploy test integration
  • Web Application for this API (NextJS/Vite-React)

🧭 About

This project was created as an assignment for Keploy's API Fellowship Sessions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages