{"repo":"alpersonalwebsite/node-typescript-express-postgresql-authentication-authorization","free":true,"listed":false,"github":"https://github.com/alpersonalwebsite/node-typescript-express-postgresql-authentication-authorization","clone":"git clone https://github.com/alpersonalwebsite/node-typescript-express-postgresql-authentication-authorization.git","description":"Authentication and authorization for an Express and PostgreSQL API in TypeScript: bcrypt password hashing, JWTs with jsonwebtoken, protected routes and rate-limited auth endpoints.","language":"TypeScript","stars":12,"topics":["nodejs","express","typescript","jsonwebtoken","jwt","jwt-authentication","jwt-authorization","bcrypt","db-migrate","postgresql"],"license":null,"category":"databases-storage","readme_excerpt":"Node, TS, Express, PostgreSQL — Authentication & Authorization with JWT A small, raw example of how to authenticate and authorize an Express + PostgreSQL API using jsonwebtoken . Meant for learning: clone, run, read. Requirements Node 12+ PostgreSQL db-migrate installed globally Setup 1. Install dependencies: 2. Create a .env from .env-sample . Use the same database names in .env ( POSTGRES DB / POSTGRES TEST DB ) and in database.json — the app reads .env , while migrations read database.json . 3. Create the databases and run migrations: Run Test & lint Example requests Note: POST /users and POST /users/authenticate are rate-limited (10 requests per 15 minutes), so hammering them while experimenting can return a 429 . Error handling Models throw on failure; handlers translate that into a response. Expected client errors (bad request, not found, unauthorized) return their status and a message. Unexpected errors return a generic 500 so internal details (e.g. the database) never leak to the client. Kudos Extended version of Udacity's JSFSN User project.","default_branch":null,"files":null,"tree":[],"storefront":"/r/alpersonalwebsite","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alpersonalwebsite/node-typescript-express-postgresql-authentication-authorization/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}