Giter Club home page Giter Club logo

project_portal's Introduction

AcademyPortal API - Davin

Setup

  1. Run composer install in root of project
  2. Create database with name academyPortal and populate using latest version in db/
  3. To run the application locally: composer start

Running tests

  • To run the unit tests locally: composer test

Deploy

  • Files/folders that can be easily replaced with uploads:
    • db/
    • logs/
    • public/
    • src/Classes/
  • Files that require more care:
    • src/dependencies (Factories go here but so does db connection, config for db should be the same in local and deployed now (config, not credentials))
    • src/settings (deployed version contains different credentials, shouldn't need to be updated)

Routes

  • for local development use localhost:8080/api/whatYouRequire as your URL

/login

POST

  • Login registered user
  • Sends:
  • Returns success true / false:
    • if registered user and correct email and password
      • {'success':true, 'msg':'Valid User', 'data':[]}
    • if not registered or incorrect email and password
      • {'success':false, 'msg':'Incorrect email or password.', 'data':[]}

/registerUser

POST

  • Registers a new user by saving in database
  • Sends:
  • Checks if email already exists in database
  • If email does not exist then saves to database
  • Returns success true / false:
    • if new user registered successfully
      • {'success':true, 'msg':'User registered', 'data':[]}
    • if new user not registered successfully, either already exists or insert into database failed
      • {'success':false, 'msg':'User not registered.', 'data':[]}

/applicationForm

GET

  • Gets available dropdown values from database for:
    • When would you like to join us?
    • How did you hear about Mayden Academy?
  • Returns:
    • if GET request is successful
      • {'success':true, 'msg':'Retrieved dropdown info.', 'data':['cohorts':'Available cohort values', 'hearAbout':'Available hear about values']}

/saveApplicant

POST

  • Saves a new application to the applicant table in the database
  • Sends:
    • {'name': 'example', 'email': '[email protected]', 'phoneNumber': '0123456789', 'cohortId': 2, 'whyDev': 'example interest in development', 'codeExperience': 'example coding experience', 'hearAboutId': 3, 'eligible': '1' or '0', 'eighteenPlus': '1' or '0', 'finance': '1' or '0', 'notes': 'example notes' }
  • Returns success true / false:
    • if new applicant registered successfully
      • {'success':true, 'msg':'Application Saved', 'data':[]}
    • if new applicant not saved successfully
      • {'success':false, 'msg':'Application Not Saved', 'data':[]}

/deleteApplicant

DELETE

  • Changes the 'deleted' value for a single entry in the applicant table to '1'.
  • Sends:
    • {'id' : 'integer'}
  • Returns a json package with either an HTTP status of 200 for success or 500 for error.
    • {'success':boolean, 'msg':'string', 'data':[]}

/createHiringPartner

POST

  • Saves a new hiring partner to the hiring_partner_companies table in the database
  • Sends:
    • {'name': 'example', 'companySize': '1', 'techStack': 'example tech stack', 'postcode': 'BA1 1AA, 'phoneNumber': '01225 444444', 'companyURL': 'www.example.com', }
  • Returns success true / false:
    • if new applicant registered successfully
      • {'success':true, 'msg':'Hiring Partner successfully added', 'data':[]}
    • if new applicant not saved successfully
      • {'success':false, 'msg':'Hiring Partner not added', 'data':[]}

/getHiringPartnerInfo

GET

  • Retrieves all the hiring partners data from the hiring_partner_companies table in the database
  • Data format:
    • { 'id': '1', 'name': 'example', 'size': '5-30', 'tech_stack': 'LAMP', 'postcode': 'BA1 2QF', 'phone_number': '07436124985', 'url_website': 'example.com' }
  • Returns success true / false:
    • if the data are received successfully
      • {'success':true, 'msg':'Query Successful', 'data':[]}
    • if the data are not received successfully
      • {'success':false, 'msg':'SQL error message', 'data':[]}
    • if there are not data in the database
      • {'success':false, 'msg':'No hiring partners found!', 'data':[]}

/createStage

POST

  • Adds a new stage in the last order position.
  • Sends:
    • {'title' : 'string'}
  • Returns success true / false:
    • if stage is added successfully
      • {'success':true, 'msg':'Stage added successfuly.', 'data':[]}
    • if stage could not be added
      • {'success':false, 'msg':'Error (dependant on reason)', 'data':[]}

/updateStages

EDIT

  • Goes through an array of edit requests and changes the database
  • Sends an array of:
    • {'id' : 'integer', 'title' : 'string', 'order' : 'integer'}
  • Returns success true / false:
    • if stage is edited successfully
      • {'success':true, 'msg':'Stage edit successful.'}
    • if stage could not be edited
      • {'success':false, 'msg':'Stage edit failed.'}

/deleteStage

DELETE

  • Changes the 'deleted' value for a single entry in the stages table to '1', and changes the 'order' value for that entry to '0'.
  • Sends:
    • {'id' : 'integer'}
  • Returns success true / false:
    • if stage is delete successfully
      • {'success':true, 'msg':'Stage has been deleted successfuly.', 'data':[]}
    • if stage could not be deleted
      • {'success':false, 'msg':'Invalid id provided.', 'data':[]}

project_portal's People

Contributors

davin2020 avatar

Stargazers

 avatar

Watchers

 avatar

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.