A full-stack cryptocurrency wallet application built with Java 21 + Spring Boot backend and React + TypeScript frontend, featuring Bitcoin and USDT (TRC-20) wallet management.
Before running the application, ensure you have the following installed:
- Java 21 or later
- Maven 3.6+
- Node.js 16+ and npm
- Git (optional, for cloning)
# Start both backend and frontend
./startwallet.sh
# Stop both services
./stopwallet.shIf you prefer to run services manually:
cd backend
mvn spring-boot:runcd frontend
npm install # First time only
npm startOnce started, access the application at:
- π₯οΈ Main Application: http://localhost:3000
- π§ Backend API: http://localhost:8080/api
- ποΈ Database Console: http://localhost:8080/h2-console
- JDBC URL:
jdbc:h2:mem:testdb - Username:
sa - Password: (leave empty)
- JDBC URL:
- User Registration: Create new accounts with secure password hashing
- Login System: Secure authentication with session management
- Auto-Login: Remember user sessions between visits
- Multi-Currency Support: Bitcoin (BTC) and USDT (TRC-20)
- Wallet Creation: Generate secure wallets with private keys
- Balance Tracking: Real-time balance updates
- Address Management: Secure address generation
- Send Crypto: Transfer Bitcoin and USDT to any address
- Transaction History: Complete transaction log with status tracking
- Fee Calculation: Automatic fee estimation
- Transaction Status: Pending, Confirmed, Failed states
- Mobile-First: Optimized for all screen sizes
- Touch-Friendly: Large buttons and intuitive gestures
- Modern UI: Glass morphism design with smooth animations
- Responsive Navigation: Adaptive navigation for all devices
- Java 21 - Latest LTS version
- Spring Boot 3.2 - Application framework
- Spring Data JPA - Database abstraction
- Spring Security - Authentication & authorization
- H2 Database - In-memory database for development
- Lombok - Reduce boilerplate code
- Maven - Dependency management
- React 18 - UI library
- TypeScript - Type safety
- Modern CSS - Custom responsive design
- Axios - HTTP client
- Local Storage - Session persistence
- BitcoinJ - Bitcoin operations
- Web3j - Ethereum/Tron operations
cryptowallet/
βββ backend/ # Spring Boot application
β βββ src/main/java/
β β βββ com/cryptowallet/
β β βββ controller/ # REST controllers
β β βββ service/ # Business logic
β β βββ repository/ # Data access
β β βββ entity/ # JPA entities
β β βββ dto/ # Data transfer objects
β β βββ config/ # Configuration
β βββ src/main/resources/
β β βββ application.yml # Application configuration
β βββ pom.xml # Maven dependencies
βββ frontend/ # React application
β βββ src/
β β βββ components/ # React components
β β βββ services/ # API services
β β βββ types/ # TypeScript types
β β βββ styles/ # CSS styles
β βββ public/ # Static assets
β βββ package.json # npm dependencies
βββ logs/ # Application logs
βββ startwallet.sh # Startup script
βββ stopwallet.sh # Stop script
βββ README.md # This file
Comprehensive startup script that:
- β Checks all prerequisites (Java, Maven, Node.js, npm)
- π Stops any existing instances on ports 3000 and 8080
- π Starts backend and frontend in correct order
- β±οΈ Waits for services to be ready before proceeding
- π Shows real-time startup progress
- π Creates detailed logs in
logs/directory - π― Provides all necessary URLs and information
Clean shutdown script that:
- π Gracefully stops all services
- π§Ή Cleans up hanging processes
- β Verifies all services are stopped
- π Provides manual cleanup commands if needed
POST /api/users/register- Register new userPOST /api/users/login- User login
GET /api/users/{id}- Get user by IDGET /api/users/username/{username}- Get user by usernamePUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user
POST /api/wallets/user/{userId}- Create walletGET /api/wallets/user/{userId}- Get user walletsGET /api/wallets/{walletId}- Get wallet by IDPOST /api/wallets/{walletId}/refresh-balance- Refresh balance
POST /api/transactions/send- Send transactionGET /api/transactions/wallet/{walletId}- Get wallet transactionsGET /api/transactions/user/{userId}- Get user transactionsGET /api/transactions/hash/{txHash}- Get transaction by hash
-
Start Backend in Development Mode:
cd backend mvn spring-boot:run -Dspring-boot.run.profiles=dev -
Start Frontend in Development Mode:
cd frontend npm start
-
Build Backend:
cd backend mvn clean package java -jar target/crypto-wallet-backend-0.0.1-SNAPSHOT.jar -
Build Frontend:
cd frontend npm run build # Serve the build directory with a static server
-
Port Already in Use:
# Kill processes on specific ports lsof -ti:8080 | xargs kill -9 lsof -ti:3000 | xargs kill -9
-
Java Version Issues:
# Check Java version java -version # Should be 21 or later
-
Maven Issues:
# Clean and reinstall dependencies cd backend mvn clean install
-
Node.js Issues:
# Clear npm cache and reinstall cd frontend rm -rf node_modules package-lock.json npm install
Check the log files for detailed error information:
- Backend:
logs/backend.log - Frontend:
logs/frontend.log
# Monitor backend logs
tail -f logs/backend.log
# Monitor frontend logs
tail -f logs/frontend.log- This is a development application with placeholder crypto implementations
- Do not use in production without implementing real blockchain integrations
- Private keys are stored in plain text for development purposes
- Always use HTTPS in production environments
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues:
- Check the log files in the
logs/directory - Ensure all prerequisites are installed
- Try running
./stopwallet.shthen./startwallet.sh - Check if ports 3000 and 8080 are available
Happy Trading! ππ°