PaymentX Backend is the API server for PaymentX, enabling secure NFC-based offline payments for campus environments. It provides endpoints for user registration, wallet management, and transaction processing, all secured with Firebase authentication and MongoDB.
- User & merchant registration (with college email, NFC ID, PIN)
- Wallet top-up, withdrawal, and balance check
- NFC tap-to-pay (offline for users, online for merchants)
- Transaction history for users and merchants
- Firebase authentication and PIN protection
-
Clone the repository:
git clone https://github.com/ISTE-VIT/paymentx-backend.git cd paymentx-backend -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory with:MONGO_URI=your_mongodb_connection_string FIREBASE=base64_encoded_firebase_service_account_json PROJECT_ID=your_firebase_project_id
-
Start the server:
npm start
The server runs on http://localhost:3000 by default.
- All endpoints are under
/api/users,/api/wallets, or/api/transactions - All endpoints require a valid Firebase ID token in the
Authorizationheader
app.js— Express app setup, routes, middlewareserver.js— Server entry pointconfig/— Firebase and MongoDB configmiddleware/— Authentication middlewaremodels/— Mongoose models (User, Wallet, Transaction)routes/— API endpoints
For more details, see the code or contact the maintainer.