How joacdc/ecoloop- works
Project type and purpose
• Ecoloop is a containerized full-stack web application for managing and visualizing recycling container locations.
• Frontend: HTML/CSS/JavaScript served from Flask templates and static files.
• Backend: Python + Flask providing a CRUD API for “Contenedor” objects.
• Database: MongoDB (NoSQL document store).
• Infrastructure: Docker Compose orchestrating a Flask container and a MongoDB container.
• External service: Google Maps API for map display.
File structure
• Top-level:
• README.md (project overview)
• docker-compose.yml (defines services: app, mongod)
• app/ folder:
• Dockerfile (builds the Flask app image)
• connection.py (MongoClient setup)
• Contenedor.py & Ubicacion.py (domain/business logic classes)
• app.py (Flask application entrypoint, route definitions)
• requeriments.txt (Python dependencies)
• static/ (JS, CSS assets)
• templates/ (Jinja2 HTML templates: index, CRUD forms)
README for additional insights
• Confirms technology stack: Flask, MongoDB, Docker Compose, Google Maps API.
• Details the user flows: map visualization, CRUD on containers.
• Specifies host: localhost:5000.
Main components and relationships
a. Components
• Browser (client)
• Frontend assets (HTML templates, CSS, JS)
• Flask backend
• Business logic modules (Contenedor, Ubicacion)
• MongoDB database
• Google Maps API (external)
• Docker Compose network
b. Interactions
1. User opens browser → sends HTTP request to Flask on port 5000.
2. Flask routes render Jinja2 templates and/or serve JSON data.
3. Backend calls business logic (Contenedor.Ubicacion) → uses connection.py to query/update MongoDB.
4. Frontend JS calls Google Maps API to fetch map tiles and geolocation data.
5. Docker network isolates and connects the Flask and MongoDB containers.
c. Architectural patterns
• Layered MVC-style separation:
– Model: Contenedor.py & Ubicacion.py + MongoDB
– View: Jinja2 templates + static assets
– Controller: Flask route handlers in app.py
• Containerization: one service per container, networked via Docker Compose.
d. Key technologies
• Python 3 + Flask
• PyMongo / MongoClient
• Docker & Docker Compose
• Google Maps API
• HTML5, CSS3, vanilla JavaScript