This repository contains the data infrastructure for the Reloop clothing recognition app. It provides database operations, ML data pipeline, and environment management for the development team.
- Database Layer - MongoDB operations for users, scans, images, analytics
- ML Data Pipeline - Framework for AI integration and training data collection
- Environment Management - Flexible configuration for different environments
reloop_db/
├── db_layer/ # Database operations
│ ├── connection.py # MongoDB connection
│ ├── collections.py # Database collections
│ ├── users.py # User operations
│ ├── scans.py # Scan operations
│ ├── images.py # Image operations
│ └── analytics.py # Analytics queries
├── ml_interface/ # ML data pipeline
│ └── training_data.py # Gemini AI integration
├── config.py # Configuration
├── setup.py # Package installer
├── requirements.txt # Dependencies
├── API_EXAMPLES.md # Backend integration guide
├── SETUP.md # Setup documentation
└── ENVIRONMENT_SETUP.md # Environment configuration
# Clone the repository
git clone https://github.com/software-sds/reloop_db.git
cd reloop_db
# Install dependencies
pip install -r requirements.txt
# Set up environment
python set_env.py# Test database connection
python tests/test_connection.py
# Test user operations
python tests/test_user_with_env.py
# Run all tests
pytest tests/See API_EXAMPLES.md for detailed examples of how to integrate these functions into your FastAPI/Flask application.
See ml_interface/training_data.py for Gemini AI integration examples.
Use the backend API endpoints that consume these database functions.
users- User informationscans- Scan results with ML predictionsimages- Image data with predictionsanalytics- Analytics data
The app uses these environment variables:
MONGO_URI- MongoDB connection stringDB_NAME- Database name (defaults to "appliwaste")
- Setup Guide - Complete setup instructions
- Environment Setup - Environment configuration
- API Examples - Backend integration examples
- Fork the repository
- Create a feature branch
- Make your changes
- Test your changes
- Submit a pull request
This project is part of the Reloop clothing recognition app development.
For questions or issues:
- Check the documentation
- Review the test files
- Contact the data infrastructure team