{"id":28713872,"url":"https://github.com/ankux/auth-wallet-api","last_synced_at":"2026-04-10T15:38:06.077Z","repository":{"id":298994819,"uuid":"1001777435","full_name":"ankux/auth-wallet-api","owner":"ankux","description":"A simple Node.js and Express.js backend API for user authentication and financial transactions (credit/debit), built with MongoDB and Dockerized for easy deployment.","archived":false,"fork":false,"pushed_at":"2025-06-14T02:53:03.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T03:30:17.056Z","etag":null,"topics":["api","express","mongodb","nodejs","postman"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-14T02:22:21.000Z","updated_at":"2025-06-14T02:55:34.000Z","dependencies_parsed_at":"2025-06-14T03:30:31.319Z","dependency_job_id":"36df501b-4d7f-42d3-8b53-c499633bd7a2","html_url":"https://github.com/ankux/auth-wallet-api","commit_stats":null,"previous_names":["ankux/auth-wallet-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ankux/auth-wallet-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankux%2Fauth-wallet-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankux%2Fauth-wallet-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankux%2Fauth-wallet-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankux%2Fauth-wallet-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankux","download_url":"https://codeload.github.com/ankux/auth-wallet-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankux%2Fauth-wallet-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259906018,"owners_count":22929963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","express","mongodb","nodejs","postman"],"created_at":"2025-06-15T01:00:17.705Z","updated_at":"2025-12-30T22:33:25.233Z","avatar_url":"https://github.com/ankux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\n## Project Structure\n\n```\naffinsys-proj/\n├── config/                 # MongoDB connection setup\n├── controllers/            # Business logic for auth \u0026 transactions\n├── middleware/             # Basic Auth middleware\n├── models/                 # Mongoose models\n├── routes/                 # API endpoints\n├── .env                    # Environment variables\n├── server.js               # Main server file\n└── package.json\n```\n\n---\n\n## Project setup\n\n### 1. Clone the Repo\n\n```bash\ngit clone https://github.com/ankux/auth-wallet-api.git\ncd auth-wallet-api\n```\n\n### 2. Install Dependencies\n\n```bash\nnpm install\n```\n\n### 3. Setup Environment Variables\n\nCreate a `.env` file in the root directory:\n\n```env\nPORT=5000\nMONGO_URI=mongodb://localhost:27017/walletDB\n```\n\n### 4. Start the Server\n\n```bash\nnode server.js\n```\n\nThe server will run at: [http://localhost:5000](http://localhost:5000)\n\n---\n\n## API Endpoints\n\n### 🔑 Auth Routes\n\n| Method | Endpoint    | Description         |\n|--------|-------------|---------------------|\n| POST   | `/register` | Register a new user |\n\n**Sample Request Body:**\n```json\n{\n  \"username\": \"your_username\",\n  \"password\": \"your_password\"\n}\n```\n\n---\n\n### 💳 Transaction Routes (Requires Basic Auth)\n\n| Method | Endpoint  | Description              |\n|--------|-----------|--------------------------|\n| POST   | `/fund`   | Credit funds             |\n| POST   | `/pay`    | Debit funds              |\n| GET    | `/bal`    | Get current balance      |\n| GET    | `/bal?currency=USD`    | Get USD conversion      |\n| GET    | `/stmt`   | Get transaction history  |\n\n#### Authorization:\nUse **Basic Auth** in Postman (or any client):\n\n- **Username:** Registered username\n- **Password:** Registered password\n\n---\n\n## Example Requests\n\n### Register\n\n```http\nPOST /register\n```\n\n```json\n{\n  \"username\": \"john123\",\n  \"password\": \"pass456\"\n}\n```\n\n### Fund account\n\n```http\nPOST /fund\nAuthorization: Basic Auth\n```\n\n```json\n{\n  \"amt\": 100\n}\n```\n\n### Pay another user\n\n```http\nPOST /pay\nAuthorization: Basic Auth\n```\n\n```json\n{\n  \"to\": \"dhruv\",\n  \"amt\": 100\n}\n```\n\n---\n\n## Notes\n\n- All passwords are hashed using **bcrypt**\n- User balances and transactions are stored in MongoDB\n- Only authenticated users can access transaction routes\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankux%2Fauth-wallet-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankux%2Fauth-wallet-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankux%2Fauth-wallet-api/lists"}