Financial planning simplified. Easily create budgets for your personal projects or expenses.
This is the backend for BudGitz. A live version of the app can be found at [https://budgitz-client.ozharb.vercel.app/]
The front end client can be found at [https://github.com/ozharb/BudGit-client].
Watch your total costs update in real-time as you add, remove, and edit items in each BudGit.
-
API_ENDPOINT:
https://budgitz-api-render.onrender.com/api, -
For testing use:
http://localhost:8000/api, -
Bearer token required: TOKEN_KEY: 'budgitz-client-auth-token',
The Base URL is the root URL for all of the API, if you ever make a request get back a 404 NOT FOUND response then check the Base URL first.
The Base URL is https://budgitz-api-render.onrender.com/api
Requires bearer token. You may use the front end client to login and create a token using demo account.
https://budgitz-client.ozharb.vercel.app/login
- user name: Demo
- password: Demo@2021
API supports Get, Post, Delete, and Patch requests.
/listsget all lists for user/lists:idget specific list for user or delete list./itemsget all items in lists/items/:idget specific item or delete or udpate item./usersget all users. Saves bcryped passwords.
- Node and Express
- Authentication via JWT
- RESTful Api
- Testing
- Supertest (integration)
- Mocha and Chai (unit)
- Database
- Postgres
- Knex.js - SQL wrapper
Deployed via Render
Major dependencies for this repo include Postgres and Node.
To get setup locally, do the following:
-
Clone this repository to your machine,
cdinto the directory and runnpm install -
Create the dev and test databases:
createdb -U postgres -d budgitzandcreatedb -U postgres -d budgitz-test -
Create a
.envfile in the project root
Inside these files you'll need the following:
NODE_ENV=development
PORT=8000
DATABASE_URL="postgresql://postgres@localhost/budgitz"
TEST_DATABASE_URL="postgresql://postgres@localhost/budgitz-test"
JWT_SECRET="oz-special-jwt-secret"
- Run the migrations for dev -
npm run migrate - Run the migrations for test -
npm run migrate:test - Seed the database for dev
psql -U <db-user> -d bettr-dev -f ./seeds/seed.budgitz_tables.sql
Now, run those three commands above again for the test database as well.
- Run the tests -
npm t - Start the app -
npm run dev
