Skip to content

hpk369/pyredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md

PyRedis: A Lightweight Redis-like Key-Value Store

PyRedis is a lightweight, persistent key-value store written in Python, designed to simulate Redis-like functionality for learning, local development, or prototyping purposes. It includes a command-line interface, a web GUI powered by Flask, TTL support, disk persistence, and Dockerization for smooth deployment.


Features

  • Fast in-memory key-value operations
  • TTL (time-to-live) support for expiring keys
  • Data persistence using JSON file storage
  • Unit tests for reliability and correctness
  • Web-based GUI built with Flask
  • Docker support for isolated deployment

Technologies Used

  • Python 3.10
  • Flask - Web GUI
  • Docker - Containerization
  • HTML/CSS - Simple UI frontend
  • argparse - CLI commands
  • requests - HTTP handling (optional future enhancements)

How to Run

Local Setup

# Clone the repo
cd pyredis
pip install -r requirements.txt
python gui/web_gui.py

Then visit: http://localhost:9567

Docker Setup

# Build the image
docker build -t pyredis-webgui .

# Run the container (on port 9567)
docker run --rm -p 9567:9567 pyredis-webgui

Visit: http://localhost:9567


Run Tests

python -m unittest tests/test_kv_store.py

Project Structure

├── core/
│   └── kv_store.py         # KeyValueStore logic
├── gui/
│   ├── web_gui.py          # Flask web server
│   └── templates/
│       └── index.html      # Frontend HTML interface
├── tests/
│   └── test_kv_store.py    # Unit tests
├── Dockerfile              # Container configuration
├── requirements.txt        # Python dependencies
└── README.md               # Project documentation

TODO / Future Enhancements

  • Add user authentication to the web GUI
  • Add support for namespaces or multiple logical databases
  • Add GUI styling with Bootstrap or Tailwind CSS
  • Deploy on Render/Fly.io/Heroku

Feel free to fork, star, and contribute!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages