The API to Pockets
The project runs on rails and postgesql
You can access the site on pockets-backend
Clone the project files to your local repository:
- HTTPS =>
https://github.com/edd-ie/pockets-b.git
- SSH =>
git@github.com:edd-ie/pockets-b.git
- Git CLI =>
gh repo clone edd-ie/pockets-b
Open the terminal and install all dependencies using.
bundle install
After installation run this command to start the rails server
rails s
Your default browser will be launched and the homepage will be rendered
Users has many:
- Cards
- Sims
- Savings
Card has many:
- Transactions
- Save contributions
Sim has many:
- Transactions
- Save contributions
Card has many:
- Card contributions
- sim contributions
User has many:
- Card transactions through cards
- Sim transactions through sims
- Sim contributions through savings
- Card contributions through savings
Savings has many:
- Cards through cards savings
- Sims through sim savings
Card has many:
- Savings through card savings
Sim has many:
- Savings through Sim savings
This handles the logic for the data sourcing from the data
-
User - User logic
-
Card - card Logic
-
Sim - sim Logic
-
Saving - savings logic
-
SaveCard - Card savings logic
-
SaveSim - Sim saving logic
The routes the have full http requests functionality(GET, POST, DELETE, PATCH, PUT)
/users
/savings
/cards
/sims
/save_cards
/save_sims
/sessions
For added functionality some custom routes were created to help get specific data from database
patch "/changePass", to: "users#changePass"
get "/simCat/:id", to: "users#simCat"
get "/cardCat/:id", to: "users#cardCat"
post '/addSaveCard/:id', to: "savings#addCardSave"
post '/addSaveSim/:id', to: "savings#addSimSave"
get "/topSim/:id", to: "users#topSim"
get "/topCard/:id", to: "users#topCard"
get "/userSims/:id", to: "users#userSim"
get "/userCards/:id", to: "users#userCard"
get "/simUsage/:id", to: "users#simUsage"
get "/cardUsage/:id", to: "users#cardUsage"
get '/uSimBal/:id', to: "users#simBal"
get '/uCardBal/:id', to: "users#cardBal"
get '/userSaves/:id', to: "users#userSavings"
post "/login", to: "sessions#create"
post "/signup", to: "users#create"
get "/me", to: "users#show"
delete "/logout", to: "sessions#destroy"
This project was a team effort from the following individuals :
The project is licensed under the BSD 3-Clause "New" or "Revised" License, thus redistribution and use in source and binary forms are permitted provided that the conditions are met
WebPage -> pockets backend
Database hosting-> Postgres