Skip to content

samir-hub/life-sim-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

MyPath 🏁

MyPath is dedicated to helping high school students and young adults plan for the future. This is the repository for MyPath's back-end. It was built using Java and Spring Boot with a PostgreSQL database.

Deployed Application


API Documentation

BASE URL https://samirlilienfeld-mypath.herokuapp.com

Table of Contents

NON-PROTECTED ENDPOINTS

Links Endpoints
POST Registration /createnewuser
POST Login /login

PROTECTED ENDPOINTS

Links Endpoints
GET Logout /logout
GET User's Info /users/getuserinfo
GET Details By Id /details/details/:detailsid
GET Details By User Id /details/user/:userid
PUT Details /data/details/:detailsid
DELETE Details /data/details/:detailsid

[POST] Registration

Payload: an object with the following credentials:

Required: username, password, & primaryemail

{
  "username": "myUsername",
  "password": "myPassword",
  "primaryemail": "myemail@gmail.com",
}

Back to Top


[POST] Login

Request Structure: the username and password with an authorization header containing the CLIENTID and CLIENTSECRET

axios.post('https://samirlilienfeld-mypath.herokuapp.com/login', 
           `grant_type=password&username=${USERNAME}&password=${PASSWORD}`, 
           {
            headers: { Authorization: `Basic ${btoa('my-client-id:my-client-secret')}`,
                      'Content-Type': 'application/x-www-form-urlencoded'
                      },
            })

Return: An access token will be returned. Save this token to local storage (or similar). This token will be required for all HTTP requests below (protected endpoints).

{
  "access_token": "2fgce453-63gh-33cd-5ff5-g56dcft55555",
  "token_type": "bearer",
  "expires_in": 3600,
  "scope": "read trust write"
}

Back to Top


[GET] Logout

Return: Removes token from token store and returns nothing.

Back to Top



About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages