Backend Server for the GoFare Application
This server is the core infrastructure behind the GoFare Application — a modern fare management system built to serve transportation networks with speed, reliability, and security.
It provides APIs for fare reloading, real-time balance updates, NFC/RFID card authentication, and receipt generation, all while ensuring smooth integration with client-side mobile and kiosk applications.
To run this project locally, ensure you have the following installed:
- Node.js (v14 or higher)
- npm or yarn
- A modern browser (for testing)
- Web server (e.g., Express.js for backend)
- RFID/NFC Reader compatible with your kiosk setup
- Any Database Access (This is built with Firebase)
- Secure fare reloading through web, kiosk, or mobile interfaces
- Real-time NFC/RFID card balance tracking and updates
- Transactional logging with automatic digital receipts
- Role-based user access (commuter, operator, admin)
- API endpoints for commuter registration, card binding, and payment history
- Seamless integration with external systems (e.g., payment gateways or transport terminals)
- Alternatively you can download the
.zip
file from the Releases section.
git clone https://github.com/JohnIvn/GoFare-Server.git
cd backend
npm install
Create a .env file in the root directory and add your configuration:
WS_PORT=
WS_PORT_2=
WS_PORT_3=
MAIL_USER=
MAIL_PASS=
Export your firebase service account and rename it:
key.json
MFRC522 Pin | ESP32 Pin |
---|---|
SDA | 5 |
SCK | 18 |
MOSI | 23 |
MISO | 19 |
IRQ | Not connected |
GND | GND |
RST | 4 |
3.3V | 3.3V (not 5V!) |
The arduino script is inside Hardware/rfid_scanner.
cd backend
npm
npm run backend
yarn
yarn backend
/
├── Backend/
│ ├── Controllers/
│ │ ├── Admins/
│ │ ├── Discounts/
│ │ ├── Drivers/
│ │ ├── Events/
│ │ ├── RFID-NFC/
│ │ ├── Refund/
│ │ ├── Requests/
│ │ ├── Stripe/
│ │ ├── Users/
│ │ ├── VehicleA/
│ │ └── VehicleB/
│ ├── Routes/
│ ├── Services/
│ ├── Tesseract/
│ └── Websockets/
└── Hardware/
└── rfid_scanner/
Category | Tools |
---|---|
Frontend | Android Studio, Visual Basic & React JS |
Backend | Node JS & Websockets |
Database | Firebase, MYSQL & MSSQL |
Hardware | Esp 32, Arduino UNO R3 & RC522 |
Once everything is set up and the server is running, you can test simply by going to the url.
See the LICENSE file for more information.
Built with ❤️ by JohnIvn