Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export default {
allJS: ['server.js', 'config/**/*.js', 'lib/**/*.js', 'modules/*/**/*.js'],
allYaml: 'modules/*/doc/*.yml',
mongooseModels: 'modules/*/models/*.mongoose.js',
sequelizeModels: 'modules/*/models/*.sequelize.js',
preRoutes: 'modules/*/routes/*.preroute.js',
routes: 'modules/*/routes/!(*.preroute).js',
config: 'modules/*/*.init.js',
Expand Down
15 changes: 2 additions & 13 deletions config/defaults/development.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const config = {
app: {
title: 'Devkit Node - Development Environment',
description: 'Node - Boilerplate Back : Express, Jwt, Mongo, Sequelize (Beta) ',
keywords: 'node, express, mongo, jwt, sequelize, stack, boilerplate',
description: 'Node - Boilerplate Back : Express, Jwt, Mongo',
keywords: 'node, express, mongo, jwt, stack, boilerplate',
googleAnalyticsTrackingID: 'DEVKIT_NODE_app_googleAnalyticsTrackingID',
contact: 'contact@example.com',
},
Expand Down Expand Up @@ -59,17 +59,6 @@ const config = {
json: false,
},
},
// orm: {
// dbname: 'WaosNodeDev',
// user: '',
// pass: '',
// options: {
// // sequelize supports one of: mysql, postgres, sqlite, mariadb and mssql.
// dialect: 'postgres',
// host: '',
// port: ''
// }
// },
csrf: {
csrf: false,
csp: false,
Expand Down
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const initGlobalConfig = async () => {
// Initialize global globbed files
config = deepMerge(config, { files: await configHelper.initGlobalConfigFiles(assets) });
// Filter files by module activation (deactivated modules are excluded)
const fileKeys = ['swagger', 'mongooseModels', 'sequelizeModels', 'preRoutes', 'routes', 'configs', 'policies'];
const fileKeys = ['swagger', 'mongooseModels', 'preRoutes', 'routes', 'configs', 'policies'];
for (const key of fileKeys) {
if (config.files[key]) {
config.files[key] = configHelper.filterByActivation(config.files[key], config);
Expand Down
5 changes: 0 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ export default {
'<rootDir>/modules/**/*.js',
// Exclude schema/model definitions — no business logic, just DB structure
'!<rootDir>/modules/**/*.model.mongoose.js',
'!<rootDir>/modules/**/*.model.sequelize.js',
// Exclude static config files — just object exports, nothing to test
'!<rootDir>/config/defaults/**/*.js',
// Exclude entry point
'!<rootDir>/server.js',
// Exclude Sequelize service — MySQL support is disabled/commented out in app.js
'!<rootDir>/lib/services/sequelize.js',
// Exclude OAuth strategy configs — no business logic, just passport.use() calls;
// real OAuth credentials required to test, which are not available in CI
'!<rootDir>/modules/auth/strategies/local/apple.js',
Expand All @@ -47,8 +44,6 @@ export default {
'!<rootDir>/lib/app.js',
// Exclude thin fs wrapper — trivial I/O helper
'!<rootDir>/lib/helpers/files.js',
// Exclude deprecated Joi extension — superseded by Zod validation
'!<rootDir>/lib/helpers/joi.js',
// Exclude mailer internals — require real SMTP credentials not available in CI
'!<rootDir>/lib/helpers/mailer/**',
// Exclude DB migrations — one-time data scripts, not business logic
Expand Down
33 changes: 2 additions & 31 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@ import migrations from './services/migrations.js';
import AnalyticsService from './services/analytics.js';
import SentryService from './services/sentry.js';

// Establish an SQL server connection, instantiating all models and schemas
// const startSequelize = () =>
// new Promise(async (resolve, reject) => {
// let orm = {};
// if (config.orm) {
// try {
// orm = await import(path.resolve('./services/sequelize.js'));
// orm.sync().then(() => {
// resolve(orm);
// });
// } catch (e) {
// console.log(e);
// reject(e);
// }
// } else {
// resolve();
// }
// });

// Establish a MongoDB connection, instantiating all models
const startMongoose = async () => {
try {
Expand All @@ -58,19 +39,12 @@ const startExpress = async () => {

/**
* Bootstrap the required services
* @return {Object} db, orm, and app instances
* @returns {Object} db and app instances
*/
const bootstrap = async () => {
let orm;
let db;
let app;

// try {
// orm = await startSequelize();
// } catch (e) {
// orm = {};
// }

try {
await SentryService.init();
db = await startMongoose();
Expand All @@ -82,7 +56,6 @@ const bootstrap = async () => {

return {
db,
orm,
app,
};
};
Expand Down Expand Up @@ -121,12 +94,11 @@ const logConfiguration = async () => {
// Boot up the server
const start = async () => {
let db;
let orm;
let app;
let http;

try {
({ db, orm, app } = await bootstrap());
({ db, app } = await bootstrap());
} catch (e) {
throw new Error(e);
}
Expand All @@ -138,7 +110,6 @@ const start = async () => {
await logConfiguration();
return {
db,
orm,
app,
http,
};
Expand Down
1 change: 0 additions & 1 deletion lib/helpers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ const initGlobalConfigFiles = async (assets) => {
const files = {}; // Appending files
files.swagger = await getGlobbedPaths(assets.allYaml); // Setting Globbed module yaml files
files.mongooseModels = await getGlobbedPaths(assets.mongooseModels); // Setting Globbed mongoose model files
files.sequelizeModels = await getGlobbedPaths(assets.sequelizeModels); // Setting Globbed sequelize model files
files.preRoutes = await getGlobbedPaths(assets.preRoutes); // Setting Globbed pre-parser route files
files.routes = await getGlobbedPaths(assets.routes); // Setting Globbed route files
files.configs = await getGlobbedPaths(assets.config); // Setting Globbed config files
Expand Down
46 changes: 0 additions & 46 deletions lib/helpers/joi.js

This file was deleted.

58 changes: 0 additions & 58 deletions lib/services/sequelize.js

This file was deleted.

2 changes: 1 addition & 1 deletion modules/core/tests/core.unit.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Core unit tests:', () => {
});

it('assets should contain the correct keys', () => {
const expectedKeys = ['allJS', 'allYaml', 'mongooseModels', 'sequelizeModels', 'preRoutes', 'routes', 'config', 'policies'];
const expectedKeys = ['allJS', 'allYaml', 'mongooseModels', 'preRoutes', 'routes', 'config', 'policies'];

expectedKeys.forEach((key) => {
expect(assets).toHaveProperty(key);
Expand Down
12 changes: 0 additions & 12 deletions modules/tasks/models/tasks.model.sequelize.js

This file was deleted.

2 changes: 1 addition & 1 deletion modules/users/services/users.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const create = async (user) => {
if (!user.provider) user.provider = 'local';
// confirming to secure password policies
if (user.password) {
// done in model, let this comment for information if one day joi.zxcvbn is not ok / sufficient
// Password-strength validation is enforced at the model layer via its schema refinement/helper.
// const validPassword = zxcvbn(user.password);
// if (!validPassword || !validPassword.score || validPassword.score < config.zxcvbn.minimumScore) {
// throw new AppError(`${validPassword.feedback.warning}. ${validPassword.feedback.suggestions.join('. ')}`);
Expand Down
Loading
Loading