Coder Social home page Coder Social logo

easterseals-backend's People

Contributors

bhavrish avatar samitcheema avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

easterseals-backend's Issues

Backend APIs Documentation

Users API

Sign up

Endpoint: POST /users/signup
Example Request:

--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Irenna",
    "email": "[email protected]",
    "password": "password",
    "phone_num": "123456789",
    "date_of_birth": "1000-09-09",
    "race": "qwerty",
    "gender": "qwerty",
    "address": "test-address",
    "employemnt_status": "test-status",
    "military_affiliated": false,
    "military_affiliation": "test-aff",
    "military_start_date": "1990-01-01",
    "military_end_date": "1990-01-01",
    "last_rank": "test-rank",
    "milirary_speciality": "test-specialty",
    "household_size": 0,
    "income": 0.0,
    "current_course": "abc",
    "completed_courses": "def"
}'

Example Response:

{
    "message": "User created succesfully",
    "body": {
        "user": {
            "name": "Irenna",
            "email": "[email protected]",
            "password": "$2a$10$R9xdhJEwYleHhB3XEnwlkOvfFMnWKPHpKT0z0AnHuLfOAGVblssiK",
            "phone_num": "123456789",
            "date_of_birth": "1000-09-09",
            "race": "qwerty",
            "gender": "qwerty",
            "address": "test-address",
            "employemnt_status": "test-status",
            "military_affiliated": false,
            "military_affiliation": "test-aff",
            "military_start_date": "1990-01-01",
            "military_end_date": "1990-01-01",
            "last_rank": "test-rank",
            "milirary_speciality": "test-specialty",
            "household_size": 0,
            "income": 0,
            "current_course": "abc",
            "completed_courses": "def"
        }
    }
}

Login

Endpoint: POST /users/login
Example Request:

curl --location --request POST 'localhost:4000/users/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "[email protected]",
    "password": "password"
}'

Example Response

[
    {
        "id": 1,
        "name": "Irenna",
        "email": "[email protected]",
        "password": "$2a$10$R9xdhJEwYleHhB3XEnwlkOvfFMnWKPHpKT0z0AnHuLfOAGVblssiK",
        "phone_num": "123456789",
        "date_of_birth": "1000-09-09T07:52:58.000Z",
        "race": "qwerty",
        "gender": "qwerty",
        "address": "test-address",
        "employemnt_status": "test-status",
        "military_affiliated": false,
        "military_affiliation": "test-aff",
        "military_start_date": "1990-01-01T08:00:00.000Z",
        "military_end_date": "1990-01-01T08:00:00.000Z",
        "last_rank": "test-rank",
        "milirary_speciality": "test-specialty",
        "household_size": 0,
        "income": 0,
        "current_course": "abc",
        "completed_courses": "def"
    }
]

Get all users

Endpoint: GET /users
Example Request:

curl --location --request GET 'localhost:4000/users/' \
--data-raw ''

Example Response:

[
    {
        "id": 1,
        "name": "Irenna",
        "email": "[email protected]",
        "password": "$2a$10$R9xdhJEwYleHhB3XEnwlkOvfFMnWKPHpKT0z0AnHuLfOAGVblssiK",
        "phone_num": "123456789",
        "date_of_birth": "1000-09-09T07:52:58.000Z",
        "race": "qwerty",
        "gender": "qwerty",
        "address": "test-address",
        "employemnt_status": "test-status",
        "military_affiliated": false,
        "military_affiliation": "test-aff",
        "military_start_date": "1990-01-01T08:00:00.000Z",
        "military_end_date": "1990-01-01T08:00:00.000Z",
        "last_rank": "test-rank",
        "milirary_speciality": "test-specialty",
        "household_size": 0,
        "income": 0,
        "current_course": "abc",
        "completed_courses": "def"
    },
    {
        "id": 2,
        "name": "Irenna1",
        "email": "[email protected]",
        "password": "$2a$10$acH/DBH2A0Lvc0D02Wghlu0yLlKHRHRsav3A3HXNGZWb8iySiBWI6",
        "phone_num": "123456789",
        "date_of_birth": "1000-09-09T07:52:58.000Z",
        "race": "qwerty",
        "gender": "qwerty",
        "address": "test-address",
        "employemnt_status": "test-status",
        "military_affiliated": false,
        "military_affiliation": "test-aff",
        "military_start_date": "1990-01-01T08:00:00.000Z",
        "military_end_date": "1990-01-01T08:00:00.000Z",
        "last_rank": "test-rank",
        "milirary_speciality": "test-specialty",
        "household_size": 0,
        "income": 0,
        "current_course": "abc",
        "completed_courses": "def"
    }
]

Get one user

Endpoint: GET /users/:id
Example Request:

curl --location --request GET 'localhost:4000/users/1' \
--data-raw ''

Example Response:

[
    {
        "id": 1,
        "name": "Irenna",
        "email": "[email protected]",
        "password": "$2a$10$R9xdhJEwYleHhB3XEnwlkOvfFMnWKPHpKT0z0AnHuLfOAGVblssiK",
        "phone_num": "123456789",
        "date_of_birth": "1000-09-09T07:52:58.000Z",
        "race": "qwerty",
        "gender": "qwerty",
        "address": "test-address",
        "employemnt_status": "test-status",
        "military_affiliated": false,
        "military_affiliation": "test-aff",
        "military_start_date": "1990-01-01T08:00:00.000Z",
        "military_end_date": "1990-01-01T08:00:00.000Z",
        "last_rank": "test-rank",
        "milirary_speciality": "test-specialty",
        "household_size": 0,
        "income": 0,
        "current_course": "abc",
        "completed_courses": "def"
    }
]

Update user information

Endpoint: PUT /users/:id
Example Request:

curl --location --request PUT 'localhost:4000/users/1' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Jane Doe",
    "email": "[email protected]",
    "phone_num": "123456789"
}'

Example Response:

"User ${id} updated succesfully"

Delete user

Endpoint: DELETE /user/:id
Example Request:

curl --location --request DELETE 'localhost:4000/users/1' \
--data-raw ''

Example Response:

"User ${id} deleted succesfully"

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.