Skip to content

mohammedfirdouss/Bloom-Refresh

Repository files navigation

Bloom Refresh

Bloom Refresh is an event-driven web application designed to connect volunteers and organizers for local cleanup events. It simplifies event coordination, facilitates community participation, and quantifies environmental impact.

Screenshot Capture - 2025-08-21 - 12-14-12 Screenshot Capture - 2025-08-21 - 12-16-14

Tech Stack

  • Frontend: Next.js 15 (App Router), TypeScript, Tailwind CSS v4, Radix UI, shadcn/ui, Lucide, react-hook-form, zod
  • Backend (AWS): CDK v2 (TypeScript), API Gateway (REST), Lambda (Python 3.12), DynamoDB, EventBridge, SQS, SNS, Cognito, S3

Getting Started

Prerequisites

  • Node.js 18.18+ (recommended 20+)
  • Package manager: pnpm (preferred) or npm
  • AWS account + credentials configured (for backend deploy)
  • AWS CDK: npm i -g aws-cdk (optional; you can run via npx)

Repository Structure

frontend/   # Next.js app (App Router) and API route proxies
backend/    # AWS CDK app (TypeScript) + Lambda sources (Python)

Frontend

Install dependencies

cd frontend
# Using pnpm (preferred)
pnpm install
# or using npm
npm install

Run the development server

pnpm dev   # or: npm run dev

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

Build and start (production)

pnpm build  # or: npm run build
pnpm start  # or: npm start

Lint

pnpm lint   # or: npm run lint

Frontend Environment Variables

  • BACKEND_API_BASE_URL (optional): When set, the Next.js API routes proxy to the deployed AWS backend instead of the local mock DB.
    • Example: https://{restApiId}.execute-api.{region}.amazonaws.com
    • Important: Do not include the stage segment (the app appends /v1/...). If you use the CDK output ApiBaseUrl (which includes /v1/), remove the trailing /v1.

Without this variable, the frontend uses an in-memory mock data layer for local development.

Backend (AWS CDK)

The backend is defined with AWS CDK (TypeScript) under backend/ and deploys:

  • DynamoDB tables: Users, Events, RSVPs, VolunteerReports, OrganizerReports, AggregateImpact (+ GSIs)
  • S3 bucket for photos
  • Cognito User Pool + User Pool Client
  • EventBridge Event Bus + rules
  • SQS queues (notification, impact) with DLQs
  • SNS topics (organizer, volunteer)
  • API Gateway REST API (/v1) with Lambda integrations
  • Lambda functions (Python 3.12): API handler, Notifications processor, Impact processor

Deploy

cd backend
npm install

# First time in an account/region
npx cdk bootstrap

# Deploy the stack
npm run deploy

After deployment, note the CloudFormation outputs:

  • ApiBaseUrl: e.g., https://xxxx.execute-api.us-east-2.amazonaws.com/v1/
  • UserPoolId, UserPoolClientId
  • EventBusName, PhotosBucketName

Configure the frontend to use the backend:

# frontend/.env.local
BACKEND_API_BASE_URL=https://xxxx.execute-api.us-east-2.amazonaws.com

Useful CDK commands

# From backend/
npm run synth
npm run diff
npm run deploy
npm run destroy

Notes on Authentication

  • Cognito is provisioned, but the current frontend uses a mock auth path for RSVP creation.
  • When wiring Cognito on the frontend, send the Authorization: Bearer <JWT> header; protected routes in API Gateway will validate JWTs via the User Pool authorizer.

How Frontend and Backend Integrate

  • The frontend calls its Next.js API routes (under frontend/app/api/*).
  • Those routes proxy to the backend when BACKEND_API_BASE_URL is set, adapting response shapes where needed.
  • Without the env var, the routes use a local in-memory store to enable offline development.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published