this is a simple api for storing encrypted passwords in a database and retrieving them.
-
clone the repository
-
install the dependencies using
npm install
-
set the environment variable
MONGO_URI
to the path of the database -
set the environment variable
JWT_SECRET
for the jwt secret key -
set the environment variable
AES_KEY
for the AES key -
set the environment variable
PORT
for the port if you want to change it from the default which is5000
-
run
npm start
POST /api/v1/auth/login
- expects a json
body
with the following fields:name
email
password
- returns a json
body
with the following fields:token
user
- expects a json
POST /api/v1/auth/register
- expects a json
body
with the following fields:email
password
- returns
header
with the following fields:token
- returns a json
body
with the following fields:user
- expects a json
GET /api/v1/auth/me
- expects a
header
with the following fields:token
- returns a json
body
with the following fields:user
- expects a
POST /api/v1/passwords
- expects a
header
with the following fields:token
- expects a json
body
with the following fields:name
url
username
password
- returns a json
body
with the following fields:password
: the password object
- expects a
GET /api/v1/passwords
- expects a
header
with the following fields:token
- returns a json
body
with the following fields:passwords
: an array of password objects
- expects a
GET /api/v1/passwords/:id
- expects a
header
with the following fields:token
- returns a json
body
with the following fields:password
: the password object
- expects a
PAtCH /api/v1/passwords/:id
- expects a
header
with the following fields:token
- expects a json
body
with the following fields:name
url
username
password
- returns a json
body
with the following fields:password
: the password object
- expects a
DELETE /api/v1/passwords/:id
- expects a
header
with the following fields:token
- returns a json
body
with the following fields:password
: the password object
- expects a
- dotenv : the environment variables
- express : the server
- xpress-async-errors : the error handling
- http-status-codes : the http status codes
- mongoose : the database
- cors : cross origin resource sharing
- bcrypt : the password encryption
- jsonwebtoken : the jwt
- crypto-js : the AES encryption
- express-rate-limit : the rate limiting
- helmet : extra security layers
- xss-clean : the xss filter