Then, navigate to the project folder and run the following command:
npm install
Finally, start the server:
npm start
You can now access the API's endpoints by navigating to http://localhost:5000/ or to the deployed URL https:/drivenpass-api-project.herokuapp.com/. If needed, import one of the provided Request Collections files into your preferred client and test the endpoints!
ps.: Highly recommend using the request collections to test the API.
API Reference
In this section, you will find the API's endpoints and their respective descriptions, along with the request and response examples, as well as the Prisma models for each entity, that can be used as guide for data formatting. All data is sent and received as JSON.
Models
User model users
id: A unique identifier for each user. serial4
username: The user's username. text
email: The user's email. An email may only be registered once. text
password: The user's password. text
created_at: The date and time when the user was created. timestamp
Note model notes
id: A unique identifier for each note. serial4
label: A label for the note. Each user can only have one note with the same label. Up to 50 characters long. text
content: The content of the note. Up to 1000 characters long. text
user_id: The user that created the note. int4
created_at: The date and time when the note was created. timestamp
Network model networks
id: A unique identifier for each network. serial4
label: A label for the network. Up to 50 characters long. text
password: The network password. The inserted data is encrypted, and decrypted upon query. text
user_id: The user that created the network. int4
created_at: The date and time when the network was created. timestamp
Document model documents
id: A unique identifier for each document. serial4
label: A label for the document. Each user can only have one document with the same label. Up to 50 characters long. text
full_name: The full name found on the document. text
emission_date: The emission date of the document. The date must follow the format DD/MM/YYYY.varhchar(10)
exp_date: The expiration date of the document. The date must follow the format DD/MM/YYYY.varhchar(10)
registry_number : The registry number of the document. text
issuing_agency: The issuing agency of the document. text
type: The document'd type. Must either be 'CNH' or 'RG'. enum
user_id: The user that created the document. int4
created_at: The date and time when the document was created. timestamp
Credential model credentials
id: A unique identifier for each credential. serial4
label: A label for the credential. Each user can only have one credential with the same label. Up to 50 characters long. text
username: The username of the credential. text
password: The password of the credential. The inserted data is encrypted, and decrypted upon query. text``text
url: The URL of the credential. text
user_id: The user that created the credential. int4
created_at: The date and time when the credential was created. timestamp
Credit card model credit_cards
id: A unique identifier for each credit card. serial4
label: A label for the credit card. Each user can only have one credit card with the same label. Up to 50 characters long. text
number: The credit card number. varhchar(16)
exp_date: The credit card expiration date. The date must follow the format MM/YY.varhchar(5)
cvc: The credit card CVC. The inserted data is encrypted, and decrypted upon query. text
password: The credit card password. The inserted data is encrypted, and decrypted upon query. text
owner: The credit card owner. text
is_virtual: Whether the credit card is virtual or not. bool
type: The credit card type. Must either be 'CREDIT', 'DEBIT' or 'BOTH'. enum
user_id: The user that created the credit card. int4
created_at: The date and time when the credit card was created. timestamp