This project is a secure, production-ready backend for a digital wallet and money transfer platform, built with NestJS and TypeScript.
- User registration, login, and JWT authentication
- Password and PIN reset via email
- Wallet management (balance, funding)
- Money transfers between users
- Payment API integration (e.g., Paystack)
- Modular, scalable architecture
- Input validation and security best practices
- API documentation with Swagger
- Unit and e2e testing
- Node.js (v16+ recommended)
- Yarn
- PostgreSQL
yarn installCreate a .env file in the project root with the following variables:
PORT=3000
DATABASE_URL=postgres://user:password@localhost:5432/transfer_app
JWT_SECRET=your_jwt_secret
PAYSTACK_SECRET_KEY=your_paystack_secret_key
# development
yarn start
# watch mode
yarn start:dev
# production
yarn start:prod# unit tests
yarn test
# e2e tests
yarn test:e2e
# test coverage
yarn test:covPOST /auth/register— Register a new userPOST /auth/login— Login and receive JWTPOST /auth/forgot-password— Request password resetPOST /auth/reset-password— Reset password
GET /users/:id— Get user by ID (JWT required)
GET /wallet/balance— Get wallet balance (JWT required)POST /wallet/fund— Fund wallet (JWT required)
POST /transactions/transfer— Transfer funds to another user (JWT required)
POST /payment— Initiate payment via provider (JWT required)
- Swagger UI: http://localhost:3000/api
- Input validation with DTOs and class-validator
- JWT authentication and guards
- Helmet for HTTP security headers
- Environment-based configuration
- Error handling and logging
- Rate limiting (recommended for production)
Pull requests are welcome! Please open an issue first to discuss major changes.
MIT