Skip to content

UnexpectedFeatures/GoFare-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

GoFare Infrastructure Server

Backend Server for the GoFare Application

JavaScript Node.js Arduino ESP32 MySQL MSSQL Firebase Android Studio React


About

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.


Table of Contents


Requirements

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)

Features

  • 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)

Release

  • Alternatively you can download the .zip file from the Releases section.

Installation

1. Clone the Repository

git clone https://github.com/JohnIvn/GoFare-Server.git

2. Install Dependencies

cd backend
npm install

3. Configure Environment

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

4. Wiring Diagram

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!)

5. Run the hardware

The arduino script is inside Hardware/rfid_scanner.

6. Run the server

   cd backend

npm

   npm run backend

yarn

   yarn backend

Structure

/
├── Backend/
│   ├── Controllers/
│   │   ├── Admins/
│   │   ├── Discounts/
│   │   ├── Drivers/
│   │   ├── Events/
│   │   ├── RFID-NFC/
│   │   ├── Refund/
│   │   ├── Requests/
│   │   ├── Stripe/
│   │   ├── Users/
│   │   ├── VehicleA/
│   │   └── VehicleB/
│   ├── Routes/
│   ├── Services/
│   ├── Tesseract/
│   └── Websockets/                     
└── Hardware/
    └── rfid_scanner/              

Technologies-Used

Category Tools
Frontend Android Studio, Visual Basic & React JS
Backend Node JS & Websockets
Database Firebase, MYSQL & MSSQL
Hardware Esp 32, Arduino UNO R3 & RC522

Testing

Once everything is set up and the server is running, you can test simply by going to the url.


License

See the LICENSE file for more information.


Built with ❤️ by JohnIvn

About

Server for GoFare Infrastructure.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •