A comprehensive digital banking platform built with Go (backend) and Vue.js (frontend), featuring secure wallet management, transaction processing, and user authentication.
- User Management: Secure user registration, authentication, and profile management
- Wallet System: Multi-currency wallet support with balance tracking
- Transaction Processing: Secure money transfers between users
- Two-Factor Authentication: Enhanced security with TOTP support
- Admin Panel: Comprehensive administrative tools and monitoring
- Audit Logging: Complete audit trail for all system activities
- API Documentation: Swagger/OpenAPI documentation
- Go 1.21+
- Node.js 18+
- MySQL 8.0+
- Redis 6.0+
- Copy
env.example
to.env
and configure your environment variables - Set up your MySQL database and Redis instance
- Configure the database connection details in your
.env
file
If you encounter foreign key constraint errors like:
Error 3780 (HY000): Referencing column 'user_id' and referenced column 'id' in foreign key constraint 'fk_users_wallets' are incompatible.
This indicates a schema mismatch between your existing database and the new UUID-based schema. To resolve this:
# Run the interactive database fix script
./fix-database.sh
This script will guide you through the available options and set the necessary environment variables.
Option 1: Force Database Recreation (Recommended for Development)
# Set environment variable
export FORCE_DATABASE_RECREATION=true
export RESET_DATABASE_ON_STARTUP=true
# Restart the application
./start-go-dev.sh
Option 2: Use the Force Recreation API Endpoint
# Call the force recreation endpoint
curl -X POST http://localhost:8080/api/data/force-recreate
Option 3: Manual Database Reset
# Set environment variable
export RESET_DATABASE_ON_STARTUP=true
# Restart the application
./start-go-dev.sh
-
Backend (Go)
# Development mode ./start-go-dev.sh # Production mode ./start-go.sh
-
Frontend (Vue.js)
cd frontend npm install npm run dev
-
Docker (Alternative)
# Development docker-compose -f docker-compose.dev.yml up # Production docker-compose up
Once the application is running, you can access the Swagger documentation at:
- Swagger UI:
http://localhost:8080/swagger/index.html
- API Base URL:
http://localhost:8080/api
- JWT-based authentication
- Two-factor authentication (TOTP)
- Rate limiting and input validation
- Secure password hashing with bcrypt
- Comprehensive audit logging
- CORS protection
SecureWallet/
├── internal/ # Go backend code
│ ├── config/ # Configuration management
│ ├── middleware/ # HTTP middleware
│ ├── models/ # Data models
│ ├── routes/ # API routes
│ └── services/ # Business logic
├── frontend/ # Vue.js frontend
├── db/ # Database initialization scripts
├── docs/ # API documentation
└── docker/ # Docker configuration
The application uses UUIDs for all primary keys and foreign keys, ensuring:
- Global uniqueness
- No auto-increment conflicts
- Better security (no predictable IDs)
- Distributed system compatibility
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Check the API documentation at
/swagger/index.html
- Review the logs for detailed error information
- Use the database reset endpoints if you encounter schema issues