Credos is a campus digital-currency + lending network simulator with a real-time shared ledger and role-based nodes. It’s designed to demonstrate how restricted campus funds (grants, credits, subsidies) can be spent only at authorized recipients, while every action is recorded in a transparent audit trail.
- Role-based nodes: Admin (treasury + approvals), Node (borrow/lend/repay), Merchant (receive payments)
- Request/approval flow: create node → pending → admin approves
- Shared real-time state across devices (laptop + phone) using a local relay
- Auditability: global ledger view of transactions (success + failure)
main login page
borrower lender login
register new node
safe keypad
new node request at admin
admin panel
loan request
lending pool
lend pool contribution
loan pool full choose guarantor
select guarantor
guarantor gets request
loan disbursed
flexible repayments
amount recieved
- React + Vite
- Tailwind CSS
- Gun (real-time graph DB) with a local relay for cross-device sync
- Node.js (LTS recommended)
Clone and enter the project:
git clone https://github.com/The-Shreyas-M/Credos.git
cd CredosInstall dependencies:
npm installnpm run dev:netThis starts:
- Web app (Vite) at
http://localhost:5173/ - Gun relay at
http://localhost:8765/gun
- Ensure your phone can reach your laptop over the network (same Wi‑Fi, or any VPN/LAN setup).
- On your laptop terminal, Vite prints a Network URL.
- Open that URL on your phone browser.
The app points the phone to the same Gun relay automatically (it uses the hostname of the URL you opened).
If your phone and laptop are not on the same Wi‑Fi, you can still access the laptop-hosted demo using a private mesh VPN.
- Install Tailscale on laptop and phone and sign in.
- Turn Tailscale ON on both devices.
- Start the demo on the laptop:
npm run dev:net- In the terminal output, Vite prints a Network URL. Open that URL on your phone.
Notes:
- Do not hard-code IPs into the repo. The URL will be different for every network/device.
- If the phone can’t load the page, check Windows Firewall allows inbound TCP
5173(Vite) and8765(Gun relay) on private networks.
These exist only for demonstration:
- Admin: ID
admin/ PIN1234 - Node: ID
CRED-101/ PIN1234 - Merchant: ID
M-999/ PIN1234
On a fresh database, the relay seeds the treasury with a demo balance so the UI is immediately usable.
If you want to reset the demo state:
- Stop the server (
Ctrl + C) - Delete the
data/folder (local relay database) - Start again:
npm run dev:net
npm run dev— Vite dev server onlynpm run relay— local Gun relay onlynpm run dev:net— runs relay + Vite togethernpm run build— production buildnpm run preview— preview the production build
Gun is peer-to-peer capable and can replicate data across multiple peers. This repo defaults to a local relay to make the demo reliable and fully under your control. To demonstrate stronger decentralization, run 2+ relays on different machines and configure clients to use multiple peers.
- You can deploy the frontend to Vercel.
- The Gun relay in this repo is a stateful server that writes to disk; serverless platforms like Vercel do not provide reliable long-lived disk/network state for this kind of peer.
- For true cross-device persistence without relying on browser storage, you need a persistent always-on peer/relay somewhere (a VPS, Fly.io/Railway/Render, or similar). The frontend can then point to that relay.














