Skip to content

WatchMe-2-0/watchme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WatchME

A movie streaming backend

Run Locally

Clone the project

  gh repo clone WatchMe-2-0/watchme

Go to the project directory

  cd watchme

Install dependencies

  go mod tidy

Before starting the server run

  docker-compose up

By running this

  • minio-storage
  • postgres-db these two container will start locally for

minio

  • http:localhost:9001 -- minio client web ui
  • http:localhost:9000 -- minio server api

postgres-db

  • http:localhost:5432

Environment Variables

This are the basic yml written in docker-compose.yml for postgres

  environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: admin
      POSTGRES_DB: moviesdb`

for minio

      environment:
      MINIO_ROOT_USER: admin
      MINIO_ROOT_PASSWORD: admin123

and there is an app.env file which will you need to configure by going to

Screenshots

Go here http://localhost:9001/access-keys and create the accesskeys go and create the access keys

add name description and create

copy accesskeys and secret keys also you can download csv

add the keys accordingly in example.env and also rename the example.env to app.env THIS IS IMPORTANT!!! pust keys in the file

Api's Work with curl

using curl

To uploading movies Post http://localhost/upload

curl -X POST http://localhost:8000/upload \
  -F "title=Interstellar" \
  -F "movie=@/path/to/interstellar.mp4" \
  -F "poster=@/path/to/interstellar.jpg"

To Get all movies Get http://localhost:8000/movies

 curl -X GET http://localhost:8000/movies

To stream the movie GET http://localhost:8000/stream/:name

curl -X GET http://localhost:8000/stream/1741891860-interstellar.mp4

To delete delete curl -X DELETE http://localhost:8000/movies/{movie.id}

to know the ID use curl -X GET http://localhost:8000/movies output

{"ID":4, -- this is the ID
"Title":"alooposto",
"PosterURL":"http://localhost:8000/posters/1741891860-7a32830bdcf1dc41e5245d6a944406a2.jpg",
"StreamURL":"http://localhost:8000/stream/1741891860-alooposto.mp4",
"CreatedAt":"2025-03-14T00:21:00.976905+05:30"}

About

Backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages