create-express-mongo-ts 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +157 -0
  2. package/bin/cli.js +217 -0
  3. package/package.json +43 -0
  4. package/template/.dockerignore +2 -0
  5. package/template/.prettierignore +6 -0
  6. package/template/.prettierrc +8 -0
  7. package/template/Dockerfile +17 -0
  8. package/template/README.md +67 -0
  9. package/template/eslint.config.mts +34 -0
  10. package/template/jest.config.ts +201 -0
  11. package/template/keys/README.md +2 -0
  12. package/template/nodemon.json +5 -0
  13. package/template/package.json +65 -0
  14. package/template/src/app.ts +42 -0
  15. package/template/src/config.ts +31 -0
  16. package/template/src/core/ApiError.ts +118 -0
  17. package/template/src/core/ApiResponse.ts +140 -0
  18. package/template/src/core/asyncHandler.ts +15 -0
  19. package/template/src/core/authUtils.ts +68 -0
  20. package/template/src/core/jwtUtils.ts +96 -0
  21. package/template/src/core/logger.ts +48 -0
  22. package/template/src/core/utils.ts +12 -0
  23. package/template/src/database/index.ts +56 -0
  24. package/template/src/database/models/ApiKeys.ts +62 -0
  25. package/template/src/database/models/Keystore.ts +45 -0
  26. package/template/src/database/models/Role.ts +27 -0
  27. package/template/src/database/models/User.ts +64 -0
  28. package/template/src/database/repositories/ApiKeyRepo.ts +26 -0
  29. package/template/src/database/repositories/KeystoreRepo.ts +53 -0
  30. package/template/src/database/repositories/UserRepo.ts +63 -0
  31. package/template/src/helpers/generateApiKey.ts +23 -0
  32. package/template/src/helpers/validator.ts +38 -0
  33. package/template/src/index.ts +36 -0
  34. package/template/src/middlewares/authorize.middleware.ts +26 -0
  35. package/template/src/middlewares/error.middleware.ts +42 -0
  36. package/template/src/middlewares/permission.middleware.ts +20 -0
  37. package/template/src/middlewares/validator.middleware.ts +170 -0
  38. package/template/src/routes/auth/apiKey.ts +29 -0
  39. package/template/src/routes/auth/authentication.ts +45 -0
  40. package/template/src/routes/auth/index.ts +14 -0
  41. package/template/src/routes/auth/schema.ts +34 -0
  42. package/template/src/routes/auth/signin.ts +47 -0
  43. package/template/src/routes/auth/signout.ts +20 -0
  44. package/template/src/routes/auth/signup.ts +49 -0
  45. package/template/src/routes/auth/token.ts +68 -0
  46. package/template/src/routes/health/index.ts +14 -0
  47. package/template/src/routes/index.ts +19 -0
  48. package/template/src/types/ApiKey.ts +13 -0
  49. package/template/src/types/Keystore.ts +12 -0
  50. package/template/src/types/Role.ts +14 -0
  51. package/template/src/types/User.ts +16 -0
  52. package/template/src/types/app-requests.d.ts +22 -0
  53. package/template/src/types/permissions.ts +3 -0
  54. package/template/tsconfig.json +33 -0
@@ -0,0 +1,33 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "CommonJS",
4
+ "esModuleInterop": true,
5
+ "target": "ESNext",
6
+ "allowJs": false,
7
+ "strictNullChecks": true,
8
+ "noImplicitAny": true,
9
+ "strict": true,
10
+ "strictFunctionTypes": false,
11
+ "noImplicitThis": false,
12
+ "moduleResolution": "node",
13
+ "resolveJsonModule": true,
14
+ "sourceMap": true,
15
+ "outDir": "dist",
16
+ "baseUrl": ".",
17
+ "removeComments": true,
18
+ "emitDecoratorMetadata": true,
19
+ "experimentalDecorators": true,
20
+ "allowSyntheticDefaultImports": true,
21
+ "incremental": true,
22
+ "skipLibCheck": true,
23
+ "strictBindCallApply": true,
24
+ "forceConsistentCasingInFileNames": true,
25
+ "noFallthroughCasesInSwitch": true
26
+ },
27
+ "include": [
28
+ "src/**/*"
29
+ ],
30
+ "exclude": [
31
+ ".templates"
32
+ ]
33
+ }