From e956405749ea92d00ebaf0372c3abd430735ca81 Mon Sep 17 00:00:00 2001 From: Jeel Dobariya <136002730+JeelDobariya38@users.noreply.github.com> Date: Sat, 18 Oct 2025 11:54:23 +0530 Subject: [PATCH 1/3] Add v0 API specification for password management This document outlines the v0 API specification for the passcodes app, detailing routes for managing passwords including GET, POST, PUT, and DELETE operations. --- custom-backend-docs/specs/v0/spec.md | 108 +++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 custom-backend-docs/specs/v0/spec.md diff --git a/custom-backend-docs/specs/v0/spec.md b/custom-backend-docs/specs/v0/spec.md new file mode 100644 index 0000000..adac166 --- /dev/null +++ b/custom-backend-docs/specs/v0/spec.md @@ -0,0 +1,108 @@ +# v0 Specification + +This `v0` specification is only for prototyping & is not intended to be treated as production ready... + +all the route in v0 spec should be prefix with +`{BASE_URL}/v0/` + +# Routes + +## Passwords +### Get /passwords + +It is use by passcodes app to get all the passwords previously saved by user. + +**Responsible**: +for return all the passwords previously saved by user. + +**Request**: +will be a typical get request with no query or path or any other parameters. + +**Responses**: +- 200 OK + In ideal cases the api should, return all the passwords. + +**Note**: +The authentication, pagination or query parameters based filter is not required currently, As it is just a prototyping api spec but we will add them later... if you can add there support from now itself. but should not be required. +### Post /passwords + +It is use by passcodes app to post the data of single password entity that needs to be saved by server. + +**Responsible**: +for saving the password entity and also should return the password entity with id saved. + +**Request**: +will be a typical a post request with just a body. +```json +{ + "domain": "string", + "username": "string", + "password": "string", + "notes": "string" +} +``` + +**Responses**: +- 201 CREATED + In ideal cases the api should, return the id in response body. + +**Note**: +We don't care for duplicates currently, we in next specification version will provide a way, to let you send a specific status code when there is duplicates. it would be probably 400 BAD REQUEST. + +### Get /passwords/:id + +It is used by passcodes app to get data of a specific single passwords data entity. + +**Responsible**: +for getting the single password entity by its id. + +**Request**: +will be typically a get request with a `:id` as a path parameter. + +**Responses**: +- 200 OK + In ideal cases the api should, return the password entity in response body. +- 404 NOT FOUND + In cases where resource(password) not exist, the api should return 404. + +**Note**: +We don't care for duplicates currently, we in next specification version will provide a way, to let you send a specific status code when there is duplicates. it would be probably 400 BAD REQUEST. + +### Put /passwords/:id + +It is used by passcodes app to update the data of a specific single passwords data entity. + +**Responsible**: +for updating the single password entity by its id. + +**Request**: +will be a put request with a `:id` as a path parameter. + +**Responses**: +- 200 OK + In ideal cases the api should, return the updated password entity in response body. +- 404 NOT FOUND + In cases where resource(password) not exist, the api should return 404. + +**Note**: +.... + +### Delete /passwords/:id + +It is used by passcodes app to delete data of a specific single passwords data entity. + +**Responsible**: +for deleting the single password entity by its id. + +**Request**: +will be a delete request with a `:id` as a path parameter. + +**Responses**: +- 204 NO CONTENT + In ideal cases the api should, return no body. +- 404 NOT FOUND + In cases where resource(password) not exist, the api should return 404. + +**Note**: +.... + From 2ec04e276842582efd3661b3c4b50e2a248c9267 Mon Sep 17 00:00:00 2001 From: Jeel Dobariya Date: Fri, 24 Oct 2025 23:10:07 +0530 Subject: [PATCH 2/3] docs: add response and request schema to api spec --- custom-backend-docs/specs/v0/spec.md | 183 +++++++++++++++++++++------ 1 file changed, 141 insertions(+), 42 deletions(-) diff --git a/custom-backend-docs/specs/v0/spec.md b/custom-backend-docs/specs/v0/spec.md index adac166..c43ea2e 100644 --- a/custom-backend-docs/specs/v0/spec.md +++ b/custom-backend-docs/specs/v0/spec.md @@ -1,38 +1,26 @@ # v0 Specification -This `v0` specification is only for prototyping & is not intended to be treated as production ready... +This `v0` specification is only for prototyping & is not intended to be treated as production ready in any manner... + +all the route in v0 spec should be prefix with `{BASE_URL}/v0/`. -all the route in v0 spec should be prefix with -`{BASE_URL}/v0/` # Routes ## Passwords -### Get /passwords -It is use by passcodes app to get all the passwords previously saved by user. +### POST /passwords -**Responsible**: -for return all the passwords previously saved by user. +It is use by passcodes app to post the data of single password entity that needs to be saved by server. -**Request**: -will be a typical get request with no query or path or any other parameters. +**Responsible**: -**Responses**: -- 200 OK - In ideal cases the api should, return all the passwords. +for saving the password entity on backend, this should return the saved password entity's id. -**Note**: -The authentication, pagination or query parameters based filter is not required currently, As it is just a prototyping api spec but we will add them later... if you can add there support from now itself. but should not be required. -### Post /passwords - -It is use by passcodes app to post the data of single password entity that needs to be saved by server. +**Request**: -**Responsible**: -for saving the password entity and also should return the password entity with id saved. +will be a post request with just a body. -**Request**: -will be a typical a post request with just a body. ```json { "domain": "string", @@ -43,66 +31,177 @@ will be a typical a post request with just a body. ``` **Responses**: + - 201 CREATED - In ideal cases the api should, return the id in response body. + + In ideal cases the api should, return the id in response body. + + ```json + { + "id": "int" + "domain": "string", + "username": "string", + "password": "string", + "notes": "string", + "created-at": "string", + "updated-at": "string", + }, + ``` **Note**: -We don't care for duplicates currently, we in next specification version will provide a way, to let you send a specific status code when there is duplicates. it would be probably 400 BAD REQUEST. -### Get /passwords/:id +We don't care for duplicates atleast for now. We in next specification version will provide a way, +To let you send a specific status code when there is duplicates. It would be probably 400 BAD REQUEST. + +--- + +### GET /passwords + +It is use by passcodes app to get all the passwords previously saved by user. + +**Responsible**: + +for retriving all the passwords previously saved by user from backend. + +**Request**: + +will be a GET request with no query, path or any other parameters. + +**Responses**: + +- 200 OK + + In ideal cases the api should, return all the passwords. + + ```json + [ + { + "id": "int", + "domain": "string", + "username": "string", + "passwords": "string", + "notes": "string", + "created-at": "string", + "updated-at": "string", + }, + .... + ] + ``` + +**Note**: -It is used by passcodes app to get data of a specific single passwords data entity. +The authentication, pagination or query parameters based filter is not required currently. +As this api specification is just for prototyping, but we will later add this features... +If you can add there support from now itself then its good. +but be sure that our app may still expect this api specification, without any extra fancy feaures. + +--- + +### GET /passwords/:id + +It is used by passcodes app to retrive single passwords entity. **Responsible**: -for getting the single password entity by its id. + +for getting the a password entity by its id. **Request**: -will be typically a get request with a `:id` as a path parameter. + +will be a get request with a `:id` as a path parameter. **Responses**: + - 200 OK - In ideal cases the api should, return the password entity in response body. + + In ideal cases the api should, return the password entity in response body. + + ```json + { + "id": "int", + "domain": "string", + "username": "string", + "passwords": "string", + "notes": "string", + "created-at": "string", + "updated-at": "string", + }, + ``` + + - 404 NOT FOUND - In cases where resource(password) not exist, the api should return 404. + + In cases where resource(password) not exist, the api should return 404. **Note**: -We don't care for duplicates currently, we in next specification version will provide a way, to let you send a specific status code when there is duplicates. it would be probably 400 BAD REQUEST. -### Put /passwords/:id +... -It is used by passcodes app to update the data of a specific single passwords data entity. +--- -**Responsible**: -for updating the single password entity by its id. +### PUT /passwords/:id + +It is used by passcodes app to update the data of a specific password entity. + +**Responsible**: + +for updating the password entity by its id. **Request**: + will be a put request with a `:id` as a path parameter. **Responses**: + - 200 OK - In ideal cases the api should, return the updated password entity in response body. + + In ideal cases the api should, return the updated password entity in response body. + + ```json + { + "id": "int", + "domain": "string", + "username": "string", + "passwords": "string", + "notes": "string", + "created-at": "string", + "updated-at": "string", + }, + ``` + - 404 NOT FOUND - In cases where resource(password) not exist, the api should return 404. + + In cases where resource(password) not exist, the api should return 404. + **Note**: -.... -### Delete /passwords/:id +... -It is used by passcodes app to delete data of a specific single passwords data entity. +--- + +### DELETE /passwords/:id + +It is used by passcodes app to delete data of a specific password entity. + +**Responsible**: -**Responsible**: for deleting the single password entity by its id. **Request**: + will be a delete request with a `:id` as a path parameter. **Responses**: + - 204 NO CONTENT - In ideal cases the api should, return no body. + + In ideal cases the api should, return no body. + - 404 NOT FOUND - In cases where resource(password) not exist, the api should return 404. + + In cases where resource(password) not exist, the api should return 404. **Note**: + .... From f23ab97365d5914bc049d2575f86215c809d989a Mon Sep 17 00:00:00 2001 From: Jeel Dobariya Date: Sat, 25 Oct 2025 10:26:39 +0530 Subject: [PATCH 3/3] docs: add links in readme --- custom-backend-docs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-backend-docs/README.md b/custom-backend-docs/README.md index 40b6b1b..ceaf77f 100644 --- a/custom-backend-docs/README.md +++ b/custom-backend-docs/README.md @@ -38,7 +38,7 @@ Yes, for custom backend that wanna stay forward-backward compatible. This will r --- -========== COMING SOON ========== +## Table Of Content -Further infomation about the api interface will be avaliable soon. +- [v0](specs/v0/spec.md)