├── .editorconfig ├── .env.example ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .mocharc.js ├── README.md ├── docker-compose.yml ├── docker └── postgres │ ├── .dockerignore │ ├── Dockerfile │ └── init.sql ├── knexfile.js ├── nodemon.json ├── package.json ├── public └── main.css ├── scripts ├── gensecret.js └── setup.js ├── src ├── algebra │ └── functions.ts ├── collection │ └── index.ts ├── config.ts ├── crypto │ ├── index.ts │ └── url.ts ├── db │ ├── index.ts │ ├── migrations │ │ └── 00-create_user_table.ts │ ├── seeds │ │ ├── 00-setup.ts │ │ ├── 01-user.ts │ │ └── 99-tear-down.ts │ └── utils.ts ├── email │ └── index.ts ├── http │ ├── error.ts │ ├── express-app.ts │ ├── routes │ │ ├── authenticated │ │ │ ├── _middleware.ts │ │ │ ├── goodbye.ts │ │ │ ├── index.ts │ │ │ └── user.ts │ │ ├── index.ts │ │ └── user.ts │ ├── server.ts │ ├── shutdown-server.ts │ ├── status.ts │ └── validation.ts ├── i18n │ ├── index.ts │ └── translation │ │ └── en.ts ├── index.ts ├── lifecycle │ └── index.ts ├── log │ └── logger.ts ├── promise │ └── parallel.ts ├── runtime │ ├── delay.ts │ └── index.ts ├── services │ └── user.ts └── types │ └── common.ts ├── tests ├── _hooks.ts ├── crypto │ └── signed-urls.test.ts ├── hello.test.ts ├── jsconfig.json └── user │ ├── auth.test.ts │ ├── user-spy.test.ts │ └── user.test.ts ├── tsconfig.json └── views ├── emails ├── common │ ├── layout.pug │ └── style.pug ├── email-verification.plain.pug └── email-verification.pug └── pages ├── 403.pug ├── 404.pug ├── common └── layout.pug └── hello-world.pug /.editorconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/.editorconfig -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/.env.example -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.js -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/.eslintrc.js -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/.gitignore -------------------------------------------------------------------------------- /.mocharc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/.mocharc.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/README.md -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/docker-compose.yml -------------------------------------------------------------------------------- /docker/postgres/.dockerignore: -------------------------------------------------------------------------------- 1 | data 2 | -------------------------------------------------------------------------------- /docker/postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:latest 2 | EXPOSE 5432 3 | 4 | COPY init.sql /docker-entrypoint-initdb.d 5 | -------------------------------------------------------------------------------- /docker/postgres/init.sql: -------------------------------------------------------------------------------- 1 | create extension if not exists "uuid-ossp" schema public; 2 | -------------------------------------------------------------------------------- /knexfile.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/knexfile.js -------------------------------------------------------------------------------- /nodemon.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/nodemon.json -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/package.json -------------------------------------------------------------------------------- /public/main.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/public/main.css -------------------------------------------------------------------------------- /scripts/gensecret.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/scripts/gensecret.js -------------------------------------------------------------------------------- /scripts/setup.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/scripts/setup.js -------------------------------------------------------------------------------- /src/algebra/functions.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/algebra/functions.ts -------------------------------------------------------------------------------- /src/collection/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/collection/index.ts -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/config.ts -------------------------------------------------------------------------------- /src/crypto/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/crypto/index.ts -------------------------------------------------------------------------------- /src/crypto/url.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/crypto/url.ts -------------------------------------------------------------------------------- /src/db/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/db/index.ts -------------------------------------------------------------------------------- /src/db/migrations/00-create_user_table.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/db/migrations/00-create_user_table.ts -------------------------------------------------------------------------------- /src/db/seeds/00-setup.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/db/seeds/00-setup.ts -------------------------------------------------------------------------------- /src/db/seeds/01-user.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/db/seeds/01-user.ts -------------------------------------------------------------------------------- /src/db/seeds/99-tear-down.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/db/seeds/99-tear-down.ts -------------------------------------------------------------------------------- /src/db/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/db/utils.ts -------------------------------------------------------------------------------- /src/email/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/email/index.ts -------------------------------------------------------------------------------- /src/http/error.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/error.ts -------------------------------------------------------------------------------- /src/http/express-app.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/express-app.ts -------------------------------------------------------------------------------- /src/http/routes/authenticated/_middleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/routes/authenticated/_middleware.ts -------------------------------------------------------------------------------- /src/http/routes/authenticated/goodbye.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/routes/authenticated/goodbye.ts -------------------------------------------------------------------------------- /src/http/routes/authenticated/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/routes/authenticated/index.ts -------------------------------------------------------------------------------- /src/http/routes/authenticated/user.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/routes/authenticated/user.ts -------------------------------------------------------------------------------- /src/http/routes/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/routes/index.ts -------------------------------------------------------------------------------- /src/http/routes/user.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/routes/user.ts -------------------------------------------------------------------------------- /src/http/server.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/server.ts -------------------------------------------------------------------------------- /src/http/shutdown-server.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/shutdown-server.ts -------------------------------------------------------------------------------- /src/http/status.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/status.ts -------------------------------------------------------------------------------- /src/http/validation.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/http/validation.ts -------------------------------------------------------------------------------- /src/i18n/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/i18n/index.ts -------------------------------------------------------------------------------- /src/i18n/translation/en.ts: -------------------------------------------------------------------------------- 1 | export default {}; 2 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/lifecycle/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/lifecycle/index.ts -------------------------------------------------------------------------------- /src/log/logger.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/log/logger.ts -------------------------------------------------------------------------------- /src/promise/parallel.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/promise/parallel.ts -------------------------------------------------------------------------------- /src/runtime/delay.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/runtime/delay.ts -------------------------------------------------------------------------------- /src/runtime/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/runtime/index.ts -------------------------------------------------------------------------------- /src/services/user.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/src/services/user.ts -------------------------------------------------------------------------------- /src/types/common.ts: -------------------------------------------------------------------------------- 1 | export type uuid = string; 2 | -------------------------------------------------------------------------------- /tests/_hooks.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/tests/_hooks.ts -------------------------------------------------------------------------------- /tests/crypto/signed-urls.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/tests/crypto/signed-urls.test.ts -------------------------------------------------------------------------------- /tests/hello.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/tests/hello.test.ts -------------------------------------------------------------------------------- /tests/jsconfig.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /tests/user/auth.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/tests/user/auth.test.ts -------------------------------------------------------------------------------- /tests/user/user-spy.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/tests/user/user-spy.test.ts -------------------------------------------------------------------------------- /tests/user/user.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/tests/user/user.test.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/tsconfig.json -------------------------------------------------------------------------------- /views/emails/common/layout.pug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/views/emails/common/layout.pug -------------------------------------------------------------------------------- /views/emails/common/style.pug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/views/emails/common/style.pug -------------------------------------------------------------------------------- /views/emails/email-verification.plain.pug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/views/emails/email-verification.plain.pug -------------------------------------------------------------------------------- /views/emails/email-verification.pug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/views/emails/email-verification.pug -------------------------------------------------------------------------------- /views/pages/403.pug: -------------------------------------------------------------------------------- 1 | extends common/layout 2 | 3 | block main 4 | p Forbidden 5 | 6 | //- TODO: customize 7 | -------------------------------------------------------------------------------- /views/pages/404.pug: -------------------------------------------------------------------------------- 1 | extends common/layout 2 | 3 | block main 4 | p Not Found 5 | 6 | //- TODO: customize 7 | -------------------------------------------------------------------------------- /views/pages/common/layout.pug: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdellacqua/express-knex-typescript-template/HEAD/views/pages/common/layout.pug -------------------------------------------------------------------------------- /views/pages/hello-world.pug: -------------------------------------------------------------------------------- 1 | extends common/layout 2 | 3 | block main 4 | p World! 5 | 6 | //- TODO: remove this example --------------------------------------------------------------------------------