https://github.com/siumauricio/commercestore.api
Simple authentication with nestjs using jwt and roles fully tested
https://github.com/siumauricio/commercestore.api
jwt nestjs roles
Last synced: 2 months ago
JSON representation
Simple authentication with nestjs using jwt and roles fully tested
- Host: GitHub
- URL: https://github.com/siumauricio/commercestore.api
- Owner: Siumauricio
- Created: 2022-05-07T00:39:54.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-20T19:50:32.000Z (about 4 years ago)
- Last Synced: 2026-02-27T18:37:56.645Z (4 months ago)
- Topics: jwt, nestjs, roles
- Language: TypeScript
- Homepage:
- Size: 861 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
A progressive Node.js framework for building efficient and scalable server-side applications.
## Description
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
## Installation
```bash
$ npm install
```
```bash
-- open swagger interface
go to http://localhost:3000/api
```
## Running the app
```bash
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
```
## Test
```bash
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
```
```java
-- Command to up a postgres database
docker run --name postgres-db -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres
-Host: localhost
-Port: 5432
-User: postgres
-Password: docker
```
```sql
--Schema database
-- This script was generated by a beta version of the ERD tool in pgAdmin 4.
-- Please log an issue at https://redmine.postgresql.org/projects/pgadmin4/issues/new if you find any bugs, including reproduction steps.
BEGIN;
CREATE TABLE IF NOT EXISTS public.users
(
"idUser" text NOT NULL,
name text NOT NULL,
lastname text NOT NULL,
username text NOT NULL,
age integer NOT NULL,
email text NOT NULL,
"phoneNumber" text,
"userType" text NOT NULL,
PRIMARY KEY ("idUser")
);
CREATE TABLE IF NOT EXISTS public.products
(
"idProduct" text NOT NULL,
"productName" text NOT NULL,
description text NOT NULL,
price double precision NOT NULL,
stock integer NOT NULL,
PRIMARY KEY ("idProduct")
);
CREATE TABLE IF NOT EXISTS public.cart
(
"idCart" text NOT NULL,
date date NOT NULL,
quantity integer NOT NULL,
"idProductList" text NOT NULL,
"idUser" text NOT NULL,
PRIMARY KEY ("idCart")
);
CREATE TABLE IF NOT EXISTS public."productList"
(
"idProductList" text NOT NULL,
"idProduct" text NOT NULL,
"idCart" text NOT NULL
);
ALTER TABLE IF EXISTS public.cart
ADD FOREIGN KEY ("idUser")
REFERENCES public.users ("idUser") MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID;
ALTER TABLE IF EXISTS public."productList"
ADD FOREIGN KEY ("idProduct")
REFERENCES public.products ("idProduct") MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID;
ALTER TABLE IF EXISTS public."productList"
ADD FOREIGN KEY ("idCart")
REFERENCES public.cart ("idCart") MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID;
END;
```
## Support
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
## Stay in touch
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)
## License
Nest is [MIT licensed](LICENSE).