A full-stack digital wallet application built with React frontend and .NET backend, allowing users to manage their digital wallet, view transactions, and transfer funds.
- Node.js (v16.0 or higher)
- .NET SDK 7.0 or higher
- SQL Server
- Git
DigitalWallet/
├── wallet_frontend/ # React frontend application
└── dee_backend/ # .NET backend application
git clone https://github.com/SamWaku/DigitalWallet
cd DigitalWallet- Navigate to the backend directory:
cd dee_backend/api- Restore dependencies:
dotnet restore- Update database connection string:
- Open
appsettings.json - Modify the
DefaultConnectionstring to match your SQL Server configuration:
"ConnectionStrings": {
"DefaultConnection": "Data Source=PCUser\\SQLEXPRESS;Initial Catalog=databasename;Integrated Security=True TrustServerCertificate=True"
}- Apply database migrations:
dotnet ef database update- Run the backend:
dotnet runThe API will be available at http://localhost:5143
- Open a new terminal and navigate to the frontend directory:
cd wallet_frontend- Install dependencies:
npm install- Create
.envfile and configure API URL:
VITE_API_BASE_URL=http://localhost:5143
- Start the frontend application:
npm run devThe application will be available at http://localhost:5173/
-
Create Account
- Path:
/register - Fields:
- Username
- Password
- Path:
-
Login
- Path:
/login - Fields:
- Password
- Path:
- View Wallet
- Path:
/wallet - Displays:
- Username
- Current Balance
- Path:
-
View Transactions
- Path:
/transactions - Displays:
- Transaction Amount
- Receiver Details
- Date/Time (I forgot to add this, but I'll surely do next time)
- Status
- Path:
-
Transfer Funds
- Path:
/transfer - Fields:
- Receiver (email/username)
- Amount
- Path:
POST /api/register
POST /api/login
GET /api/wallet/user/{userId}
GET /wallet-transactions/{userId}
POST /transfer
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=PCUser\\SQLEXPRESS;Initial Catalog=databasename;Integrated Security=True TrustServerCertificate=True"
},
"JwtSettings": {
"Secret": "Your-JWT-Secret-Key",
"ExpiryHours": 24
}
}VITE_API_BASE_URL=http://localhost:5143
-
The backend uses:
- Entity Framework Core for database operations
- JWT for authentication
- Mappers(Manual) for object mapping
- Repository pattern for data access
-
The frontend uses:
- React Router for navigation
- Axios for API calls
- JWT for authentication storage
-
Database Connection
- Ensure SQL Server is running
- Verify connection string in
appsettings.json - Check SQL Server authentication mode
-
CORS Issues
- Backend CORS policy is configured for
http://localhost:5173
- Backend CORS policy is configured for
-
JWT Token
- Tokens expire after 24 hours
- Ensure correct secret key in backend configuration