WalletSimulator is a comprehensive cryptocurrency wallet application that enables users to manage digital assets, perform transactions, and exchange cryptocurrencies. Built with modern web technologies, this full-stack application demonstrates secure user authentication, real-time cryptocurrency price integration via CoinRanking API, and peer-to-peer cryptocurrency transfers.
- Node.js (v14+) - JavaScript runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database for data persistence
- Mongoose - MongoDB object modeling
- bcryptjs - Password hashing and encryption
- JWT (jsonwebtoken) - Secure authentication tokens
- express-session - Session management
- cors - Cross-Origin Resource Sharing
- axios - HTTP client for CoinRanking API integration
- Vanilla JavaScript - Client-side logic
- HTML5 - Markup structure
- CSS3 - Styling and responsive design
- CoinRanking API - Real-time cryptocurrency prices and data
- π User Authentication: Secure registration and login with encrypted passwords and JWT tokens
- π€ User Profile Management: Each user has a unique public address for receiving cryptocurrencies
- π° Crypto Portfolio: Add and manage multiple cryptocurrencies in your personal wallet
- πΈ P2P Transfers: Send cryptocurrencies to other users using their public address
- π Crypto Exchange: Convert between different cryptocurrencies using real-time exchange rates
- π Transaction History: Complete tracking of all transactions (sends, exchanges) with hash generation
- π Advanced Filtering: Filter transactions by hash, user addresses, symbols, amounts, and dates
- π Real-time Prices: Integration with CoinRanking API for up-to-date cryptocurrency prices
- ποΈ MongoDB Integration: Reliable data storage and retrieval
- π Security: Password encryption, JWT authentication, and protected API routes
- π± Responsive Design: Works on desktop and mobile devices
WalletSimulator/
βββ src/
β βββ backend/
β βββ config/ # Database and app configuration
β βββ controllers/ # Request handlers
β βββ middlewares/ # Authentication and validation
β βββ models/ # MongoDB schemas
β β βββ Cripto.js # Cryptocurrency holdings model
β β βββ Transaction.js # Transaction records model
β β βββ Users.js # User accounts model
β βββ routes/ # API endpoints
β βββ authRoutes.js # Authentication routes
β βββ cryptoRoutes.js # Crypto portfolio management
β βββ settingsRoutes.js # User settings
β βββ transactionRoutes.js # Transactions & transfers
β βββ userRoutes.js # User management
βββ public/
β βββ frontend/
β βββ css/ # Stylesheets
β βββ html/ # HTML pages
β β βββ login.html # Login/Register page
β β βββ portfolio.html # Main portfolio dashboard
β βββ js/ # Client-side JavaScript
βββ config/ # Configuration files
βββ package.json # Dependencies and scripts
- Node.js (v14 or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
- CoinRanking API Key (get one at coinranking.com)
- Clone the repository
git clone https://github.com/Phosky71/WalletSimulator.git
cd WalletSimulator- Install dependencies
cd src/backend
npm install- Configure environment variables
Create a
.envfile in thesrc/backenddirectory:
PORT=3000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
SESSION_SECRET=your_session_secret
COINRANKING_API_KEY=your_coinranking_api_key-
Start MongoDB Make sure your MongoDB instance is running.
-
Run the application
npm start- Access the application
Open your browser and navigate to
http://localhost:3000
POST /api/auth/register- Register new userPOST /api/auth/login- User loginDELETE /api/auth/delete- Delete user account
GET /api/crypto- Get user's crypto portfolioPOST /api/crypto- Add cryptocurrency to portfolioGET /api/crypto/cryptocurrencies- Get list of available cryptocurrencies from CoinRankingGET /api/crypto/cryptocurrencies/:uid- Get specific cryptocurrency infoPOST /api/crypto/cryptocurrencies- Get crypto info by UID
GET /api/transactions- Get user's transaction historyPOST /api/transactions/exchange- Calculate exchange rate between cryptocurrenciesPOST /api/transactions/confirm- Confirm and execute crypto exchangePOST /api/transactions/send- Send cryptocurrency to another userGET /api/transactions/user-transactions- Get filtered transactions with advanced search options
GET /api/users- Get user informationDELETE /api/users- Delete user account
Users can send cryptocurrencies to other users by providing:
- Receiver's public address
- Cryptocurrency UID and symbol
- Amount to send
The system validates sufficient balance, updates both sender and receiver portfolios, and generates a unique hash for each transaction.
Users can exchange between different cryptocurrencies:
- Select source and target cryptocurrencies
- Enter amount to exchange
- System fetches real-time exchange rates from CoinRanking API
- Confirm exchange to update portfolio
- Transaction is recorded with unique hash
Advanced filtering options include:
- Hash: Search by transaction hash (partial match)
- User From/To: Filter by sender/receiver public address
- Symbol: Filter by cryptocurrency symbol
- Amount: Filter by minimum amount (from/to)
- Date: Filter by specific date
- Type: Filter by transaction type (send/exchange)
This project demonstrates:
- Full-stack JavaScript development with Node.js and Express
- RESTful API design and implementation
- External API integration (CoinRanking)
- Secure authentication with JWT tokens
- MongoDB database design and relationships
- User-to-user transaction systems
- Real-time data fetching and processing
- Frontend-backend communication
- Session management techniques
- Transaction hash generation using crypto module
- Advanced database querying and filtering
- Passwords are hashed using bcrypt before storage
- JWT tokens for stateless authentication
- Protected routes require valid authentication
- Input validation on all endpoints using express-validator
- CORS configuration for secure cross-origin requests
- Unique transaction hashes using SHA-256
- Atomic database operations to prevent race conditions
- Balance validation before executing transfers
- Username, email, password (hashed)
- Public address (unique identifier for receiving funds)
- Timestamps
- User reference
- Cryptocurrency UID, name, symbol
- Amount held
- Timestamps
- Unique hash (SHA-256)
- User From/To references
- Symbol, from/to amounts
- Transaction type (send/exchange)
- Date timestamp
- Add transaction categories and tags
- Implement email notifications for transactions
- Create admin dashboard for system monitoring
- Implement two-factor authentication
- Add support for more cryptocurrency APIs
- Implement transaction limits and daily caps
- Add multi-signature wallet support
Antonio Juan GonzΓ‘lez-Conde Abril (Phosky71)
- GitHub: @Phosky71
This project is part of a portfolio demonstrating full-stack development capabilities.
This is an educational project created to demonstrate full-stack web development skills with Node.js, Express, MongoDB, vanilla JavaScript, and external API integration.