Repository: bhaidar/nestjs-todo-app Branch: master Commit: 9b9c01f4f0a9 Files: 149 Total size: 108.3 KB Directory structure: gitextract_f_7atx7c/ ├── .gitignore ├── .vscode/ │ └── launch.json ├── README.md ├── server/ │ ├── .gitignore │ ├── .prettierrc │ ├── README.md │ ├── db/ │ │ └── initdb.d/ │ │ └── init-users-db.sh │ ├── docker-compose.yml │ ├── nest-cli.json │ ├── nodemon-debug.json │ ├── nodemon.json │ ├── ormconfig.json │ ├── package.json │ ├── src/ │ │ ├── app.controller.spec.ts │ │ ├── app.controller.ts │ │ ├── app.module.ts │ │ ├── app.service.ts │ │ ├── auth/ │ │ │ ├── auth.controller.spec.ts │ │ │ ├── auth.controller.ts │ │ │ ├── auth.module.ts │ │ │ ├── auth.service.spec.ts │ │ │ ├── auth.service.ts │ │ │ ├── interfaces/ │ │ │ │ ├── login-status.interface.ts │ │ │ │ ├── payload.interface.ts │ │ │ │ └── regisration-status.interface.ts │ │ │ └── jwt.strategy.ts │ │ ├── core/ │ │ │ ├── core.module.ts │ │ │ └── http-exception.filter.ts │ │ ├── main.ts │ │ ├── migration/ │ │ │ ├── 1551865385236-InitialCreate.ts │ │ │ ├── 1552392671960-AddUpdatedOnFieldToTodoEntity.ts │ │ │ ├── 1555148302681-AddUser.ts │ │ │ ├── 1555166680617-AddOwnerFieldToTodoEntity.ts │ │ │ └── 1565812987671-SeedUserRecord.ts │ │ ├── mock/ │ │ │ └── todos.mock.ts │ │ ├── shared/ │ │ │ ├── mapper.ts │ │ │ └── utils.ts │ │ ├── todo/ │ │ │ ├── dto/ │ │ │ │ ├── task.create.dto.ts │ │ │ │ ├── task.dto.ts │ │ │ │ ├── task.list.dto.ts │ │ │ │ ├── todo.create.dto.ts │ │ │ │ ├── todo.dto.ts │ │ │ │ └── todo.list.dto.ts │ │ │ ├── entity/ │ │ │ │ ├── task.entity.ts │ │ │ │ └── todo.entity.ts │ │ │ ├── task/ │ │ │ │ ├── task.controller.spec.ts │ │ │ │ ├── task.controller.ts │ │ │ │ ├── task.service.spec.ts │ │ │ │ └── task.service.ts │ │ │ ├── todo.controller.spec.ts │ │ │ ├── todo.controller.ts │ │ │ ├── todo.module.ts │ │ │ ├── todo.service.spec.ts │ │ │ └── todo.service.ts │ │ └── users/ │ │ ├── dto/ │ │ │ ├── user-login.dto.ts │ │ │ ├── user.create.dto.ts │ │ │ └── user.dto.ts │ │ ├── entity/ │ │ │ └── user.entity.ts │ │ ├── users.module.ts │ │ ├── users.service.spec.ts │ │ └── users.service.ts │ ├── test/ │ │ ├── app.e2e-spec.ts │ │ └── jest-e2e.json │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── tslint.json └── todo-client/ ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── browserslist ├── e2e/ │ ├── protractor.conf.js │ ├── src/ │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package.json ├── projects/ │ ├── app-common/ │ │ ├── README.md │ │ ├── karma.conf.js │ │ ├── ng-package.json │ │ ├── package.json │ │ ├── src/ │ │ │ ├── lib/ │ │ │ │ ├── action.ts │ │ │ │ └── app-common.module.ts │ │ │ ├── public-api.ts │ │ │ └── test.ts │ │ ├── tsconfig.lib.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── auth/ │ │ ├── README.md │ │ ├── karma.conf.js │ │ ├── ng-package.json │ │ ├── package.json │ │ ├── src/ │ │ │ ├── lib/ │ │ │ │ ├── auth.guard.ts │ │ │ │ ├── auth.module.ts │ │ │ │ ├── components/ │ │ │ │ │ └── login/ │ │ │ │ │ ├── login.component.css │ │ │ │ │ ├── login.component.html │ │ │ │ │ └── login.component.ts │ │ │ │ └── services/ │ │ │ │ ├── auth.service.ts │ │ │ │ ├── error.interceptor.ts │ │ │ │ └── jwt-interceptor.ts │ │ │ ├── public-api.ts │ │ │ └── test.ts │ │ ├── tsconfig.lib.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ └── todo/ │ ├── README.md │ ├── karma.conf.js │ ├── ng-package.json │ ├── package.json │ ├── src/ │ │ ├── lib/ │ │ │ ├── components/ │ │ │ │ ├── task-create/ │ │ │ │ │ └── task-create.component.ts │ │ │ │ ├── task-list/ │ │ │ │ │ └── task-list.component.ts │ │ │ │ ├── task.component.ts │ │ │ │ ├── todo-create/ │ │ │ │ │ └── todo-create.component.ts │ │ │ │ ├── todo-list/ │ │ │ │ │ └── todo-list.component.ts │ │ │ │ └── todo.component.ts │ │ │ ├── models/ │ │ │ │ ├── task.model.ts │ │ │ │ └── todo.model.ts │ │ │ ├── services/ │ │ │ │ ├── task.service.ts │ │ │ │ └── todo.service.ts │ │ │ ├── todo-home.component.ts │ │ │ ├── todo.module.ts │ │ │ └── todo.service.spec.ts │ │ ├── public-api.ts │ │ └── test.ts │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── tslint.json ├── proxy.conf.json ├── src/ │ ├── app/ │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── shared/ │ │ ├── home/ │ │ │ └── home.component.ts │ │ └── master/ │ │ ├── master.component.html │ │ └── master.component.ts │ ├── assets/ │ │ └── .gitkeep │ ├── environments/ │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Created by https://www.gitignore.io/api/node,windows,visualstudiocode # Edit at https://www.gitignore.io/?templates=node,windows,visualstudiocode ### Node ### # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # TypeScript v1 declaration files typings/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .env.test # parcel-bundler cache (https://parceljs.org/) .cache # next.js build output .next # nuxt.js build output .nuxt # vuepress build output .vuepress/dist # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json ### VisualStudioCode Patch ### # Ignore all local history of files .history ### Windows ### # Windows thumbnail cache files Thumbs.db ehthumbs.db ehthumbs_vista.db # Dump file *.stackdump # Folder config file [Dd]esktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msix *.msm *.msp # Windows shortcuts *.lnk # End of https://www.gitignore.io/api/node,windows,visualstudiocode dist/ .DS_Store ================================================ FILE: .vscode/launch.json ================================================ { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/server/src/auth/auth.module.ts", "outFiles": [ "${workspaceFolder}/**/*.js" ] } ] } ================================================ FILE: README.md ================================================ # nestjs-todo-app A full stack application written in Nest.js, Angular and PostgreSQL. ================================================ FILE: server/.gitignore ================================================ .idea/ .vscode/ .DS_Store node_modules/ build/ tmp/ temp/ ================================================ FILE: server/.prettierrc ================================================ { "singleQuote": true, "trailingComma": "all" } ================================================ FILE: server/README.md ================================================
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master [travis-url]: https://travis-ci.org/nestjs/nest [linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux [linux-url]: https://travis-ci.org/nestjs/nestA progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
## Description [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. ## Installation ```bash $ npm install ``` ## 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 ``` ## 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). ================================================ FILE: server/db/initdb.d/init-users-db.sh ================================================ #!/usr/bin/env bash set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE USER todo; CREATE DATABASE todo_db ENCODING UTF8; GRANT ALL PRIVILEGES ON DATABASE todo_db TO todo; ALTER USER todo WITH PASSWORD 'password123'; ALTER USER todo WITH SUPERUSER; EOSQL ================================================ FILE: server/docker-compose.yml ================================================ version: '3' services: db: container_name: todo_db image: postgres:10.7 volumes: - ./db/initdb.d:/docker-entrypoint-initdb.d ports: - '5445:5432' ================================================ FILE: server/nest-cli.json ================================================ { "language": "ts", "collection": "@nestjs/schematics", "sourceRoot": "src" } ================================================ FILE: server/nodemon-debug.json ================================================ { "watch": ["src"], "ext": "ts", "ignore": ["src/**/*.spec.ts"], "exec": "node --inspect-brk -r ts-node/register -r tsconfig-paths/register src/main.ts" } ================================================ FILE: server/nodemon.json ================================================ { "watch": ["src"], "ext": "ts", "ignore": ["src/**/*.spec.ts"], "exec": "ts-node -r tsconfig-paths/register src/main.ts" } ================================================ FILE: server/ormconfig.json ================================================ [ { "name": "production", "type": "postgres", "synchronize": false, "dropSchema": false, "logging": true }, { "name": "development", "type": "postgres", "host": "localhost", "port": 5445, "username": "todo", "password": "password123", "database": "todo_db", "synchronize": false, "logging": true, "entities": ["src/**/*.entity.ts"], "migrations": ["src/migration/**/*.ts"], "subscribers": ["src/subscriber/**/*.ts"], "cli": { "entitiesDir": "src/**/*.entity.ts", "migrationsDir": "src/migration", "subscribersDir": "src/subscriber" } }, { "type": "postgres", "host": "localhost", "port": 5445, "username": "todo", "password": "password123", "database": "todo_db", "synchronize": false, "logging": true, "entities": ["src/**/*.entity.ts"], "migrations": ["src/migration/**/*.ts"], "subscribers": ["src/subscriber/**/*.ts"], "cli": { "entitiesDir": "src", "migrationsDir": "src/migration", "subscribersDir": "src/subscriber" } } ] ================================================ FILE: server/package.json ================================================ { "name": "server", "version": "1.0.0", "description": "A nest todo app", "author": "Bilal Haidar", "license": "MIT", "scripts": { "build": "tsc -p tsconfig.build.json", "format": "prettier --write \"src/**/*.ts\"", "run:services": "docker-compose up -d && exit 0", "stop:services": "docker-compose kill", "start": "ts-node src/index.ts", "start:dev": "nodemon", "start:debug": "nodemon --config nodemon-debug.json", "typeorm:cli": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js -f ormconfig.json", "db:migration:generate": "npm-run-all -s -l clean build:server && yarn typeorm:cli migration:generate", "db:migration:create": "yarn typeorm:cli migration:create", "db:migrate": "npm-run-all -s -l clean build:server && yarn typeorm:cli migration:run", "query": "yarn typeorm:cli query", "prestart:prod": "rimraf dist && npm run build", "start:prod": "node dist/main.js", "lint": "tslint -p tsconfig.json -c tslint.json", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { "@nestjs/common": "6.2.3", "@nestjs/core": "6.2.3", "@nestjs/jwt": "6.1.0", "@nestjs/passport": "6.1.0", "@nestjs/platform-express": "6.2.3", "@nestjs/typeorm": "^6.1.1", "bcrypt": "^3.0.6", "class-transformer": "0.2.3", "class-validator": "0.9.1", "cookie-parser": "^1.4.4", "cors": "^2.8.5", "csurf": "^1.9.0", "dotenv": "7.0.0", "express-rate-limit": "^3.4.0", "global": "^4.3.2", "helmet": "^3.16.0", "passport": "^0.4.0", "passport-http-bearer": "^1.0.1", "passport-jwt": "^4.0.0", "pg": "7.9.0", "reflect-metadata": "0.1.12", "rxjs": "6.4.0", "typeorm": "0.2.16", "uuid": "3.3.2" }, "devDependencies": { "@nestjs/testing": "6.2.4", "@types/bcrypt": "^3.0.0", "@types/cookie-parser": "^1.4.1", "@types/cors": "^2.8.4", "@types/csurf": "^1.9.35", "@types/dotenv": "6.1.1", "@types/express": "4.16.1", "@types/express-rate-limit": "^3.3.0", "@types/helmet": "^0.0.43", "@types/jest": "24.0.11", "@types/node": "10.14.4", "@types/passport": "^1.0.0", "@types/passport-jwt": "^3.0.1", "@types/supertest": "2.0.7", "@types/uuid": "3.4.4", "jest": "^23.5.0", "nodemon": "1.18.11", "prettier": "1.17.0", "supertest": "^3.1.0", "ts-jest": "^23.1.3", "ts-loader": "5.3.3", "ts-node": "8.0.3", "tsconfig-paths": "3.8.0", "tslint": "5.15.0", "typescript": "3.4.3" }, "jest": { "moduleFileExtensions": [ "js", "json", "ts" ], "rootDir": "src", "testRegex": ".spec.ts$", "transform": { "^.+\\.(t|j)s$": "ts-jest" }, "coverageDirectory": "../coverage", "testEnvironment": "node" } } ================================================ FILE: server/src/app.controller.spec.ts ================================================ import { Test, TestingModule } from '@nestjs/testing'; import { AppController } from './app.controller'; import { AppService } from './app.service'; describe('AppController', () => { let appController: AppController; beforeEach(async () => { const app: TestingModule = await Test.createTestingModule({ controllers: [AppController], providers: [AppService], }).compile(); appController = app.getNo tasks yet!
Here you can manage your Todo Lists in a breeze!