Skip to content

luncher-team/LA-Backend-Nick-Stricker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luncher App BackEnd

object descriptions

  • A school has:

    • a unique Id.
    • a unique name.
    • a description.
    • a address.
    • a requested_funds
    • a admin_id that refrences an id on users table.
    • a donated integer, amount donated to school.
    • a flag that indicates if the funds are complete or not.
    • a city.
    • a state.
    • a lat, lattitude on map
    • a lon, longitude on map
    • a timestamps
  • A user has:

    • a unique id.
    • a unique username.
    • a password.
    • a last_name.
    • a first_name.
    • a email.
    • a user_type.
    • a donated integer amount user has donated.

Enpoints

  • School API has the following endpoints:

    • GET to '/schools' for retrieving an array of schools

    • restricted POST to '/schools' for adding a school ; requires {name, address, requested_funds} ; returns the posted object

    • restricted PUT to '/schools/:id' by school id for updating a school ;
      requires object with changed properties ; returns the updated object

    • restricted DELETE to '/schools/:id' by school id for deleteing a school that returns:

      {
          deleted: true
      }
    • GET toto '/schools/:id' for retrieving a school by its id that returns an object with the following structure:

      {
          id: 1,
          name: 'school name here',
          description: 'the school description',
          achieved: false, // or true, the database will return 1 for true and 0 for false
          address: "229 Lawn Way",
          requested_funds: 4000,
          admin_id: 1,
          donated: 0,
          achieved: false,
          city: "town",
          state: "US",
          lat: 0.0,
          lon: 0.0,
          created_at: "",
          updated_at: ""
      }
  • Users API has the following endpoints:

    • GET to '/api/users' for retrieving an array of users

    • POST to '/api/register' for adding a user ; requires { username, password, email } ; returns an object with the following structure:

      {
          username: "",
          token: "",
          id: 0
      }
    • POST to '/api/login' by school id for adding a user ;
      requires { username, password } ; returns an object with the following structure:

      {
          username: "",
          token: "",
          id: 0
      }
    • GET for retrieving a user by its id that returns an object with the following structure:

      {
          id: 1,
          username: "Reginald",
          first_name: "leland",
          last_name: "rogers",
          email: "lelgandrogers@gmail.com",
          user_type: "patron",
          donated: 200
      }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors