A Progressive Web App for Academic Credential Verification using Decentralized Identifiers (DIDs) and Verifiable Credentials with MongoDB backend authentication.
This project implements a complete Self-Sovereign Identity system that enables:
- Students: Create and manage decentralized digital identities (DIDs), store academic credentials securely, and share credentials selectively
- Universities: Issue verifiable academic credentials to students
- Verifiers: Verify credentials without accessing sensitive information using zero-knowledge proofs
- Decentralized Identity (DID): Create DIDs without relying on centralized authorities
- Verifiable Credentials: W3C-compliant academic credentials
- Selective Disclosure: Share only necessary information using zero-knowledge proofs
- DID-Based Authentication: Passwordless challenge-response authentication
- Privacy-Preserving: Cryptographic proofs without revealing sensitive data
- Multi-Role Support: Student, University, and Verifier portals
- Secure Backend: MongoDB Atlas with JWT authentication
- Progressive Web App: Works offline on mobile and desktop browsers
- Real-time Updates: Dashboard with refresh functionality
- Responsive Design: Modern UI with smooth animations
- Node.js (v14 or higher)
- MongoDB Atlas account (free tier)
- Python 3.x (for frontend server)
git clone https://github.com/kash-gg/Project_SSI.git
cd Project_SSIcd backend
npm install- Create a MongoDB Atlas account
- Create a new cluster (free tier)
- Add a database user with read/write permissions
- Whitelist your IP address (or allow access from anywhere for development)
- Get your connection string
Create backend/.env:
MONGODB_URI=mongodb+srv://YOUR_USERNAME:YOUR_PASSWORD@YOUR_CLUSTER.mongodb.net/ssi_auth?retryWrites=true&w=majority
JWT_SECRET=your-secret-key-change-in-production
PORT=3000
NODE_ENV=developmentnpm run seedThis creates demo accounts:
- University:
admin@university.edu/password - Verifier:
org_demo/demo_key
npm startYou should see:
β Successfully connected to MongoDB Atlas!
β Server running on http://localhost:3000
β API ready at http://localhost:3000/api/auth
In a new terminal from project root:
python -m http.server 5500Open your browser to: http://localhost:5500
- Click "My Credentials" on the home page
- Complete the onboarding process
- Create your DID (Decentralized Identifier)
- Request credentials from universities
- Share credentials selectively with verifiers
- Click "Issue Credentials"
- Login with:
admin@university.edu/password - Issue academic credentials to students
- Track issued credentials
- Click "Verify Credentials"
- Login with:
org_demo/demo_key - Request credential proofs from students
- Verify credentials without accessing sensitive data
- UI Layer: Responsive HTML/CSS with vanilla JavaScript
- Identity Layer: DID management, credential operations, selective disclosure
- Crypto Layer: Web Crypto API for signatures and hashing
- Storage Layer: Encrypted IndexedDB for secure local storage
- PWA Features: Service workers for offline support
- Authentication: JWT-based auth with bcrypt password hashing
- Database: MongoDB Atlas with Mongoose ODM
- API: RESTful endpoints for user management
- Security: CORS, input validation, rate limiting ready
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Backend: Node.js, Express, MongoDB, JWT
- Crypto: Web Crypto API, bcryptjs
- Standards: W3C DID Core, W3C Verifiable Credentials
- Deployment: Render (backend), GitHub Pages (frontend)
- Local:
http://localhost:3000 - Production:
https://your-app.onrender.com
POST /api/auth/university/register
Content-Type: application/json
{
"email": "admin@university.edu",
"password": "securepassword",
"universityName": "Example University"
}POST /api/auth/university/login
Content-Type: application/json
{
"email": "admin@university.edu",
"password": "password"
}POST /api/auth/verifier/register
Content-Type: application/json
{
"orgId": "org_example",
"password": "securepassword",
"organizationName": "Example Organization"
}POST /api/auth/verifier/login
Content-Type: application/json
{
"orgId": "org_demo",
"password": "demo_key"
}All endpoints return JSON:
{
"success": true,
"token": "jwt-token-here",
"user": {
"id": "user-id",
"email": "user@example.com",
"role": "university"
}
}The backend is configured for automatic deployment to Render.
- Push your code to GitHub
- Go to render.com and sign in
- Click New + β Web Service
- Connect repository:
kash-gg/Project_SSI - Render auto-detects
render.yaml - Add
MONGODB_URIenvironment variable - Click Create Web Service
- Create new Web Service on Render
- Connect GitHub repository
- Configure:
- Root Directory:
backend - Build Command:
npm install - Start Command:
npm start
- Root Directory:
- Add environment variables (see DEPLOYMENT.md)
The frontend can be deployed to GitHub Pages or any static hosting service.
- Update
js/api.jswith your Render backend URL - Push to GitHub
- Enable GitHub Pages in repository settings
- Select
mainbranch as source
| Variable | Description | Required |
|---|---|---|
MONGODB_URI |
MongoDB Atlas connection string | Yes |
JWT_SECRET |
Secret key for JWT tokens | Yes |
NODE_ENV |
Set to production |
Yes |
PORT |
Server port (auto-set by Render) | No |
See backend/DEPLOYMENT.md for detailed deployment instructions.
- Demo credentials provided for testing
- CORS enabled for localhost
- JWT tokens with 24-hour expiry
- Change
JWT_SECRETto a strong random string - Implement rate limiting on authentication endpoints
- Add password complexity requirements
- Use HTTPS for all connections
- Restrict CORS to specific domains
- Enable IP whitelisting in MongoDB Atlas
- Implement refresh token rotation
- Add logging and monitoring
- Enable 2FA for admin accounts
- Private keys never leave the user's device
- All credentials encrypted at rest in IndexedDB
- Zero-knowledge proofs for selective disclosure
- No central authority or single point of failure
- Minimal data collection
curl -X POST http://localhost:3000/api/auth/university/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@university.edu","password":"password"}'curl -X POST http://localhost:3000/api/auth/verifier/login \
-H "Content-Type: application/json" \
-d '{"orgId":"org_demo","password":"demo_key"}'Project_SSI/
βββ backend/ # Node.js backend
β βββ models/ # MongoDB models (User.js)
β βββ routes/ # API routes (auth.js)
β βββ middleware/ # Auth middleware
β βββ scripts/ # Utility scripts (seed.js)
β βββ server.js # Express server
β βββ package.json # Backend dependencies
β βββ .env # Environment variables (not in git)
β βββ README.md # Backend setup guide
βββ js/ # Frontend JavaScript
β βββ components/ # UI components
β βββ api.js # API client
β βββ app.js # Main app logic
β βββ did-manager.js # DID operations
β βββ credential-manager.js # Credential operations
β βββ selective-disclosure.js # ZKP implementation
β βββ did-auth.js # Authentication
β βββ crypto-utils.js # Cryptographic utilities
β βββ storage.js # IndexedDB wrapper
βββ icons/ # PWA icons
βββ index.html # Main HTML file
βββ styles.css # Application styles
βββ manifest.json # PWA manifest
βββ service-worker.js # Service worker for offline support
βββ render.yaml # Render deployment config
βββ README.md # This file
MongoDB connection fails
- Verify connection string in
.env - Check IP whitelist in MongoDB Atlas
- Confirm database user credentials
CORS errors
- Ensure backend runs on port 3000
- Verify frontend runs on port 8000
- Check CORS settings in
server.js
Cannot POST /api/auth/... errors
- Confirm backend server is running
- Check API endpoint in DevTools Network tab
- Verify API URL in
js/api.js
DID creation fails
- Check browser console for errors
- Verify IndexedDB is enabled
- Clear browser storage and try again
Credentials not displaying
- Check if wallet is initialized
- Verify credential format
- Inspect IndexedDB storage
- Backend Setup Guide - Detailed MongoDB and backend configuration
- Deployment Guide - Production deployment instructions
- Implementation Plan - Technical architecture and design decisions
This project demonstrates:
- Self-Sovereign Identity (SSI) principles
- Decentralized Identifiers (DIDs) per W3C standards
- Verifiable Credentials (VCs) per W3C standards
- Zero-Knowledge Proofs for selective disclosure
- Modern PWA development
- Full-stack web application architecture
- Secure authentication patterns
MIT License - Feel free to use this project for educational purposes.
This is an educational project. Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- W3C for DID and VC specifications
- MongoDB for database hosting
- Render for backend hosting
- The SSI community for pioneering work in decentralized identity
Made with β€οΈ for the decentralized web