Link to ERD: http://imgur.com/a/xAnQs
- Front End Repo: https://github.com/jonifallon/docupaws-client
- Back End Repo: https://github.com/jonifallon/docupaws-api
- Deployed Front End Client: https://jonifallon.github.io/docupaws-client/
- Heroku Site: https://safe-mesa-23831.herokuapp.com/
This project contains two resources:
- Users
- Pets
A user can have many pets A pet can have only one owner (user)
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 |
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 |
The backend is built on Rails and the front end uses browser template.
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
.
- Download this template.
- Unzip and rename the template directory.
- Empty
README.md
and fill with your own content. - Move into the new project and
git init
. - Install dependencies with
bundle install
. - Rename your app module in
config/application.rb
(changeRailsApiTemplate
). - Rename your project database in
config/database.yml
(change'rails-api-template'
). - Create a
.env
for sensitive settings (touch .env
). - Generate new
development
andtest
secrets (bundle exec rake secret
). - Store them in
.env
with keysSECRET_KEY_BASE_<DEVELOPMENT|TEST>
respectively. - In order to make requests to your deployed API, you will need to set
SECRET_KEY_BASE
in the environment of the production API (usingheroku config:set
or the Heroku dashboard). - 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
). - Setup your database with
bin/rake db:nuke_pave
orbundle exec rake db:nuke_pave
. - Run the API server with
bin/rails server
orbundle exec rails server
.
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.
None at this time.
- All content is licensed under a CCBYNCSA 4.0 license.
- All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].