first commit

This commit is contained in:
2026-02-18 16:03:43 +07:00
commit c52ecd6514
54 changed files with 8270 additions and 0 deletions

18
app/config/database.js Normal file
View File

@@ -0,0 +1,18 @@
const { Sequelize } = require('sequelize');
require('dotenv').config();
const sequelize = new Sequelize(
process.env.DB_NAME,
process.env.DB_USER,
process.env.DB_PASS,
{
host: process.env.DB_HOST,
dialect: process.env.DB_DIALECT,
logging: process.env.NODE_ENV === 'development' ? console.log : false,
define: {
timestamps: true
}
}
);
module.exports = sequelize;

22
app/config/midtrans.js Normal file
View File

@@ -0,0 +1,22 @@
const midtransClient = require('midtrans-client');
require('dotenv').config();
class MidtransConfig {
static getSnapClient() {
return new midtransClient.Snap({
isProduction: process.env.MIDTRANS_IS_PRODUCTION === 'true',
serverKey: process.env.MIDTRANS_SERVER_KEY,
clientKey: process.env.MIDTRANS_CLIENT_KEY
});
}
static getCoreApiClient() {
return new midtransClient.CoreApi({
isProduction: process.env.MIDTRANS_IS_PRODUCTION === 'true',
serverKey: process.env.MIDTRANS_SERVER_KEY,
clientKey: process.env.MIDTRANS_CLIENT_KEY
});
}
}
module.exports = MidtransConfig;