@bonifaceebuka/core-backend 1.0.0 → 1.0.2
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.
package/Readme.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# 📦 Auri Spectrum's Core Backend Code
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This is a reusable backend core infrastructure package developed and used on Aurispec's backend services - admin & mobile.
|
|
4
|
+
|
|
5
|
+
`@bonifaceebuka/core-backend` provides shared backend logic, database models, utilities, and integrations extracted from the mobile and admin API service to reduce code repetition and one source of truth for database models and migrations.
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -14,7 +16,23 @@ This the RESTful API & Websocket service that powers Auri Spectrum mobile app.
|
|
|
14
16
|
|
|
15
17
|
---
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
|
|
20
|
+
- ✅ TypeScript-first architecture
|
|
21
|
+
- ✅ TypeORM integration
|
|
22
|
+
- ✅ Reusable database models
|
|
23
|
+
- ✅ Queue processing (BullMQ + Redis)
|
|
24
|
+
- ✅ Authentication & JWT helpers
|
|
25
|
+
- ✅ Email & notification utilities
|
|
26
|
+
- ✅ File upload & media processing
|
|
27
|
+
- ✅ Cloud integrations (Cloudinary, SendGrid, Stripe)
|
|
28
|
+
- ✅ Logging with Winston
|
|
29
|
+
- ✅ Validation & transformation helpers
|
|
30
|
+
- ✅ Swagger/OpenAPI support via TSOA
|
|
31
|
+
- ✅ Production-ready structure
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🧑💻 Getting Started To Contribute To This Codebase
|
|
18
36
|
|
|
19
37
|
### Prerequisites
|
|
20
38
|
|
|
@@ -30,4 +48,30 @@ cp .env.example .env
|
|
|
30
48
|
npm install
|
|
31
49
|
npm run migration:run
|
|
32
50
|
npm run dev
|
|
51
|
+
|
|
52
|
+
npm version patch
|
|
53
|
+
npm publish
|
|
54
|
+
|
|
33
55
|
```
|
|
56
|
+
|
|
57
|
+
## 📥 Installation
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install @bonifaceebuka/core-backend
|
|
61
|
+
OR
|
|
62
|
+
yarn add @bonifaceebuka/core-backend
|
|
63
|
+
```
|
|
64
|
+
---
|
|
65
|
+
## 📥 Installation
|
|
66
|
+
|
|
67
|
+
src
|
|
68
|
+
│
|
|
69
|
+
├── common/
|
|
70
|
+
│ ├── configs
|
|
71
|
+
│ ├── helpers
|
|
72
|
+
│ └── utils
|
|
73
|
+
│
|
|
74
|
+
├── models/
|
|
75
|
+
├── database/
|
|
76
|
+
|
|
77
|
+
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../../src/common/configs/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../../src/common/configs/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAUrC,eAAO,MAAM,UAAU,YAWrB,CAAC;AAEH,eAAO,MAAM,cAAc,qBAI1B,CAAC"}
|
|
@@ -1,10 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.postgresLoader = exports.dataSource = void 0;
|
|
4
37
|
const typeorm_1 = require("typeorm");
|
|
5
38
|
const _1 = require(".");
|
|
6
39
|
const { DATABASE, IS_PRODUCTION } = _1.CONFIGS;
|
|
7
40
|
const isCompiled = __filename.endsWith(".js");
|
|
41
|
+
const Models = __importStar(require("../../models"));
|
|
42
|
+
const entityClasses = Object.values(Models);
|
|
8
43
|
exports.dataSource = new typeorm_1.DataSource({
|
|
9
44
|
type: "postgres",
|
|
10
45
|
host: DATABASE.HOST,
|
|
@@ -12,7 +47,7 @@ exports.dataSource = new typeorm_1.DataSource({
|
|
|
12
47
|
username: DATABASE.USERNAME,
|
|
13
48
|
password: DATABASE.PASSWORD,
|
|
14
49
|
database: DATABASE.DATABASE,
|
|
15
|
-
entities: [isCompiled ? "dist/models/**/*.js" : "src/models/**/*.ts"],
|
|
50
|
+
entities: entityClasses, // [isCompiled ? "dist/models/**/*.js" : "src/models/**/*.ts"],
|
|
16
51
|
migrations: [isCompiled ? "dist/database/migrations/**/*.js" : "src/database/migrations/**/*.ts"],
|
|
17
52
|
synchronize: false,
|
|
18
53
|
logging: true,
|