{"id":18773731,"url":"https://github.com/ismaelvr1999/cipherguard_api","last_synced_at":"2026-04-18T17:02:44.840Z","repository":{"id":253700503,"uuid":"815762261","full_name":"ismaelvr1999/CipherGuard_API","owner":"ismaelvr1999","description":"CipherGuard API securely stores and manages passwords, passports, and credit/debit card information.","archived":false,"fork":false,"pushed_at":"2024-08-18T19:56:10.000Z","size":214,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T02:46:12.072Z","etag":null,"topics":["api-rest","backend","bcrypt","expressjs","javascript","mysql2","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ismaelvr1999.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-16T04:30:08.000Z","updated_at":"2024-08-18T20:16:18.000Z","dependencies_parsed_at":"2024-08-18T22:28:47.516Z","dependency_job_id":"dbd98560-396a-41cd-8ee1-a13def5fef42","html_url":"https://github.com/ismaelvr1999/CipherGuard_API","commit_stats":null,"previous_names":["ismaelvr1999/cipherguard_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ismaelvr1999/CipherGuard_API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelvr1999%2FCipherGuard_API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelvr1999%2FCipherGuard_API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelvr1999%2FCipherGuard_API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelvr1999%2FCipherGuard_API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ismaelvr1999","download_url":"https://codeload.github.com/ismaelvr1999/CipherGuard_API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismaelvr1999%2FCipherGuard_API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31976805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T16:27:12.723Z","status":"ssl_error","status_checked_at":"2026-04-18T16:27:11.140Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-rest","backend","bcrypt","expressjs","javascript","mysql2","nodejs"],"created_at":"2024-11-07T19:35:17.250Z","updated_at":"2026-04-18T17:02:44.811Z","avatar_url":"https://github.com/ismaelvr1999.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CipherGuard REST API\nCipherGuard API securely stores and manages passwords, passports, and credit/debit card information.\n# Table of Contents 📚\n- [Description 📝](#Description-)\n  - [Author](#Author)\n- [Technologies Used 🔧](#Technologies-Used-)\n- [Installation 📦](#Installation-)\n- [API Reference 📑](#API-Reference)\n  - [User Login](#User-Login)\n  - [User Sign-Up](#User-Sign-Up)\n  - [Get User Information](#Get-User-Information)\n  - [Verify Token](#Verify-Token)\n  - [Create Website Account](#Create-Website-Account)\n  - [Get Website Account by Page ID](#Get-Website-Account-by-Page-ID)\n  - [Update Website Account by Page ID](#Update-Website-Account-by-Page-ID)\n  - [Delete Website Account by Page ID](#Delete-Website-Account-by-Page-ID)\n  - [Get Total Number of Website Accounts](#Get-Total-Number-of-Website-Accounts)\n  - [Retrieve Cards](#Retrieve-Cards)\n  - [Create a New Card](#Create-a-New-Card)\n  - [Retrieve Total Number of Cards](#Retrieve-Total-Number-of-Cards)\n  - [Update, Retrieve, and Delete a Specific Card](#Update-Retrieve-and-Delete-a-Specific-Card)\n  - [Retrieve All Passports and Create a New Passport](#Retrieve-All-Passports-and-Create-a-New-Passport) \n  - [Retrieve, Update, and Delete a Specific Passport](#Retrieve-Update-and-Delete-a-Specific-Passport)\n  - [Retrieve Total Number of Passports](#Retrieve-Total-Number-of-Passports)\n\n\n# Description 📝\n\nThe CipherGuard API offers a comprehensive and secure solution for managing sensitive information, including account passwords, passports, and credit/debit card details. \n\n## Author\n\n- [@ismaelvr1999](https://www.github.com/ismaelvr1999)\n# Technologies Used 🔧\n\nThis project utilizes the following technologies:\n\n- **Node.js**: A powerful JavaScript runtime for building scalable network applications. 🌐\n- **JavaScript**: The core language used for dynamic, client-side functionality. 📜\n- **Express.js**: A flexible web application framework for Node.js, facilitating API creation. 🚀\n- **Swagger**: For API documentation and interactive API exploration. 📖\n- **MySQL2**: A robust relational database management system for storing data securely. 🗄️\n- **Bcrypt**: A library for hashing passwords to enhance security. 🔒\n- **CORS**: Middleware to handle Cross-Origin Resource Sharing, enabling secure resource sharing between different origins. 🌍\n# Installation 📦\n\nTo get started with this API, follow these steps:\n\n1. **Clone the repository.**\n   ```bash\n   git clone https://github.com/ismaelvr1999/CipherGuard_API.git\n\n2. **Install dependencies.**\n   ```bash\n   cd  CipherGuard_API\n   npm install\n\n3. **Set up environment variables.**\nCreate a .env file in the root of the project and add the following variables:\n   ```env\n    DB_USER=your_database_user\n    DB_HOST=your_database_host\n    DB_PASSWORD=your_database_password\n    DB_NAME=your_database_name\n    DB_PORT=your_database_port\n\n    PORT=your_application_port\n    BASE_URL=/api/\n    NODE_ENV=your_environment (e.g., development, production)\n    SALT_ROUNDS=your_salt_rounds\n    SECRET_KEY=your_secret_key\n4. **Start the server.**\n    ```bash\n    npm run dev\n   \n# API Reference 📑\n## User Login\n\n### HTTP Request\n\n**POST** `/login`\n\n### Summary\n\nAllows a user to log in using their email and password.\n\n### Tags\n\n- Login\n\n### Request Body\n\n| Field    | Type   | Description            | Example           |\n|----------|--------|------------------------|-------------------|\n| email    | string | Required. User email   | user@example.com  |\n| password | string | Required. User password| your_password     |\n\n### Responses\n\n| Status Code | Description                                  | Schema                                      |\n|-------------|----------------------------------------------|---------------------------------------------|\n| 200         | Login successful.                          | [Login Successful Response Schema](#login-successful-response-schema) |\n| 400         | Bad request.                                | [Error Response Schema](#error-response-schema) |\n| 401         | Invalid credentials.                        | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                      | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Login Successful Response Schema\n\n| Field      | Type   | Description                                | Example                       |\n|------------|--------|--------------------------------------------|-------------------------------|\n| status     | integer| HTTP status code                          | 200                           |\n| message    | string | Response message                          | Standard response for successful HTTP requests. |\n| data       | object | Contains login details                    |                               |\n| └ token    | string | Authentication token                       | your_auth_token               |\n\n\n## User Sign-Up\n\n### HTTP Request\n\n**POST** `/user/sign-up`\n\n### Summary\n\nAllows a user to create a new account using their first name, last name, email, and password.\n\n### Tags\n\n- User\n\n### Request Body\n\n| Field      | Type   | Description                  | Example            |\n|------------|--------|------------------------------|--------------------|\n| firstName  | string | Required. User's first name  | John               |\n| lastName   | string | Required. User's last name   | Doe                |\n| email      | string | Required. User's email       | user@example.com   |\n| password   | string | Required. User's password    | your_password      |\n\n### Responses\n\n| Status Code | Description                                  | Schema                                      |\n|-------------|----------------------------------------------|---------------------------------------------|\n| 201         | User created successfully.                  | [User Created Response Schema](#user-created-response-schema) |\n| 400         | Bad request.                                | [Error Response Schema](#error-response-schema) |\n| 500         | Internal server error.                      | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n### User Created Response Schema\n\n| Field      | Type   | Description                                          | Example                     |\n|------------|--------|------------------------------------------------------|-----------------------------|\n| status     | integer| HTTP status code                                    | 201                         |\n| message    | string | Response message                                    | The request has been fulfilled, resulting in the creation of a new resource. |\n| data       | object | Contains user details                               |                             |\n| └ firstName| string | User's first name                                   | First_name                        |\n| └ lastName | string | User's last name                                    | last_name                      |\n| └ email    | string | User's email address                                | new_user@gmail.com        |\n\n## Get User Information\n\n### HTTP Request\n\n**GET** `/user`\n\n### Summary\n\nRetrieves the user's information using the provided authorization token.\n\n### Tags\n\n- User\n\n### Parameters\n\n| Name          | In     | Type   | Description                      | Example                 |\n|---------------|--------|--------|----------------------------------|-------------------------|\n| Authorization | header | string | Bearer token for authorization.  | Bearer your_token_here  |\n\n### Responses\n\n| Status Code | Description                                  | Schema                                      |\n|-------------|----------------------------------------------|---------------------------------------------|\n| 200         | User information retrieved successfully.    | [User Information Response Schema](#user-information-response-schema) |\n| 401         | Invalid credentials.                        | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                      | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### User Information Response Schema\n\n| Field      | Type   | Description                       | Example                  |\n|------------|--------|-----------------------------------|--------------------------|\n| status     | integer| HTTP status code                 | 200                      |\n| message    | string | Response message                 | User found               |\n| data       | object | Contains user details            |                          |\n| └ user_id  | string | User's unique identifier         | user_123                 |\n| └ first_name | string | User's first name               | first_name                     |\n| └ last_name | string | User's last name                | last_name                      |\n| └ email    | string | User's email address             | user@example.com     |\n\n## Verify Token\n\n### HTTP Request\n\n**POST** `/verify-token`\n\n### Summary\n\nVerifies the provided authorization token.\n\n### Tags\n\n- Verify Token\n\n### Parameters\n\n| Name          | In     | Type   | Description                      | Example                 |\n|---------------|--------|--------|----------------------------------|-------------------------|\n| Authorization | header | string | Bearer token for verification.   | Bearer your_token_here  |\n\n### Responses\n\n| Status Code | Description                               | Schema                                          |\n|-------------|-------------------------------------------|-------------------------------------------------|\n| 200         | Token verified successfully.             | [Token Verified Response Schema](#token-verified-response-schema) |\n| 401         | Unauthorized. Token has expired.         | [Token Expired Response Schema](#token-expired-response-schema) |\n| 500         | Internal server error.                   | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Token Verified Response Schema\n\n| Field      | Type   | Description                             | Example                 |\n|------------|--------|-----------------------------------------|-------------------------|\n| status     | integer| HTTP status code                       | 200                     |\n| message    | string | Response message                       | valid token             |\n| data       | object | Contains token validity information     |                         |\n| └ validity | boolean| Whether the token is valid              | true     \n\n## Create Website Account\n\n### HTTP Request\n\n**POST** `/websites-accounts`\n\n### Summary\n\nCreates a new website account with the provided details.\n\n### Tags\n\n- Websites-Accounts\n\n### Parameters\n\n| Name       | In    | Type   | Description                     | Example                 |\n|------------|-------|--------|---------------------------------|-------------------------|\n| Authorization | header | string | Bearer token for authorization. | Bearer your_token_here  |\n| body       | body  | object | Account details for creation.   |                         |\n\n### Request Body\n\n| Field       | Type   | Description                      | Example          |\n|-------------|--------|----------------------------------|------------------|\n| page_name   | string | Name of the page or website      | MyPage           |\n| email       | string | Email associated with the account | user@example.com|\n| category    | string | Category of the website account  | Blog             |\n| commentary  | string | Additional comments              | My first website |\n| password    | string | Password for the account         | your_password    |\n| user_name   | string | Username for the account         | user123          |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 201         | Website account created successfully.         | [Website Account Created Response Schema](#website-account-created-response-schema) |\n| 400         | Bad request.                                  | [Error Response Schema](#error-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Website Account Created Response Schema\n\n| Field       | Type   | Description                         | Example              |\n|-------------|--------|-------------------------------------|----------------------|\n| status      | integer| HTTP status code                   | 201                  |\n| message     | string | Response message                   | The request has been fulfilled, resulting in the creation of a new resource. |\n| data        | object | Contains account details            |                      |\n| └ page_name | string | Name of the page or website         | MyPage               |\n| └ email     | string | Email associated with the account   | user@example.com    |\n| └ category  | string | Category of the website account     | Blog                 |\n| └ commentary| string | Additional comments                 | My first website     |\n\n## Get Website Account by Page ID\n\n### HTTP Request\n\n**GET** `/websites-accounts/{page_id}`\n\n### Summary\n\nRetrieves the website account associated with the provided page ID.\n\n### Tags\n\n- Websites-Accounts\n\n### Parameters\n\n| Name         | In    | Type   | Description                                | Example                 |\n|--------------|-------|--------|--------------------------------------------|-------------------------|\n| Authorization| header| string | Bearer token for authorization.            | Bearer your_token_here  |\n| page_id      | path  | string | Unique identifier for the website account. | page_123               |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 200         | Website account retrieved successfully.        | [Website Account Retrieved Response Schema](#website-account-retrieved-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Website Account Retrieved Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Website account retrieved successfully. |\n| data               | object | Contains details of the website account    |                        |\n| └ page_id          | string | Unique identifier for the page/account      | page_123               |\n| └ user_id          | string | Unique identifier for the user              | user_456               |\n| └ page_name        | string | Name of the page or website                 | MyPage                 |\n| └ email            | string | Email associated with the account           | user@example.com      |\n| └ category         | string | Category of the website account             | Blog                   |\n| └ commentary       | string | Additional comments                         | My first website       |\n| └ creation_date    | string | Date and time when the account was created  | 2024-01-01T12:00:00Z |\n| └ last_modification | string | Date and time when the account was last modified | 2024-01-10T12:00:00Z |\n| └ password         | string | Password for the account                    | your_password          |\n| └ user_name        | string | Username for the account                    | user123                |\n\n## Update Website Account by Page ID\n\n### HTTP Request\n\n**PUT** `/websites-accounts/{page_id}`\n\n### Summary\n\nUpdates the website account associated with the provided page ID.\n\n### Tags\n\n- Websites-Accounts\n\n### Parameters\n\n| Name         | In    | Type   | Description                                | Example                 |\n|--------------|-------|--------|--------------------------------------------|-------------------------|\n| Authorization| header| string | Bearer token for authorization.            | Bearer your_token_here  |\n| page_id      | path  | string | Unique identifier for the website account. | page_123               |\n| body         | body  | object | Details for updating the website account.  |                         |\n\n### Request Body\n\n| Field       | Type   | Description                      | Example          |\n|-------------|--------|----------------------------------|------------------|\n| page_name   | string | Name of the page or website      | UpdatedPage      |\n| email       | string | Email associated with the account | updated@example.com|\n| category    | string | Category of the website account  | UpdatedCategory  |\n| commentary  | string | Additional comments              | Updated commentary|\n| password    | string | Password for the account         | updated_password |\n| user_name   | string | Username for the account         | updated_user123  |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 200         | Website account updated successfully.         | [Website Account Updated Response Schema](#website-account-updated-response-schema) |\n| 400         | Bad request. No rows matched or changed.      | [Bad Request Response Schema](#bad-request-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Website Account Updated Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Website account updated successfully. |\n| data               | object | Contains details about the update operation |                        |\n| └ affectedRows     | integer| Number of affected rows                    | 1                      |\n\n## Delete Website Account by Page ID\n\n### HTTP Request\n\n**DELETE** `/websites-accounts/{page_id}`\n\n### Summary\n\nDeletes the website account associated with the provided page ID.\n\n### Tags\n\n- Websites-Accounts\n\n### Parameters\n\n| Name         | In    | Type   | Description                                | Example                 |\n|--------------|-------|--------|--------------------------------------------|-------------------------|\n| Authorization| header| string | Bearer token for authorization.            | Bearer your_token_here  |\n| page_id      | path  | string | Unique identifier for the website account. | page_123               |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 200         | Website account deleted successfully.         | [Website Account Deleted Response Schema](#website-account-deleted-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Website Account Deleted Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Website account deleted successfully. |\n| data               | object | Contains details about the delete operation |                        |\n| └ affectedRows     | integer| Number of affected rows                    | 1                      |\n\n## Get Total Number of Website Accounts\n\n### HTTP Request\n\n**GET** `/websites-accounts/total`\n\n### Summary\n\nRetrieves the total number of website accounts associated with the authenticated user.\n\n### Tags\n\n- Websites-Accounts\n\n### Parameters\n\n| Name         | In    | Type   | Description                                | Example                 |\n|--------------|-------|--------|--------------------------------------------|-------------------------|\n| Authorization| header| string | Bearer token for authorization.            | Bearer your_token_here  |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 200         | Total number of website accounts retrieved successfully. | [Total Number Retrieved Response Schema](#total-number-retrieved-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Total Number Retrieved Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Total number of website accounts retrieved successfully. |\n| data               | object | Contains the total number of website accounts |                        |\n| └ total            | integer| Total number of website accounts           | 42                     |\n\n## Retrieve Cards\n\n### HTTP Request\n\n**GET** `/cards`\n\n### Summary\n\nRetrieves a list of cards associated with the authenticated user.\n\n### Tags\n\n- Cards\n\n### Parameters\n\n| Name         | In    | Type   | Description                                | Example                 |\n|--------------|-------|--------|--------------------------------------------|-------------------------|\n| Authorization| header| string | Bearer token for authorization.            | Bearer your_token_here  |\n| search        | query | string | Search term to filter cards.               | Visa                    |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 200         | Cards retrieved successfully.                  | [Cards Retrieved Response Schema](#cards-retrieved-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Cards Retrieved Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Cards retrieved successfully. |\n| data               | array  | List of cards                              |                        |\n| └ card_id          | string | Unique identifier for the card             | card_123               |\n| └ user_id          | string | Unique identifier for the user             | user_456               |\n| └ type             | string | Type of the card (e.g., credit_card, debit_card) | credit_card            |\n| └ cardholder_name  | string | Name of the cardholder                     | John Doe               |\n| └ expiration_date  | string | Expiration date of the card in ISO 8601 format | 2025-12-31T00:00:00Z   |\n| └ cvv              | string | CVV code of the card                        | 123                    |\n| └ issuer           | string | Issuer of the card (e.g., bank name)       | Bank of Example        |\n| └ commentary       | string | Additional comments                        |                        |\n| └ create_date      | string | Date the card was created in ISO 8601 format | 2023-01-01T00:00:00Z   |\n| └ last_modification| string | Date the card was last modified in ISO 8601 format | 2023-02-01T00:00:00Z   |\n\n## Create a New Card\n\n### HTTP Request\n\n**POST** `/cards`\n\n### Summary\n\nCreates a new card associated with the authenticated user.\n\n### Tags\n\n- Cards\n\n### Parameters\n\n| Name         | In    | Type   | Description                                | Example                 |\n|--------------|-------|--------|--------------------------------------------|-------------------------|\n| Authorization| header| string | Bearer token for authorization.            | Bearer your_token_here  |\n| body         | body  | object | Details of the card to create.             |                         |\n\n### Request Body Schema\n\n| Field             | Type   | Description                                           | Example                |\n|-------------------|--------|-------------------------------------------------------|------------------------|\n| type              | string | Type of the card (e.g., credit_card, debit_card)    | credit_card            |\n| cardholder_name   | string | Name of the cardholder                               | John Doe               |\n| expiration_date   | string | Expiration date of the card in YYYY-MM-DD format     | 2025-12-31             |\n| cvv               | string | CVV code of the card                                | 123                    |\n| issuer            | string | Issuer of the card (e.g., bank name)                | Bank of Example        |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 201         | Card created successfully.                    | [Card Created Response Schema](#card-created-response-schema) |\n| 400         | Bad request                                    | [Bad Request Response Schema](#bad-request-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Card Created Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 201                    |\n| message            | string | Response message                           | Card created successfully. |\n| data               | object | No additional data returned                | null                   |\n\n## Retrieve Total Number of Cards\n\n### HTTP Request\n\n**GET** `/cards/total`\n\n### Summary\n\nRetrieves the total number of cards associated with the authenticated user.\n\n### Tags\n\n- Cards\n\n### Parameters\n\n| Name         | In    | Type   | Description                                | Example                 |\n|--------------|-------|--------|--------------------------------------------|-------------------------|\n| Authorization| header| string | Bearer token for authorization.            | Bearer your_token_here  |\n\n### Responses\n\n| Status Code | Description                                    | Schema                                      |\n|-------------|------------------------------------------------|---------------------------------------------|\n| 200         | Total number of cards retrieved successfully.  | [Total Cards Retrieved Response Schema](#total-cards-retrieved-response-schema) |\n| 401         | Invalid credentials.                          | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                        | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Total Cards Retrieved Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Total number of cards retrieved successfully. |\n| data               | object | Contains the total number of cards          |                        |\n| └ total            | integer| Total number of cards                      | 42                     |\n\n## Update, Retrieve, and Delete a Specific Card\n\n### HTTP Request\n\n**PUT** `/cards/{card_id}`  \n**GET** `/cards/{card_id}`  \n**DELETE** `/cards/{card_id}`\n\n### Summary\n\n- **PUT**: Updates the details of an existing card associated with the authenticated user.\n- **GET**: Retrieves the details of a specific card associated with the authenticated user.\n- **DELETE**: Deletes a specific card associated with the authenticated user.\n\n### Tags\n\n- Cards\n\n### Parameters\n\n| Name         | In    | Type   | Description                                    | Example              |\n|--------------|-------|--------|------------------------------------------------|----------------------|\n| Authorization| header| string | Bearer token for authorization.                | Bearer your_token_here |\n| card_id       | path  | string | Unique identifier of the card.                 | 12345                |\n| body (for PUT)| body  | object | Card details to be updated.                    | [Card Details Schema](#card-details-schema) |\n\n### Responses\n\n#### PUT - Update Card\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Card updated successfully.              | [Card Updated Response Schema](#card-updated-response-schema) |\n| 400         | Bad request                             | [Bad Request Response Schema](#bad-request-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n#### GET - Retrieve Card\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Card retrieved successfully.            | [Card Retrieved Response Schema](#card-retrieved-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n#### DELETE - Delete Card\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Card deleted successfully.              | [Card Deleted Response Schema](#card-deleted-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Card Details Schema (for PUT)\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| type               | string | Type of the card (e.g., credit_card).       | credit_card            |\n| cardholder_name    | string | Name of the cardholder.                     | John Doe               |\n| expiration_date    | string | Expiration date of the card (YYYY-MM-DD).   | 2025-12-31            |\n| cvv                | string | CVV code of the card.                       | 123                    |\n| issuer             | string | Issuer of the card (e.g., bank name).       | Example Bank           |\n\n#### Card Updated Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Card updated successfully. |\n| data               | object | Contains affected rows information          |                        |\n| └ affectedRows     | integer| Number of rows affected by the update      | 1                      |\n\n#### Card Retrieved Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| card_id            | string | Unique identifier of the card.              | 12345                  |\n| user_id            | string | Unique identifier of the user.              | user_6789              |\n| type               | string | Type of the card (e.g., credit_card).       | credit_card            |\n| cardholder_name    | string | Name of the cardholder.                     | John Doe               |\n| expiration_date    | string | Expiration date of the card.                | 2025-12-31            |\n| cvv                | string | CVV code of the card.                       | 123                    |\n| issuer             | string | Issuer of the card (e.g., bank name).       | Example Bank           |\n| commentary         | string | Additional notes or commentary.             |                        |\n| create_date        | string | Date the card was created.                  | 2023-01-15T10:00:00Z  |\n| last_modification  | string | Date the card details were last modified.   | 2024-01-15T10:00:00Z  |\n\n#### Card Deleted Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Card deleted successfully. |\n| data               | object | Contains affected rows information          |                        |\n| └ affectedRows     | integer| Number of rows affected by the deletion    | 1                      |\n\n## Retrieve All Passports and Create a New Passport\n\n### HTTP Request\n\n**GET** `/passports`  \n**POST** `/passports`\n\n### Summary\n\n- **GET**: Retrieves a list of all passports associated with the authenticated user.\n- **POST**: Creates a new passport associated with the authenticated user.\n\n### Tags\n\n- Passports\n\n### Parameters\n\n#### GET - Retrieve All Passports\n\n| Name         | In    | Type   | Description                                    | Example              |\n|--------------|-------|--------|------------------------------------------------|----------------------|\n| Authorization| header| string | Bearer token for authorization.                | Bearer your_token_here |\n| search        | query | string | Search term to filter passports.               | \"John Doe\"           |\n\n#### POST - Create a New Passport\n\n| Name         | In    | Type   | Description                                    | Example              |\n|--------------|-------|--------|------------------------------------------------|----------------------|\n| Authorization| header| string | Bearer token for authorization.                | Bearer your_token_here |\n| body          | body  | object | Passport details to be created.                | [Passport Details Schema](#passport-details-schema) |\n\n### Responses\n\n#### GET - Retrieve All Passports\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Passports retrieved successfully.        | [Passports Retrieved Response Schema](#passports-retrieved-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n#### POST - Create a New Passport\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Passport created successfully.          | [Passport Created Response Schema](#passport-created-response-schema) |\n| 400         | Bad request                             | [Bad Request Response Schema](#bad-request-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Passport Details Schema (for POST)\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| first_name         | string | First name of the passport holder.         | John                   |\n| last_name          | string | Last name of the passport holder.          | Doe                    |\n| passport_number    | string | Unique passport number.                    | A1234567               |\n| nationality        | string | Nationality of the passport holder.        | American               |\n| date_of_birth      | string | Date of birth of the passport holder (YYYY-MM-DD). | 1990-01-01          |\n| issue_date         | string | Date the passport was issued (YYYY-MM-DD). | 2020-01-01            |\n| expiration_date    | string | Expiration date of the passport (YYYY-MM-DD). | 2030-01-01            |\n| status             | string | Current status of the passport (e.g., valid, expired). | valid                |\n| commentary         | string | Additional notes or commentary.            |                        |\n\n#### Passports Retrieved Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Passports retrieved successfully. |\n| data               | array  | List of passport objects                    | [Array of Passport Objects](#passport-object-schema) |\n\n#### Passport Object Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| passport_id        | string | Unique identifier of the passport.          | 123456                 |\n| user_id            | string | Unique identifier of the user.              | user_7890              |\n| first_name         | string | First name of the passport holder.         | John                   |\n| last_name          | string | Last name of the passport holder.          | Doe                    |\n| passport_number    | string | Passport number.                           | A1234567               |\n| nationality        | string | Nationality of the passport holder.        | American               |\n| date_of_birth      | string | Date of birth of the passport holder.      | 1990-01-01            |\n| issue_date         | string | Date the passport was issued.              | 2020-01-01            |\n| expiration_date    | string | Expiration date of the passport.           | 2030-01-01            |\n| status             | string | Current status of the passport.            | valid                  |\n| commentary         | string | Additional notes or commentary.            |                        |\n| create_date        | string | Date the passport record was created.      | 2023-01-15T10:00:00Z  |\n| last_modification  | string | Date the passport record was last modified. | 2024-01-15T10:00:00Z  |\n\n#### Passport Created Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Passport created successfully. |\n| data               | object | Contains total passports information        |                        |\n| └ total            | integer| Total number of passports after creation   | 5                      |\n\n## Retrieve, Update, and Delete a Specific Passport\n\n### HTTP Request\n\n- **GET** `/passports/{passport_id}`\n- **PUT** `/passports/{passport_id}`\n- **DELETE** `/passports/{passport_id}`\n\n### Summary\n\n- **GET**: Retrieves details of a specific passport associated with the authenticated user.\n- **PUT**: Updates the details of an existing passport associated with the authenticated user.\n- **DELETE**: Deletes the passport associated with the authenticated user.\n\n### Tags\n\n- Passports\n\n### Parameters\n\n#### GET - Retrieve a Specific Passport\n\n| Name          | In    | Type   | Description                                    | Example              |\n|---------------|-------|--------|------------------------------------------------|----------------------|\n| Authorization | header| string | Bearer token for authorization.                | Bearer your_token_here |\n| passport_id   | path  | string | Unique identifier of the passport to be retrieved. | 123456              |\n\n#### PUT - Update an Existing Passport\n\n| Name          | In    | Type   | Description                                    | Example              |\n|---------------|-------|--------|------------------------------------------------|----------------------|\n| Authorization | header| string | Bearer token for authorization.                | Bearer your_token_here |\n| passport_id   | path  | string | Unique identifier of the passport to be updated. | 123456              |\n| body          | body  | object | Updated passport details.                     | [Passport Details Schema](#passport-details-schema) |\n\n#### DELETE - Delete an Existing Passport\n\n| Name          | In    | Type   | Description                                    | Example              |\n|---------------|-------|--------|------------------------------------------------|----------------------|\n| Authorization | header| string | Bearer token for authorization.                | Bearer your_token_here |\n| passport_id   | path  | string | Unique identifier of the passport to be deleted. | 123456              |\n\n### Responses\n\n#### GET - Retrieve a Specific Passport\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Passport retrieved successfully.        | [Passport Retrieved Response Schema](#passport-retrieved-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n#### PUT - Update an Existing Passport\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Passport updated successfully.          | [Passport Updated Response Schema](#passport-updated-response-schema) |\n| 400         | Bad request                             | [Bad Request Response Schema](#bad-request-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n#### DELETE - Delete an Existing Passport\n\n| Status Code | Description                             | Schema                                            |\n|-------------|-----------------------------------------|---------------------------------------------------|\n| 200         | Passport deleted successfully.          | [Passport Deleted Response Schema](#passport-deleted-response-schema) |\n| 401         | Invalid credentials.                    | [Invalid Credentials Response Schema](#invalid-credentials-response-schema) |\n| 500         | Internal server error.                  | [Internal Server Error Response Schema](#internal-server-error-response-schema) |\n\n### Response Schemas\n\n#### Passport Details Schema (for PUT)\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| first_name         | string | First name of the passport holder.         | John                   |\n| last_name          | string | Last name of the passport holder.          | Doe                    |\n| passport_number    | string | Unique passport number.                    | A1234567               |\n| nationality        | string | Nationality of the passport holder.        | American               |\n| date_of_birth      | string | Date of birth of the passport holder (YYYY-MM-DD). | 1990-01-01          |\n| issue_date         | string | Date the passport was issued (YYYY-MM-DD). | 2020-01-01            |\n| expiration_date    | string | Expiration date of the passport (YYYY-MM-DD). | 2030-01-01            |\n| status             | string | Current status of the passport (e.g., valid, expired). | valid                |\n| commentary         | string | Additional notes or commentary.            |                        |\n\n#### Passport Retrieved Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Passport retrieved successfully. |\n| data               | object | Details of the passport                    | [Passport Object Schema](#passport-object-schema) |\n\n#### Passport Updated Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Passport updated successfully. |\n| data               | object | Contains update information                 |                        |\n| └ affectedRows     | integer| Number of rows affected by the update.     | 1                      |\n\n#### Passport Deleted Response Schema\n\n| Field              | Type   | Description                                 | Example                |\n|--------------------|--------|---------------------------------------------|------------------------|\n| status             | integer| HTTP status code                           | 200                    |\n| message            | string | Response message                           | Passport deleted successfully. |\n| data               | object | Contains deletion information               |                        |\n| └ affectedRows     | integer| Number of rows affected by the deletion.   | 1                      |\n\n## Retrieve Total Number of Passports\n\n### HTTP Request\n\n- **GET** `/passports/total`\n\n### Summary\n\nRetrieves the total count of all passports associated with the authenticated user.\n\n### Tags\n\n- Passports\n\n### Parameters\n\n| Name          | In    | Type   | Description                                    | Example              |\n|---------------|-------|--------|------------------------------------------------|----------------------|\n| Authorization | header| string | Bearer token for authorization.                | Bearer your_token_here |\n\n### Responses\n\n#### 200 - Total Number of Passports Retrieved Successfully\n\n| Field       | Type   | Description                                      | Example   |\n|-------------|--------|--------------------------------------------------|-----------|\n| status      | integer| HTTP status code                                | 200       |\n| message     | string | Response message                                | Total number of passports retrieved successfully. |\n| data        | object | Contains the total count of passports           |           |\n| └ total     | integer| Total number of passports associated with the user. | 5         |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismaelvr1999%2Fcipherguard_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fismaelvr1999%2Fcipherguard_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismaelvr1999%2Fcipherguard_api/lists"}