Skip to content

jonifallon/docupaws-api

Repository files navigation

General Assembly Logo

Capstone Project - Docu-Paws

ERD

Link to ERD: http://imgur.com/a/xAnQs

URLs

Resources

This project contains two resources:

  • Users
  • Pets

A user can have many pets A pet can have only one owner (user)

Pets

Verb URI Pattern Controller#Action
GET /mypets pets#myIndex
GET /pets/:id pets#show
POST /pets/ pets#create
PATCH /pets/:id pets#update
DELETE /pets/:id pets#destroy

Authentication

Verb URI Pattern Controller#Action
POST /sign-up users#signup
POST /sign-in users#signin
PATCH /change-password/:id users#changepw
DELETE /sign-out/:id users#signout

Technologies Used

The backend is built on Rails and the front end uses browser template.

Dependencies

Install with bundle install.

Until Rails 5 is released, this template should follow the most recent released version of Rails 4, as well as track master branches for rails-api and active_model_serializers.

Installation

  1. Download this template.
  2. Unzip and rename the template directory.
  3. Empty README.md and fill with your own content.
  4. Move into the new project and git init.
  5. Install dependencies with bundle install.
  6. Rename your app module in config/application.rb (change RailsApiTemplate).
  7. Rename your project database in config/database.yml (change 'rails-api-template').
  8. Create a .env for sensitive settings (touch .env).
  9. Generate new development and test secrets (bundle exec rake secret).
  10. Store them in .env with keys SECRET_KEY_BASE_<DEVELOPMENT|TEST> respectively.
  11. In order to make requests to your deployed API, you will need to set SECRET_KEY_BASE in the environment of the production API (using heroku config:set or the Heroku dashboard).
  12. In order to make requests from your deployed client application, you will need to set CLIENT_ORIGIN in the environment of the production API (e.g. heroku config:set CLIENT_ORIGIN https://<github-username>.github.io).
  13. Setup your database with bin/rake db:nuke_pave or bundle exec rake db:nuke_pave.
  14. Run the API server with bin/rails server or bundle exec rails server.

Approach

I decided to use Rails because I know it works well for the project I'm submitting. Adding and modifying resources is easily accomplished by making the changes and then dropping and readding the database using the command line.

Unsolved Problems

None at this time.

  1. All content is licensed under a CCBYNCSA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

About

Docu-Paws api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published