This section will guide you through installing MangaDB, setting up your environment, and running your first MangaDB application.
Prerequisites
Before you begin, make sure you have the following installed:
- Python 3.7 or higher
- pip (Python package installer)
- Git (optional, for cloning the repository)
Installation
Follow these steps to install MangaDB:
1. Clone or download the repository
2. Install dependencies
Note: It's recommended to use a virtual environment to avoid conflicts with other Python packages.
Running MangaDB
MangaDB can be run in different modes:
API Mode (Default)
This starts the MangaDB service and a FastAPI web server:
Access the API at http://localhost:8000 and the API documentation at http://localhost:8000/docs.
Text-based UI Mode
This starts the MangaDB service with a text-based user interface:
The TUI provides a command-line interface for interacting with MangaDB.
Project Structure
Understanding the project structure will help you navigate the codebase:
- main.py: The main entry point for the application
- mongo_db_service.py: The server component that handles storage and retrieval
- mongo_db_client.py: The client library for communicating with the service
- data/: Directory where collections are stored as .dat files
- templates/: HTML templates for the web interface
- static/: Static files like images and CSS
Verifying Your Installation
Let's verify that MangaDB is working correctly by creating a simple test:
If everything is working correctly, you should see output similar to:
Congratulations! You've successfully installed and run MangaDB. In the next section, we'll explore basic operations like creating, reading, updating, and deleting documents.