How gautam-safal/movievault works
Project type and purpose
• This is a standalone CLI tool (“Movie Vault”) written in Python.
• It lets the user search, view, add, list, and remove movies by title/year via the OMDb REST API and stores a local “vault” in a binary file.
File structure
• Top-level files only:
• main.py (the entrypoint / CLI dispatcher)
• movies.bin (binary persistence store)
• requirement.txt (dependencies: requests, python-dotenv)
• .gitignore & README.md
• No frontend/backend split — it’s a single process, layered internally.
README for additional insights
• Uses requests to call OMDb API
• Uses python-dotenv to load API_KEY from .env
• Data persistence is in a single binary file (movies.bin)
• CLI commands correspond to operations in main.py
a. Main components
1. User (terminal)
2. CLI Command Parser (argparse or click in main.py)
3. Controller/Dispatcher (routes CLI commands to handlers)
4. Service Layer
– OMDb API Client (HTTP client via requests)
– Vault Manager (local storage handler for movies.bin)
5. Persistence Store (movies.bin file)
6. External OMDb API (http://www.omdbapi.com)
7. Configuration Loader (dotenv for API_KEY)
b. Relationships & interactions
• User → CLI Parser → Controller
• Controller → Service Layer
• OMDb API Client ↔ External OMDb API
• Vault Manager ↔ movies.bin
• Service Layer uses Configuration Loader to fetch API_KEY
• Controller sends output back to User
c. Architectural patterns & principles
• Layered architecture (Presentation → Controller → Services → Persistence)
• Single-process, synchronous I/O
• Separation of concerns: CLI parsing, API integration, storage
d. Key technologies
• Python 3.7+
• requests (HTTP client)
• python-dotenv (environment variable loader)
• binary file I/O (pickle or custom serialization)