- Project Description
- Status of work
- Features
- API Documentation
- Enviroment Variables
- How to run
- Build with
- Contact
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
- Sign In and Sign Up account
- Create/Get/Delete Credentials
- Create/Get/Delete Notes
- Create/Get/Delete Networks
- Create/Get/Delete Bank Cards
POST /auth/signup
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"
}
POST /auth/signin
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 /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 /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 /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"
}
GET /notes/${userId}
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 /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 /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"
}
GET /cards/${userId}
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 /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 /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"
}
GET /wifis/${userId}
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 /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 /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