๐ฑ TreeByte Backend โ The Engine Behind Reforestation Powered by Web3
This is the backend for TreeByte, a platform that transforms your digital footprint into real-world reforestation ๐ณ. It manages API routes, wallet logic, NFT issuance, metadata generation, and prepares future integrations with Stellar blockchain and IPFS.
๐งฐ Tech Stack
- Node.js + Express
- TypeScript
- Stellar SDK (Testnet-ready)
- Dotenv for environment configuration
- Module-alias for cleaner imports
๐ฆ How to clone and run locally
Clone the repository:
git clone https://github.com/Tree-Byte-org/TreeByte-Backend.git
cd TreeByte-Backend- Duplicate the
.env.examplefile and rename it to.env - Add your Supabase credentials:
# ================================
# SERVER CONFIGURATION
# ================================
PORT=4000
# ================================
# SUPABASE CONFIGURATION
# ================================
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your_supabase_anon_key_here
# ================================
# EMAIL CONFIGURATION
# ================================
MAIL_USER=[email protected]
MAIL_PASS=your_email_password_or_app_password
# ================================
# PINATA (IPFS)
# ================================
PINATA_API_KEY=pinata_api_key
PINATA_SECRET_API_KEY=pinata_secret_api_key
PINATA_JWT=pinata_jwtYou can find these keys in your Supabase dashboard, under Project Settings โ API.
- Go to https://supabase.com
- Create a new project
- Save the project ref and password
npx supabase login
npx supabase link --project-ref YOUR_PROJECT_REFYouโll be asked to enter your database password.
Once linked, push your SQL migrations:
npx supabase db pushThis will create all tables defined in supabase/migrations/ in your Supabase project.
npm install
npm run devnpm run startRoute: POST /api/coupon/redeem/:id
Body JSON:
- userId (uuid, required)
- redemptionLocation (string, optional)
- redemptionNotes (string, optional)
- businessVerification (string, optional)
See src/docs/coupon-redeem-openapi.yaml for full schema and responses.
๐ฌ Contact & Collaborations
Want to contribute, collaborate, or learn more?
๐ฉ [email protected] ๐ฆ @GoTreeByte (https://twitter.com/GoTreeByte)