Git Product home page Git Product logo

rescueforceapi's Introduction

In order to connect a local deployment of this API to the remote database, add some environmental variables. Add these variables to the terminal that is running the API.

  1. type 'export DBUSER=****' into your terminal (replace *'s with user name)
  2. type 'export DBPASSWORD=***' into your terminal (replace *'s with password)

In order to use this API with your own local database, follow these steps:

  1. create a mongodb/ directory to hold the database. The directory name does not matter, but I am using mongodb/. I have a rescue_force/ directory that contains RescueForce and RescueForceAPI subdirectories, and I created the mongodb/ directory as an additional subdirectory to rescue_force/.
  2. from the directory containing the mongodb/ directory, enter the following into bash: ‘mongod --dbpath mongodb’
  3. from bash: ‘npm start’ for nodemon, or ‘npm run start-server’ for node

rescueforceapi's People

Contributors

carlfsmithiii avatar jayaimzzz avatar lellingwood avatar

Watchers

 avatar

rescueforceapi's Issues

Endpoint - create an endpoint that allows registered host user to update their information.

USER STORY: Endpoint will allow authorized user to submit a PATCH request which will update user's information, such as address, capacity, and species accepted.

DESCRIPTION & NOTES: Headers should include authorization token and content-type (application/json). Endpoint should return the user's updated id, username, display name, about, createdAt, updatedAt, species, and capacity.

ACCEPTANCE CRITERIA: Endpoint allows authorized user to update their information.

General - update schema to include an "about" key/value pair for animals.

USER STORY: Authorized users will be able to enter general information concerning an animal in an "about" input box.

DESCRIPTION & TECHNICAL NOTES: Animal schema must be updated to include an "about" property which will accept a string as a value. This property should appear in the schema close to the "special needs" property so that users can update the API/database with additional, relevant information concerning the particular animal.

ACCEPTANCE CRITERIA: User will be able to enter information about an animal that is not otherwise covered by properties outlined in the schema.

Endpoints - Create endpoint for registering new host users.

USER STORY: User will be able to submit a POST request to this API endpoint that allows the new registrant to enter a username, password, and display name.

DESCRIPTION & NOTES: Endpoint returns the user's username and display name.

ACCEPTANCE CRITERIA: Endpoint will allow new user to register and will save the user's username, password, and display name.

Endpoint - create an endpoint that allows authorized user to delete their account.

USER STORY: Endpoint will allow authorized users to submit a DEL request to delete their account. Authorized users will include host user and admin user.

DESCRIPTION & NOTES: Header will include authorization token.

ACCEPTANCE CRITERIA: Endpoint allows a host user to delete themselves, or an admin user to delete a host user.

Endpoint - create an endpoint that allows authorized users to get all messages.

USER STORY: Authorized user will be able to submit a GET request to this API endpoint that allows the authorized user to view all messages.

DESCRIPTION & NOTES: Endpoint will include params limit and offset. Endpoint will return an object containing an array of the messages. Messages will include: id, text, userId, and createdAt.

ACCEPTANCE CRITERIA: Endpoint returns all messages in response to an authorized user's request.

Update "PUT" to "PATCH" for animal updates.

USER STORY: Sending a request for to update animals through Postman will be a PATCH rather than a PUT request.

DESCRIPTION & TECHNICAL NOTES: See Carl.

ACCEPTANCE CRITERIA:

Endpoint - create an endpoint that allows authorized users to create an animal profile.

USER STORY: Endpoint will allow authorized admin users to submit a POST request which will be able to create new animal profiles.

DESCRIPTION & NOTES: Header should include authorization token and content-type (application/json). Animal object should include: id, name, dob, shelterId, hostid, status, species, sex, breed, specialNeeds, pregnant, fixed, animalFriendly, peopleFriendly, images, specialDiet, dietNotes, about.

ACCEPTANCE CRITERIA: Endpoint will allow admin user to create a new animal profile.

Endpoints - Create endpoint for registered user to Log into application

USER STORY: POST request. The log in endpoint will confirm that the registered host user exists by confirming the username and password.

DESCRIPTION & NOTES: Endpoint will return an authorization token, a user id, and login success status (true or false).

ACCEPTANCE CRITERIA: Endpoint will allow registered user to log in. Endpoint will assign user a token, which will then be used to access portions of the application that require authorization.

Endpoint - create an endpoint that allows user to upload a profile picture

USER STORY: Endpoint allows user to submit a PUT request to upload a profile picture.

DESCRIPTION & NOTES: Headers will include authorization token and content-type (multipart/form-data). Body will include a picture file to be uploaded by user.

ACCEPTANCE CRITERIA: Authorized host user can upload their profile picture.

Endpoint - Create endpoint that logs user out of the application.

USER STORY: GET request. Endpoint will log user out of the application.

DESCRIPTION & NOTES: Endpoint will return the success of logout (true or false), as well as a logout message.

ACCEPTANCE CRITERIA: User will be able to log out of the application and receive a message regarding log out success.

Update "PUT" to "PATCH" for delete images.

USER STORY: Sending a request for to update/delete images through Postman will be a PATCH rather than a PUT request.

DESCRIPTION & TECHNICAL NOTES: See Carl.

ACCEPTANCE CRITERIA:

***Endpoint - create an endpoint that gets users by id (type)

USER STORY: This endpoint will allow an authorized admin user to submit a GET request to get a list of host users.

DESCRIPTION & NOTES: (Headers will include: server, connection, x-powered-by, access-control-allow-origin, content-length, content-type, etag, date, and via. See get user by id. in kwitter postman.) User's object return should include: id, username, display name, createdAt, updatedAt, capacity, and species.

ACCEPTANCE CRITERIA: This endpoint will allow an admin user to get a list of host users.

Endpoint - Create endpoint that allowed authorized users to create messages

USER STORY: Authorized host and admin users will be able to submit a POST request to this API endpoint that allows the user to create a message.

DESCRIPTION & NOTES: Headers will content-type (application/json), and an authorization token.

ACCEPTANCE CRITERIA:
Database will return a message object containing:
id,
text,
userId,
updatedAt:
createdAt:

Endpoint - create an endpoint that allows authorized user to get messages by id. (STRETCH)

USER STORY: Authorized user will submit a GET request to this endpoint, which will allow user to access messages by id.

DESCRIPTION & NOTES: Endpoint will return messages limited to a particular user's id. Message object returned will include id, text, userId, and createdAt.

ACCEPTANCE CRITERIA: User will be able to see a list of messages from the registered user.

Endpoint - create an endpoint that allows an authorized user to update an animal profile.

USER STORY: Endpoint would allow authorized user to submit a PATCH request to update an animal profile.

DESCRIPTION & NOTES: Header should include authorization token and content-type (application/json). Animal object should include: id, name, dob, shelterId, hostid, status, species, sex, breed, specialNeeds, pregnant, fixed, animalFriendly, peopleFriendly, images, specialDiet, dietNotes, about.

ACCEPTANCE CRITERIA: Authorized host user will be able to update an animal's profile information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.