A modern, full-stack cryptocurrency exchange platform built with Next.js 15, Prisma, and PostgreSQL.
- ✅ Email OTP authentication
- ✅ Profile management
- ✅ Bank card binding
- ✅ USDT deposit (TRC20/ERC20)
- ✅ USDT withdrawal/selling
- ✅ Transaction history
- ✅ Wallet management
- ✅ Referral system
- ✅ Account statements
- ✅ Secure admin dashboard
- ✅ User management
- ✅ Deposit approval system
- ✅ Withdrawal request management
- ✅ Transaction monitoring
- ✅ Platform settings configuration
- ✅ Wallet adjustments
- ✅ Real-time statistics
- Frontend: Next.js 15 (App Router), React 19
- Backend: Next.js API Routes
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT tokens, HTTP-only cookies (admin)
- Email: Nodemailer
- Styling: CSS Modules
- Node.js 18+ installed
- PostgreSQL database
- Gmail account for email OTP (or other SMTP service)
git clone <repository-url>
cd angelxnpm installCreate a .env file in the root directory:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/angelx?schema=public"
# JWT Secret (change this to a secure random string)
JWT_SECRET="your-secret-key-change-this-in-production-2026-angelx-super-secure"
# Email Configuration (Gmail)
EMAIL_USER="your-email@gmail.com"
EMAIL_PASS="your-gmail-app-password"
# App
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NODE_ENV="development"Note: For Gmail, you need to:
- Enable 2-factor authentication
- Generate an App Password: https://myaccount.google.com/apppasswords
- Use the App Password (not your regular password) in EMAIL_PASS
# Generate Prisma Client
npx prisma generate
# Run migrations
npx prisma migrate dev
# Seed the database (creates admin user and default settings)
npm run seednpm run devThe app will be available at http://localhost:3000
- URL: http://localhost:3000/admin/login
- Email: admin@angelxsuper.com
- Password: Admin@123
- Users can register by entering their email
- An OTP will be sent to their email for verification
The application uses the following main models:
- User: User accounts with email-based authentication
- BankCard: User bank cards for withdrawals
- Wallet: User USDT wallet balances
- Transaction: Deposit/withdrawal transactions
- Admin: Admin accounts with password authentication
- Settings: Platform-wide settings (rates, limits, addresses)
POST /api/auth/send-otp- Send OTP to emailPOST /api/auth/verify-otp- Verify OTP and loginGET /api/auth/me- Get current userPOST /api/update-profile- Update user profileGET /api/wallet- Get wallet balancePOST /api/bank-card- Add bank cardGET /api/bank-card- Get user's bank cardsDELETE /api/bank-card- Delete bank cardPOST /api/select-bank- Select default bankPOST /api/admin/deposit- Submit deposit requestPOST /api/admin/selling-request- Submit withdrawal requestGET /api/history- Get transaction historyGET /api/statements- Get account statementsGET /api/settings- Get platform settingsGET /api/deposit-info- Get deposit addresses
POST /api/admin/login- Admin loginPOST /api/admin/logout- Admin logoutGET /api/admin/check-session- Check admin sessionGET /api/admin/me- Get admin infoGET /api/admin/stats- Get dashboard statisticsGET /api/admin/users- Get all usersPOST /api/admin/users/adjust-wallet- Adjust user walletGET /api/admin/transactions- Get all transactionsGET /api/admin/pending-deposits- Get pending depositsPOST /api/admin/confirm-deposit- Confirm depositPOST /api/admin/reject-deposit- Reject depositGET /api/admin/pending-selling-requests- Get pending withdrawalsPOST /api/admin/confirm-selling-request- Confirm withdrawalPOST /api/admin/reject-selling-request- Reject withdrawalGET /api/admin/settings- Get settingsPUT /api/admin/settings- Update settingsGET /api/admin/profile- Get admin profilePUT /api/admin/profile- Update admin password
angelx/
├── prisma/
│ ├── schema.prisma # Database schema
│ ├── seed.js # Database seeder
│ └── migrations/ # Migration files
├── public/
│ ├── images/ # Static images
│ └── css/ # Global styles
├── src/
│ └── app/
│ ├── lib/ # Utility functions
│ │ ├── prisma.js # Prisma client
│ │ ├── auth.js # User auth helpers
│ │ ├── adminAuth.js # Admin auth helpers
│ │ └── mailer.js # Email service
│ ├── api/ # API routes
│ │ ├── auth/ # User authentication
│ │ ├── admin/ # Admin APIs
│ │ └── ... # Other APIs
│ ├── admin/ # Admin dashboard pages
│ ├── home/ # User home page
│ ├── login/ # Login pages
│ └── ... # Other user pages
├── .env # Environment variables
├── package.json
└── next.config.mjs
# Development
npm run dev # Start dev server
npm run build # Build for production
npm run start # Start production server
# Database
npx prisma generate # Generate Prisma Client
npx prisma migrate dev # Create and apply migrations
npx prisma studio # Open Prisma Studio (DB GUI)
npm run seed # Seed the database
# Linting
npm run lint # Run Next.js linter- Verify EMAIL_USER and EMAIL_PASS in .env
- For Gmail, ensure you're using an App Password, not your regular password
- Check that 2FA is enabled on your Gmail account
- Verify DATABASE_URL is correct
- Ensure PostgreSQL is running
- Check database credentials and database name
- Run
npx prisma generateafter schema changes - Run
npx prisma migrate devto apply migrations - Try
npx prisma migrate resetto reset the database (⚠️ deletes all data)
Update these for production:
- Change JWT_SECRET to a strong random string
- Update DATABASE_URL to production database
- Configure production email service
- Set NODE_ENV="production"
npm run build
npm run startOr deploy to Vercel:
- Always use HTTPS in production
- Keep JWT_SECRET secure and random
- Use environment variables for sensitive data
- Enable CORS protection
- Implement rate limiting for APIs
- Regular security audits
Private/Proprietary
For issues and questions, please contact the development team.