Skip to content

marvelousufelix/EcoStay-Rewards

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EcoStay Rewards

Sustainability Incentive Infrastructure for Hospitality

EcoStay Rewards is an open-source sustainability incentive platform that helps hospitality businesses reward environmentally responsible behavior.

Built on Stellar, EcoStay enables hotels, resorts, restaurants, and tourism operators to incentivize sustainable actions using blockchain-based reward tokens (ECOPT).


Problem Statement

Hospitality businesses face increasing pressure to:

  • Reduce carbon emissions
  • Minimize food waste
  • Lower energy consumption
  • Improve ESG reporting
  • Meet sustainability standards

Most sustainability initiatives fail because there are no direct incentives for guest participation.


Solution

EcoStay Rewards creates a tokenized sustainability ecosystem.

Guests earn points for actions such as:

  • Skipping room cleaning
  • Reusing towels
  • Reducing food waste
  • Using reusable bottles
  • Choosing digital receipts
  • Participating in recycling programs
  • Using public transportation
  • Using e-check-in

Points are stored in a guest wallet and redeemable for rewards (free breakfast, spa discounts, room upgrades, late checkout, and more). Each point issuance is backed by an on-chain ECOPT token on the Stellar network.

Hotels receive:

  • Real-time sustainability analytics dashboard
  • Campaign management tools
  • Carbon impact reports
  • ESG export (GRI, SASB, TCFD, CSV)
  • Guest engagement metrics

Project Structure

ecostay-rewards/
├── apps/
│   ├── guest-app/           # Next.js 14 — guest-facing PWA (port 3000)
│   └── hotel-dashboard/     # Next.js 14 — hotel admin dashboard (port 3001)
├── services/
│   └── reward-engine/       # NestJS — core API + Stellar integration (port 3333)
├── docker-compose.yml
└── package.json             # npm workspaces root

Tech Stack

Layer Technology
Guest App Next.js 14, React 18, Tailwind CSS, Zustand
Hotel Dashboard Next.js 14, React 18, Tailwind CSS, Recharts
API / Backend NestJS 10, TypeORM, PostgreSQL 16, Redis 7
Blockchain Stellar SDK v11, ECOPT token (Stellar asset)
Infrastructure Docker, Docker Compose
State Management Zustand (with localStorage persistence)

Apps

Guest App (apps/guest-app)

Mobile-first PWA for hotel guests.

Route Description
/ Home — entry point with wallet and earn CTAs
/actions Eco actions catalogue — claim points per action
/scan QR code scanner — log actions at hotel stations
/wallet Points balance, transaction history, redeem link
/redeem Rewards catalogue with category filter + confirmation
/profile Sustainability level, badges, CO₂ impact summary

Key components:

  • BottomNav — 5-tab sticky navigation
  • Header — reusable page header with optional back navigation
  • PointsBadge — points display badge
  • store/walletStore.ts — Zustand store (points, transactions, claimed actions, persisted)
  • lib/api.ts — axios client pointed at the reward engine

Hotel Dashboard (apps/hotel-dashboard)

Admin interface for hotel sustainability managers.

Route Description
/ Overview — KPI stats, top eco actions, quick links
/analytics Bar, line, and pie charts for engagement + carbon data
/campaigns List of reward campaigns with status
/campaigns/new Campaign creation form (action, points, schedule, limits)
/carbon-report CO₂ saved vs baseline chart + per-action impact table
/esg-export ESG report generator (GRI / SASB / TCFD / CSV)
/settings Hotel profile and Stellar integration config

Key components:

  • Sidebar — persistent nav with active link highlighting
  • StatCard — KPI card with optional trend indicator

Reward Engine (services/reward-engine)

NestJS REST API — the core backend service.

Endpoints

Method Path Description
POST /rewards/earn Award points for an eco action
POST /rewards/redeem Redeem points for a reward
GET /guests/:guestId/wallet Fetch wallet balance and history
GET /eco-actions List all active eco actions

Modules

  • RewardsModule — earn/redeem logic, transaction recording
  • GuestsModule — guest entity and wallet
  • EcoActionsModule — action catalogue with auto-seeding on boot
  • StellarModule — ECOPT token issuance via Stellar SDK

Eco Actions (default seed)

Action Points
Skip Room Cleaning 50
Public Transportation 60
Reduce Food Waste 40
Participate in Recycling 35
Reuse Towels 30
Use Reusable Bottle 25
E-Check-In 20
Digital Receipt 10

Getting Started

Prerequisites

  • Node.js 20+
  • Docker and Docker Compose

1. Clone and install

git clone https://github.com/your-org/ecostay-rewards.git
cd ecostay-rewards
npm install

2. Configure environment

cp services/reward-engine/.env.example services/reward-engine/.env
# Edit .env — set DB credentials and STELLAR_ISSUER_SECRET

3. Start infrastructure

# Start PostgreSQL and Redis
docker-compose up -d postgres redis

4. Run services

# Reward engine (port 3333)
npm run dev:engine

# Guest app (port 3000)
npm run dev:guest

# Hotel dashboard (port 3001)
npm run dev:dashboard

5. Run everything with Docker

docker-compose up --build

Environment Variables

See services/reward-engine/.env.example for the full list. Key variables:

Variable Description Default
DB_HOST PostgreSQL host localhost
DB_PORT PostgreSQL port 5432
REDIS_HOST Redis host localhost
STELLAR_NETWORK testnet or mainnet testnet
STELLAR_ISSUER_SECRET Stellar issuer secret key (S...)
STELLAR_TOKEN_CODE Token asset code ECOPT

Roadmap

  • Phase 1 (current): Reward engine, guest wallet, QR validation, hotel dashboard, carbon reporting, ESG export
  • Phase 2: Kafka event streaming, ClickHouse analytics, sustainability marketplace, partner integrations
  • Phase 3: Carbon credit marketplace, DAO governance, Soroban smart contracts, global deployment

License

MIT License

About

Blockchain-powered sustainability rewards platform for hotels. Guests earn tokenized points for eco-friendly actions, redeemable for perks. Hotels get ESG analytics, carbon reports, and campaign tools. Built on Stellar, Next.js, and NestJS.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 96.3%
  • JavaScript 1.9%
  • Dockerfile 1.3%
  • CSS 0.5%