REST API server application for Balancio. It's built with Node and Express. For communication with MongoDB database official mongodb driver is used.
Server is currently in prototype phase.
- In root server directory file
.envwith values for server environment variablesDB_CONN_CERT="<path-to-mongodb-certificate-file>" DB_CONN_URL="<mongodb-connection-url>" DB_NAME="<database-name>" SRV_HOST="<server-host>" SRV_PORT="<server-port>" AUTH_TOKEN_SECRET="<secret-for-signing-auth-token>"
npm run start-
[POST] /users/login// Request Body | Login Credentials { username: string, password: string }
// Response Header | Bearer Token { Authorization: "Bearer <token>", ... }
-
[POST] /users// Request Body | Registration Data { username: string, password: string, password_confirm: string, }
-
[POST] /wallets// Request Body | New Wallet object data { "name": string, "currency": string }
-
[GET] /wallets/:id// Response Body | Wallet object data { "_id": string, "name": string, "currency": string, "total": number, "user_ids": string[] // ref[] -> users }
-
[GET] /users/:username/wallets// Response Body | Array of Wallet objects [ { "_id": string, "name": string, "currency": string, "total": number, "user_ids": string[] // ref[] -> users }, ... ]
-
[POST] /wallets/:id/transactions// Request Body | New Transaction object data [ { "title": string, "date": number, // Unix Time (ms) "amount": number }, ... ]
-
[GET] /wallets/:id/transactions// Response Body | Array of Transaction objects (Sorted by date, descending) [ { "_id": string, "title": string, "date": number, // Unix Time (ms) "amount": number, "wallet_id": string // ref -> wallets }, ... ]