git clone https://github.com/Ka10ken1/mykadri-scraper
cd mykadri-scraper
docker compose up --build
mykadri-scraper/
├── cmd/
│ └── main.go # Entry point
├── internal/
│ ├── api/ # HTTP handlers and routes
│ │ ├── handlers.go
│ │ └── router.go
│ ├── models/ # MongoDB interaction
│ │ └── models.go
│ └── scraper/ # Scraping logic
│ └── scraper.go
├── web/ # Static frontend
│ ├── index.html
│ ├── style.css
│ ├── api.js
│ ├── app.js
│ ├── index.js
│ └── template/
│ └── movie.html
├── Dockerfile
├── docker-compose.yaml
├── go.mod
├── go.sum
└── README.md
MONGO_URI=mongodb://localhost:27017
MONGO_DB=mykadri
MONGO_COLLECTION=movies
GET /movies # All movies
GET /movies/:id # Single movie by ID
GET /movie-images # List of all image URLs
GET /movie/:id # HTML page for movie
GET / # Landing page
- Pure HTML/CSS/JS (no framework)
- Pre-renders movie cards from server
- Uses API via
fetch
inapi.js
If you're not using Docker, make sure you have MongoDB running:
sudo systemctl start mongod
Then run:
go run ./cmd/main.go
docker compose down -v
- Scraper skips already-inserted movies (based on link)
- Movie page is scraped for a video iframe
- No retries or slowdowns for HTTP 429 to avoid long waits
- Page concurrency is limited to reduce server stress
- Integrate full text search engine
- Perfect Scraper