Browsing the internet can be a very fun activity, but at the same time, very dangerous. Numerous studies and surveys (national and international) show that the number of virtual scams continues to grow. Which raises the question: how to protect ourselves?
There are several different ways to protect yourself. It all starts with using different and secure passwords. For a password to be security, it must contain several characters and numbers mixed in, not to mention that the longer it ii, etc.
But how are we going to memorize giant passwords with no semantic meaning? It is to solve this pain that password managers were created! With them,
we only create one “master” password and all other passwords kept secret! So when we need it, just remember the “master” password! DrivenPass is your newest password manager, where you can save data such as: credentials, networks, notes and cards
Body
Type
Description
name
string
Required → user name
email
string
Required → user email
password
string
Required → user password
confirmPassword
string
Required → user password
Password length min(10)
{
"message" : " user created"
}
Body
Type
Description
name
string
Required → user name
email
string
Required → user email
{
"token" : " jasonwebtoken (JWT)"
}
POST /credentials/${userId}/create
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
Body
Type
Description
url
string
Required → credential url
username
string
Required → user name
password
string
Required → credential password
title
string
Required → credential password
{
"message" : " credential created"
}
Get all credentials by userId
GET /credentials/${userId}
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"credentials" : [
{
"id" : 3 ,
"url" : " http://ultimate-certification.name" ,
"username" : " LorenzoFranco_Batista" ,
"password" : " v7GcM" ,
"title" : " Unifei" ,
"createdAt" : " 2022-07-18T19:46:40.846Z" ,
"userId" : 2
}
]
}
Get a specific credential by userId and credentialId
GET /credentials/${userId}/${credentialId}
Params
Type
Description
userId
integer
Required → user Id
credentialId
integer
Required → credential Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"credential" : [
{
"id" : 3 ,
"url" : " http://ultimate-certification.name" ,
"username" : " LorenzoFranco_Batista" ,
"password" : " v7GcM" ,
"title" : " Unifei" ,
"createdAt" : " 2022-07-18T19:46:40.846Z" ,
"userId" : 2
}
]
}
Delete a specific credential by credentialId
DELETE /credentials/${userId}/${credentialId}
Params
Type
Description
userId
integer
Required → user Id
credentialId
integer
Required → credential Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"message" : " credential deleted"
}
POST /notes/${userId}/create
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
Body
Type
Description
title
string
Required → note title
content
string
Required → note content
title length min(50) and max(1000)
{
"message" : " credential created"
}
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"notes" : [
{
"id" : 1 ,
"title" : " consequatur" ,
"content" : " Ratione suscipit nihil quia dolore sunt minima omnis." ,
"createdAt" : " 2022-07-18T13:02:20.263Z" ,
"userId" : 2
}
]
}
Get a specific note by userId and noteId
GET /notes/${userId}/${noteId}
Params
Type
Description
userId
integer
Required → user Id
noteId
integer
Required → note Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"note" : {
"id" : 1 ,
"title" : " consequatur" ,
"content" : " Ratione suscipit nihil quia dolore sunt minima omnis." ,
"createdAt" : " 2022-07-18T13:02:20.263Z" ,
"userId" : 2
}
}
Delete a specific note by noteId
DELETE /notes/${userId}/${notesId}
Params
Type
Description
userId
integer
Required → user Id
noteId
integer
Required → note Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"message" : " Note deleted"
}
POST /cards/${userId}/create
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
Body
Type
Description
title
string
Required → card title
number
string
Required → card number
cardholderName
string
Required → card holder name
securityCode
string
Required → user card security code
expirationDate
string
Required → card expiration date
password
string
Required → card password
isVirtual
boolean
Required → card is virtual
type
string
Required → user type
Number Format: "1111 1111 1111 1111"
Expiration Date Format: "MM/YY"
Password length: 4 and only numeric characters
Security Code length: 3 and only numeric characters
Valid types: [credit, debit, both]
{
"message" : " card created"
}
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"cards" : [
{
"id" : 2 ,
"title" : " vel qui expedita" ,
"number" : " 1089 8176 0498 7127" ,
"cardholderName" : " CARLA H SILVA" ,
"securityCode" : " 206" ,
"expirationDate" : " 07/27" ,
"password" : " 4964" ,
"isVirtual" : false ,
"type" : " both" ,
"createdAt" : " 2022-07-18T13:03:16.959Z" ,
"userId" : 1
}
]
}
Get a specific card by userId and cardId
GET /cards/${userId}/${cardId}
Params
Type
Description
userId
integer
Required → user Id
cardId
integer
Required → card Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"card" : {
"id" : 1 ,
"title" : " sed doloribus qui" ,
"number" : " 3650 3177 0788 8589" ,
"cardholderName" : " CARLA H SILVA" ,
"securityCode" : " 682" ,
"expirationDate" : " 07/27" ,
"password" : " 1265" ,
"isVirtual" : false ,
"type" : " both" ,
"createdAt" : " 2022-07-18T13:03:01.120Z" ,
"userId" : 1
}
}
Delete a specific card by cardId
DELETE /cards/${userId}/${cardId}
Params
Type
Description
userId
integer
Required → user Id
cardId
integer
Required → card Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"message" : " card deleted"
}
POST /wifis/${userId}/create
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
Body
Type
Description
title
string
Required → wifi title
name
string
Required → wifi name
password
string
Required → wifi password
{
"message" : " wifi created"
}
Params
Type
Description
userId
integer
Required → user Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"wifis" : [
{
"id" : 1 ,
"title" : " sit" ,
"name" : " possimus" ,
"password" : " xSxR7jefH4rZ3aB" ,
"createdAt" : " 2022-07-18T13:03:46.190Z" ,
"userId" : 1
}
]
}
Get a specific note by userId and wifiId
GET /wifis/${userId}/${wifiId}
Params
Type
Description
userId
integer
Required → user Id
wifiId
integer
Required → wifi Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"wifi" : {
"id" : 1 ,
"title" : " sit" ,
"name" : " possimus" ,
"password" : " xSxR7jefH4rZ3aB" ,
"createdAt" : " 2022-07-18T13:03:46.190Z" ,
"userId" : 1
}
}
Delete a specific note by wifiId
DELETE /wifis/${userId}/${wifiId}
Params
Type
Description
userId
integer
Required → user Id
wifiId
integer
Required → wifi Id
Headers
Type
Description
Authentication
string
Required → token
Authorization format: Bearer jsonwebtoken
{
"message" : " Wifi deleted"
}
To run this project, you will need to add the following environment variables to your .env file
DATABASE_URL = postgres://UserName:Password@Hostname:5432/DatabaseName
PORT = number #recommended:5000
JWT_SECRET = any string
CRYPTR_SECRET = any string
# Clone this repoository
$ git clone https://github.com/thalesgomest/drivenpass-API.git
# Change to project directory
$ cd cd drivenpass-API
# Install all dependencies
$ npm install
# Start the server
$ npm run start
In this project I learned a lot about how to structure an API with TypeScript and database with Prisma