Coder Social home page Coder Social logo

drivenpass-api's Introduction

Driven Pass API

๐Ÿ“‹ Description

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? This API allows you to securely store your credit card information, websites, wifi credentials, notes and more.


๐Ÿ’ป Technologies and concepts

  • REST APIs
  • JWTs & refresh tokens
  • Node.js
  • TypeScript
  • ORM
  • SQL

๐Ÿš€ Routes

๐Ÿ  Authentication

POST /signup
    - Route to register a new user
    - headers: {}
    - body:{
        "email": "[email protected]",
        "senha": "loremipsum"
}
POST /signin
    - Route to sign in 
    - headers: {}
    - body: {
    "email": "[email protected]",
    "password": "loremipsum"
    }

๐ŸŒ Website credentials

POST /credential (authenticated)
    - Route to create a credential
    - headers: { "Authorization": "Bearer $token" }
    - body: {
    "email": "[email protected]",
    "password": "ipsumlorem",
    "title": "My beautiful instagram credentials",
    "url": "https://instagram.com/
    }
GET /credential/:credentialId (authenticated)
    - Get specific credential of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
GET /credential/= (authenticated)
    - Get all credentials of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
DELETE /credential/:credentialId (authenticated)
    - Delete specific credential of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}

๐Ÿ“ถ Wi-fi credentials

POST /wifi (authenticated)
    - Route to create a wi-fi credential
    - headers: { "Authorization": "Bearer $token" }
    - body: {
    "ssid": "Pergasus",
    "password": "ipsumlorem",
    "title": "Personal hotspot"
    }
GET /wifi/:wifiId (authenticated)
    - Get specific wi-fi credential of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
GET /wifi/= (authenticated)
    - Get all wi-fi credentials of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
DELETE /wifi/:wifiId (authenticated)
    - Delete specific wi-fi credential of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}

๐Ÿ—’๏ธ Safe notes

POST /safenote (authenticated)
    - Route to create a safe note
    - headers: { "Authorization": "Bearer $token" }
    - body: {
    "title": "My lovely secret",
    "content": "Lorem ipsum dolor set"
    }
GET /safenote/:safenoteId (authenticated)
    - Get specific safe note of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
GET /safenote/= (authenticated)
    - Get all safe notes of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
DELETE /safenote/:safenoteId (authenticated)
    - Delete safe note credential of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}

๐Ÿ’ณ Credit card credentials

POST /credit-card (authenticated)
    - Route to create a safe note
    - headers: { "Authorization": "Bearer $token" }
    - body: {
    "name": "Coleman R C Gallant",
     "number": "1494-2313-1244-11",
     "expiry": "07/2030",
     "cvv": 289,
     "password": 1984,
     "isVirtual": false,
     "type": "Credit",
     "title": "My purple MasterCard CC"
}
GET /credit-card/:creditCardId (authenticated)
    - Get specific credit card of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
GET /credit-card/= (authenticated)
    - Get all credit cards of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}
DELETE /credit-card/:creditCardId (authenticated)
    - Delete credit card credentials of an authenticated user
    - headers: { "Authorization": "Bearer $token" }
    - body: {}

๐Ÿ Running the aplication

This project was initialized with Create React App, so make sure you have the latest stable version of [Node.js](https:/ /nodejs.org/en/download/) and npm running locally.

โคต๏ธ Clone this repository on your machine:

git clone https://github.com/f7lipe/projeto19-drivenpass

โš™๏ธ Create a .env file in the root of your project folder and configute it to look something like this

   PORT = 5000
   DATABASE_URL = postgres://postgres:password6@database_url/database_name
   MODE = DEV
   JWT_SECRET = "secret"
   CRYPT_KEY = "secret"

๐Ÿ’ป Inside the folder, run the following command to install the dependencies.

npm install

๐Ÿ—ƒ๏ธ Build the database

npx prisma db push

๐Ÿ Finished the process, just start the server

npm run dev

โš ๏ธ If your .env file is set to MODE = DEV all creation routes will return an object with the information entered into the database

๐Ÿ”ฅ Hot tip

If you are using Thunder Client, import the thunder_client_template.json to your Thunder Client extension and enjoy the benefits of all routes already configured.

drivenpass-api's People

Contributors

f7lipe avatar

Stargazers

Furkan Can Zirek avatar

Watchers

 avatar

Forkers

isabellacgmsa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.