The Greenlight Project is designed to showcase a practical application of backend development using Go. Inspired by the "Let's Go Further" book by Alex Edwards, this project focuses on creating a high-performance, reliable, and easy-to-maintain backend service for managing movie data.
To get started with the Greenlight Project, follow the instructions below.
- Go (version 1.16 or higher)
- Git
- PostgreSQL
git clone https://github.com/ovaixe/greenlight.git
cd greenlightCreate a .envrc file in the root directory and add the following variables:
export GREENLIGHT_DB_DSN=your_database_connection_stringmake vendorTo run the project locally:
make run/api-
GET /v1/movies: Retrieve a list of movies -
POST /v1/movies: Add a new movie -
GET /v1/movies/{id}: Retrieve a specific movie by ID -
PATCH /v1/movies/{id}: Update an existing movie -
DELETE /v1/movies/{id}: Delete an existing movie -
**GET /v1/movies/{id}/similar**: Get similar movies based on content -
**GET /v1/movies/search/semantic?q=query**: Semantic search for movies
-
POST /v1/users: Register a new user -
PUT /v1/users/activated: Activate a registered user -
POST /v1/tokens/authentication: Create an authentication token for user
This project includes AI-based movie recommendations using vector similarity search.
- Semantic Search: Find movies using natural language queries
- Similar Movies: Get recommendations based on movie content
- Automatic Embeddings: Movie embeddings are generated automatically when creating/updating movies
CREATE EXTENSION IF NOT EXISTS vector;make db/migrations/upcd cmd/embedding-service
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python embedding_service.pyOr use the Makefile:
make run/embedding-servicemake populate/embeddingsmake run/apicurl "http://localhost:4000/v1/movies/search/semantic?q=space+adventure" \
-H "Authorization: Bearer YOUR_TOKEN"curl "http://localhost:4000/v1/movies/1/similar?limit=5" \
-H "Authorization: Bearer YOUR_TOKEN"This project is licensed under the MIT License. See the LICENSE file for details.