Repository files navigation # FLEXY GSM PLATFORM
## Full GSM / Flexy / Cards / Wallet / Reseller Management System
Professional telecom financial platform for:
- Flexy recharge
- GSM services
- Idoom services
- Cards & coupons
- Wallet & virtual money
- Arbah commission system
- Multi-reseller ecosystem
- USB security authentication
---
# SYSTEM ARCHITECTURE
Frontend:
- React.js / Next.js
- TailwindCSS
- Axios
- Redux Toolkit
- Socket.IO Client
Backend:
- Node.js
- Express.js
- PostgreSQL
- Redis
- Socket.IO
- JWT Auth
- GSM Gateway Engine
Infrastructure:
- Ubuntu Server
- NGINX
- PM2
- Docker
- SSH Security
- Cloudflare
---
# PROJECT STRUCTURE
## FRONTEND
frontend/
│
├── public/
├── src/
│ ├── api/
│ ├── assets/
│ ├── components/
│ ├── layouts/
│ ├── pages/
│ ├── redux/
│ ├── routes/
│ ├── services/
│ ├── utils/
│ ├── hooks/
│ ├── contexts/
│ └── styles/
│
├── package.json
└── README.md
---
## BACKEND
backend/
│
├── src/
│ ├── config/
│ ├── controllers/
│ ├── routes/
│ ├── middleware/
│ ├── services/
│ ├── sockets/
│ ├── gsm/
│ ├── queues/
│ ├── jobs/
│ ├── database/
│ ├── models/
│ ├── helpers/
│ ├── logs/
│ └── utils/
│
├── uploads/
├── package.json
└── server.js
---
# USER ROLES
## Roles
- ADMIN
- SUPER_GRO
- GRO
- COMMERCANT
- CLIENT
Each role has:
- Permissions
- Profit percentage
- Wallet limits
- Service restrictions
---
# AUTHENTICATION SYSTEM
## FEATURES
- JWT Authentication
- Refresh Tokens
- USB KEY Authentication
- Device Verification
- 2FA Verification
- Session Logs
- IP Protection
---
# USB KEY SECURITY
## FLOW
1. Admin creates invitation
2. User inserts USB
3. USB gets encrypted token
4. USB linked to account
5. User login requires USB presence
---
# FRONTEND PAGES
# PUBLIC PAGES
## AUTH
### Login
Route:
```bash
/login
Functions:
Username/password login
USB key detection
JWT generation
2FA verification
Forgot Password
/forgot-password
Functions:
Email verification
Reset token generation
DASHBOARD
Main Dashboard
/dashboard
Widgets:
Today earnings
Total transactions
Failed operations
SIM status
Wallet balances
Profit charts
Functions:
Load analytics
Load notifications
Load advertisements
FLEXY MODULE
Flexy Page
/flexy
Functions:
Recharge Mobilis
Recharge Djezzy
Recharge Ooredoo
Send offers
Select SIM
Real-time status
Flexy Transaction History
/flexy/history
Table Columns:
ID
Number
Amount
Offer
Operator
SIM used
Status
Date
Functions:
Search
Filter
Export CSV
Retry failed
Flexy Grosiste
/flexy/grosiste
Functions:
Bulk recharge
Queue management
Batch processing
CSV import
IDOOM MODULE
Idoom Recharge
/idoom
Functions:
ADSL recharge
Fibre recharge
LTE recharge
Fields:
SSUID
Phone number
Amount
CARDS SYSTEM
Cards Dashboard
/cards
Functions:
View stock
Filter cards
Search cards
Card analytics
Upload Cards
/cards/upload
Functions:
Upload TXT
Upload CSV
Bulk import
Duplicate detection
Cards Transactions
/cards/transactions
Functions:
View sold cards
Filter by operator
Search serials
COUPONS SYSTEM
Coupons Stock
/coupons/stock
Functions:
View available coupons
View consumed coupons
View expired coupons
Search Coupons
/coupons/search
Functions:
Search by serial
Search by client
Search by operator
CLIENTS MANAGEMENT
Clients List
/clients
Functions:
Create client
Edit client
Delete client
Suspend client
Client Profile
/clients/:id
Functions:
Wallet history
Profit history
Transactions history
Debt management
USB management
Client Wallet
/clients/:id/wallet
Functions:
Add balance
Remove balance
Debt mode
Transfer money
COMMISSIONS SYSTEM
Arbah Management
/arbah
Functions:
Set percentages
Dynamic commissions
Service commissions
Per-user commissions
TRANSFERS SYSTEM
Incoming Transfers
/transfers/in
Functions:
Add virtual money
Validate payment
Attach proofs
Outgoing Transfers
/transfers/out
Functions:
Send money
Transfer logs
Debt transfers
STOCK MANAGEMENT
Global Stock
/stock
Functions:
View all stock
Calculate value
Export reports
ANALYTICS
Consumption Analytics
/analytics/consumption
Functions:
Daily statistics
Operator statistics
Revenue reports
Profit Analytics
/analytics/profits
Functions:
Client profits
Global profits
Commission reports
ADS MANAGEMENT
Advertisements
/ads
Functions:
Create ads
Schedule ads
Banner management
SETTINGS
System Settings
/settings
Functions:
Global configs
GSM configs
SIM settings
Security configs
BACKEND API
BASE URL:
/api/v1
AUTH ROUTES
POST
/auth/login
Body:
{
"username": "admin",
"password": "123456"
}
POST
/auth/refresh
POST
/auth/logout
POST
/auth/verify-2fa
POST
/auth/usb-auth
USERS ROUTES
GET
/users
GET
/users/:id
POST
/users
PUT
/users/:id
DELETE
/users/:id
FLEXY ROUTES
POST
/flexy/send
Body:
{
"number": "0550000000",
"operator": "mobilis",
"amount": 1000,
"offer": "sama_mix"
}
GET
/flexy/history
POST
/flexy/bulk
IDOOM ROUTES
POST
/idoom/recharge
GET
/idoom/history
CARDS ROUTES
POST
/cards/upload
GET
/cards/stock
POST
/cards/sell
COUPONS ROUTES
GET
/coupons/search
GET
/coupons/stock
WALLET ROUTES
POST
/wallet/add
POST
/wallet/remove
POST
/wallet/transfer
COMMISSIONS ROUTES
GET
/commissions
POST
/commissions/set
ADS ROUTES
GET
/ads
POST
/ads/create
GSM GATEWAY ENGINE
FEATURES
SIM Pool
Dongle management
USSD execution
SMS reading
SMS sending
Auto reconnect
Failover system
GSM COMMAND EXAMPLES
Mobilis
*610*0550000000*1000#
Djezzy
*720*0550000000*1000#
Ooredoo
*115*0550000000*1000#
SOCKET EVENTS
CLIENT EVENTS
socket.emit("new_transaction")
socket.emit("wallet_update")
socket.emit("new_notification")
ADMIN EVENTS
socket.emit("sim_status")
socket.emit("server_alert")
socket.emit("bulk_progress")
DATABASE TABLES
USERS
id
username
password
role
usb_key
wallet
debt
status
TRANSACTIONS
id
type
operator
amount
profit
status
client_id
CARDS
id
serial
operator
value
status
COUPONS
id
code
category
amount
consumed
COMMISSIONS
id
user_id
service
percentage
SECURITY FEATURES
JWT
Refresh Tokens
USB Key Lock
IP Filtering
Rate Limiting
Audit Logs
SSH Only Server Access
SQL Injection Protection
XSS Protection
Helmet.js
CSRF Protection
INSTALLATION
FRONTEND
npm install
npm run dev
BACKEND
npm install
npm run dev
ENV VARIABLES
Backend .env
PORT=5000
DATABASE_URL=
JWT_SECRET=
JWT_REFRESH_SECRET=
REDIS_URL=
USB_ENCRYPTION_KEY=
SMTP_HOST=
SMTP_USER=
SMTP_PASS=
GSM_PORT=/dev/ttyUSB0
DEPLOYMENT
Recommended:
Ubuntu 22
PM2
NGINX
Docker
Cloudflare
FUTURE FEATURES
AI fraud detection
Mobile app
QR payments
Multi-server clustering
SIM bank integration
Advanced accounting
Telegram notifications
WhatsApp notifications
DEVELOPED BY
Abderrahmane Otmane Rachedi
Professional GSM Financial Platform
2026# PhonyBest
# PhonyBest
You can’t perform that action at this time.