Skip to content

fMagVen/myWallet_BackEnd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Wallet 🤑 (Back End)

Your wallet, in your pockets!

💻 Tech used

Overview

This is the API with which the My Wallet App interacts.

🛠️Installation

Make sure you have the following tools installed before you begin:

Not needed but recommended: VSCode

This API was designed to work with My Wallet App

Use a terminal interface such as bash or zsh, and enter the following:

#download
gh repo clone fMagVen/myWallet_BackEnd

#access the folder you downloaded it to
cd myWallet_BackEnd

#install dependencies
npm i

The app will run locally and you must configure a .env file with a port of your choosing. The default one is 3000.

⚙️Running

#you can run the server with
node index.js

In another terminal instance, run the db

#you can start the db with
mongod --dbpath ~/.mongo

📜Documentation

All requests are HTTP based

Login, Signup, Auth

To signup, send a post request to /auth/signup with a JSON with the following keys and values: name: your name email: your email password: enter a password confirmPassword: repeat the password from the previous key

To login, send a post request to /auth/login with a JSON with the following keys and values: email: the email you registered with password: your account's password

The API will return a token which will be used to authenticate every screen swap and transaction, to use it, please send a header with the following:

{ Authorization: Bearer <token> }

Where is the token sent by the server

Transactions

To see transactions, use the header described above and send a get request to /transactions/all

new

To add a new transaction, send a post request to /transactions/new with the header above and a body with the following keys and values:

value: The value of your transacion. Integer numbers only. Please use only cents, their value are automatically corrected by factor 100. E.g.: if you want to add $5.00, enter 500 description: A description of what kind of transaction it is expense: true if it is an expense, false if it is an income

delete

To delete an existing transaction, send a post request to /transactions/del, use the same keys and values above, with the header, and add this key with value, before all others: id: the id of your transaction, returned by the get /transactions/all request

and this key and value, after all others:

UserId: your id in the db, returned by the post auth/login request

modify

To modify an existing transaction, send a post request to /transactions/mod, same keys and values of the deletion request.

👨‍💻 Author

Made with care by

Felipe Ventura

Gmail Badge

Linkedin Badge

Contact me anytime!

About

Back end of my wallet app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors