Skip to content

lancasecommits/lursa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sem título

Lursa

A web platform for managing electronic waste disposal in residential condominiums. Residents earn points for each correct disposal and redeem them for rewards. Building managers handle collection points, the product catalog, and the blog through an admin panel. Developed as a Capstone Project for the Systems Analysis and Development program at Senac College.

License Senac LGPD

Project Overview

Lursa is a smart waste management platform designed to improve electronic waste disposal in residential condominiums. Residents accumulate points by using registered collection points and can redeem them for products in the catalog. Administrators manage collection points on an interactive map, publish blog posts, and handle the rewards catalog through a dedicated admin panel.

Key Features

  • QR Code Disposal Flow: Residents scan a QR Code at a physical collection point, confirm the disposal on their phone, and receive points instantly — no manual input required.
  • Points & Rewards System: Residents earn $L points per disposal and redeem them for products in the catalog, creating a gamified incentive loop for correct e-waste behavior.
  • Interactive Collection Map: Leaflet.js + OpenStreetMap map showing all registered disposal points with address and points-per-disposal info — no API key required.
  • Admin Panel: Full management of users, collection points, products, and blog posts from a dedicated dashboard.
  • Informational Blog: Posts about recycling and sustainability, readable by anyone without login.

LGPD & Data Privacy Compliance

Important

Because this application processes personal data from residents (name, email, and disposal/redemption history), privacy by design was a core requirement of this project in compliance with Brazilian Federal Law nº 13.709/2018 (LGPD).

Implemented Privacy Standards

  • Legal Basis for Processing (Art. 7º): Data is only collected upon voluntary registration, establishing explicit consent as the legal basis for processing.
  • Data Minimization (Art. 6º, III): Only data strictly necessary for the platform's operation is stored — name, email, password hash, points balance, and transactional history.
  • Security (Art. 46): Passwords are hashed with bcrypt and never stored in plaintext. The session secret is loaded exclusively from environment variables, never hardcoded.
  • Right to Erasure (Art. 18, VI): Administrators can permanently delete user accounts through the admin panel, removing all associated personal records.

Tech Stack

Layer Technology
Backend Ruby 3.x + Sinatra
Database SQLite 3 + Sequel ORM
Frontend ERB templates + custom CSS
Map Leaflet.js + OpenStreetMap
Auth bcrypt + Rack sessions
Environment dotenv

Getting Started

Prerequisites

1. Clone the repository

git clone https://github.com/lancasecommits/lursa.git
cd lursa

2. Set up environment variables

cp .env.example .env

Edit .env with your values:

SESSION_SECRET=a_long_random_secure_string
ADMIN_EMAIL=admin@lursa.com
ADMIN_PASSWORD=your_secure_password

3. Install dependencies

bundle install

4. Start the server

# Localhost only
ruby app.rb

# Accessible on local network (e.g. for mobile testing)
ruby app.rb -o 0.0.0.0

Open http://localhost:4567 in your browser.

API Routes

Method Route Description Auth
GET / Home — featured posts and products
GET /blog Blog post listing
GET /blog/:id Single blog post
GET /catalog Rewards catalog
POST /catalog/:id/redeem Redeem a product User
GET /points Collection points map
GET /discard/:token Disposal confirmation screen
POST /discard/:token Register a disposal and credit points User
GET /discard/:token/done Disposal success screen User
GET /profile Authenticated user profile User
GET /admin Admin dashboard Admin
POST /admin/posts Create a blog post Admin
DELETE /admin/posts/:id Delete a blog post Admin
POST /admin/products Create a catalog product Admin
DELETE /admin/products/:id Delete a catalog product Admin
POST /admin/points Register a collection point Admin
DELETE /admin/points/:id Delete a collection point Admin
GET /admin/users List all users Admin
POST /admin/users/:id/points Manually add points to a user Admin

Project Structure

lursa-api/
├── app.rb                  # Entry point — session config, helpers, route loading
├── db.rb                   # Database schema and admin seed
├── models/
│   └── user.rb             # User model with bcrypt authentication
├── routes/
│   ├── public.rb           # Public routes (home, blog, catalog, map)
│   ├── auth.rb             # Login, signup, logout
│   ├── profile.rb          # User profile and product redemption
│   ├── discard.rb          # QR Code disposal flow
│   └── admin.rb            # Admin panel (users, points, products, posts)
├── views/
│   ├── layout.erb          # Base HTML layout
│   ├── shared/
│   │   └── _navbar.erb     # Bottom navigation bar
│   ├── index.erb           # Home page
│   ├── blog.erb            # Blog listing
│   ├── post.erb            # Single post
│   ├── catalog.erb         # Rewards catalog
│   ├── points.erb          # Collection points map
│   ├── discard.erb         # Disposal confirmation
│   ├── discard_done.erb    # Disposal success
│   ├── profile.erb         # User profile
│   ├── admin.erb           # Admin dashboard
│   ├── admin_users.erb     # User management
│   ├── new_point.erb       # Add collection point form
│   ├── new_product.erb     # Add product form
│   └── new_post.erb        # Add blog post form
└── public/
    └── css/
        ├── base.css        # Reset, layout, typography, utilities
        ├── components.css  # Navbar, cards, buttons, inputs, badges
        ├── home.css        # Home, blog, map, catalog sections
        ├── admin.css       # Admin panel and user table
        └── discard.css     # Disposal confirmation and success screens

Future Improvements

  • Donor Leaderboard: Ranking of top contributors by points to increase the competitive gamification element.
  • Environmental Impact Report: Estimated CO₂ and heavy metal diversion metrics based on registered disposal volume.
  • Push Notifications: Remind residents about nearby collection points or new products in the catalog.
  • Reverse Logistics Integration: Connect with certified e-waste recycling partners to track the destination of collected materials.
  • PostgreSQL Migration: Replace SQLite with PostgreSQL for production-grade concurrency support.

Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a branch for your feature (git checkout -b feature/my-feature)
  3. Make your changes and commit them (git commit -m 'Add my feature')
  4. Push to your branch (git push origin feature/my-feature)
  5. Open a Pull Request

Please keep the code simple and consistent with the existing style.

Authors

  • Beatriz Melo Lanteuil — UI/UXGitHub
  • Bruno Lourenço Lima de Santana Vasconcelos — FrontendGitHub
  • João Gabriel Dornelas de Luna Lopes — Product OwnerGitHub
  • Gabriel Victor Albuquerque de Lira — FrontendGitHub
  • Gustavo Lins de Santana Macedo — BackendGitHub
  • Leonardo Sales De Sá Cruz — BackendGitHub

Academic Advisor

  • Prof. André Luiz Gomes Da Silva - Project Management & Inovation
  • Prof. Samantha Grasielle Camara Pimentel Interaction Design
  • Prof. Victor Henrique dos Santos Oliveira - Front End
  • Prof. Ronierison de Souza Maciel - Database
  • Prof. Leonardo Lucena Trevas - Tech English

About

Platform for managing electronic waste disposal.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors