ReactTrace Backend is a Node.js application built with Express and TypeScript that provides APIs for user access control, Stripe checkout integration, currency detection by IP, and Supabase database management.
This project is currently under development. Core features like user access verification, Stripe checkout session creation, webhook handling, and currency detection are implemented. Upcoming improvements include validation, testing, and security enhancements.
🔒 User Access Control: Check paid access by email.
💳 Stripe Checkout Integration: Dynamic session creation per currency.
🌍 Currency Detection: Determines user currency based on IP address.
🔔 Stripe Webhook Handling: Secure processing of Stripe payment events.
🛠️ Supabase Integration: Manages user data and payments.
📜 TypeScript: Strong typing for better code quality.
- 🚀 Express (API framework)
- 📜 TypeScript
- 🔐 Helmet (security middleware)
- 💳 Stripe (payment processing)
- 🛰️ Supabase (database and authentication)
- 🌐 geoip-lite (IP geolocation)
- 🍃 Cors (CORS middleware)
- 🧹 ESLint + Prettier (code quality tools)
- Node.js v16 or higher
- npm or yarn
-
Clone the repository:
git clone https://github.com/your-username/ReactTrace-backend.git cd ReactTrace-backend -
Install dependencies:
npm install # or yarn install -
Set environment variables:
Create a
.env.localfile in the root with:PORT=3000 HOST=localhost NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key NEXT_SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key FRONTEND_URL=http://localhost:3000 BACKEND_URL=http://localhost:3001 STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_PRICE_ID_BRL=price_id_brl STRIPE_PRICE_ID_USD=price_id_usd STRIPE_PRICE_ID_EUR=price_id_eur STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret GEO_API_KEY=your_geo_api_key_if_any
-
Run the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser to access the API.