CREDO23 / quickbook-backend

Allow you to keep track financials functions like incomes , expenses , invantory and can generate a report

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quickbook-api

Allow you to keep track financials functions like incomes , expenses , invantory and can generate a report

AUTHENTICATION

Register endpoint [POST]

This endpoint allows user to create an account. It takes an JSON object containing at least the required information ( username, email adress, password and phone number ) :

  • Request (application/json)
   {
     "username" : "CREDO23",
     "password" : "credo23",
     "email" : "bakerathierry@gmail.com",
     "phoneNumber" : "0970721888"
   }
  • Response 200 (application/json)
   {
     "message": "Account created successfully",
     "data": {
        "user": {
            "id": "af69d904-acdf-4d82-a198-3b9f53e80eaa",
            "username": "CREDO23",
            "email": "bakerathierry@gmail.com",
            "phoneNumber": "0970721888",
            "isOnline": false,
            "firstname": null,
            "lastname": null,
            "avatar": null,
            "proffession": null,
            "description": null,
            "gender": null
        },
        "accessToken": `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkNSRURPMjMiLCJpZCI6ImFmNjlkOTA0LWFjZGYtNGQ4Mi1hMTk4L
                       TNiOWY1M2U4MGVhYSIsImlhdCI6MTY3NTA3MjkzMCwiZXhwIjoxNjc1Njc3NzMwfQ._XBbWYwG7go19hNrkrnRbb0QiwiY6FsmjUAnV7T1x78`
    },
     "error": null,
     "success": true
   }

Login [POST]

This endpoint allows user log in and get an access token . It takes an JSON object containing the email adress and the password.

  • Request (application/json)

BODY:

   {
     "password" : "credo23",
     "email" : "bakerathierry@gmail.com",
   }
  • Response 200 (application/json)
   {
     "message": "Logged in as bakerathierry@gmail.com",
     "data": {
        "user": {
            "id": "af69d904-acdf-4d82-a198-3b9f53e80eaa",
            "username": "CREDO23",
            "firstname": null,
            "lastname": null,
            "email": "bakerathierry@gmail.com",
            "avatar": null,
            "proffession": null,
            "description": null,
            "gender": null,
            "isOnline": false,
            "phoneNumber": "0970721888",
        },
        "accessToken": `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NzUwNzM4MjIsImV4cCI6MTY3NTY3ODYyMn0.ww3gFNYDqQG16LSHWZ
                        IrH1uWCo5JUnlpd6IyeRbvbio`
     },
     "error": null,
     "success": true
   }

USER

Get [GET]

This endpoint allows to get a specific user. It takes an id as params ( the user id ).

  • Request (application/json)

PARAMS:

{
  id: [id];
}
  • Response 200 (application/json)
   {
    "message": "User found",
    "data": {
        "id": "ff6ba7ee-715b-43e0-a6e0-02ac7d7767e1",
        "username": "username",
        "firstname": null,
        "lastname": null,
        "email": "email@gmail.com",
        "avatar": null,
        "proffession": null,
        "description": null,
        "gender": null,
        "isOnline": false,
        "phoneNumber": "12345678",
    },
    "error": null,
    "success": true
}

Update [PUT]

This endpoint allows to update a specific user. It takes an id in params ( the user id ) and and an JSON object containing the updated fields.

  • Request (application/json)

PARAMS:

{
  id: [id];
}

BODY:

    {
        "firstname": "exemple",
        "lastname": "exemple",
    },
  • Response 200 (application/json)
{
    "message": "User updated successfully",
    "data": {
        "id": "ff6ba7ee-715b-43e0-a6e0-02ac7d7767e1",
        "username": "username",
        "firstname": "exemple",
        "lastname": "exemple",
        "email": "email@gmail.com",
        "avatar": null,
        "proffession": null,
        "description": null,
        "gender": null,
        "isOnline": false,
        "phoneNumber": "12345678",
    },
    "error": null,
    "success": true
}

Delete [DELETE]

This endpoint allows to delete a specific user. It takes an id as params ( the user id ).

  • Request (application/json)

PARAMS:

{
  id: [id];
}
  • Response 200 (application/json)
   {
    "message": "User deleted successfully",
    "data": 1,
    "error": null,
    "success": true
}

About

Allow you to keep track financials functions like incomes , expenses , invantory and can generate a report


Languages

Language:TypeScript 87.7%Language:Handlebars 10.2%Language:Dockerfile 1.8%Language:Shell 0.2%Language:JavaScript 0.1%