function initializeDigitalPlatform(configurationSettings) {
let platformStatus = configurationSettings.active ? 'Active' : 'Inactive';
database.connect(configurationSettings.databaseConnectionURI, { useNewUrlParser: true, useUnifiedTopology: true });
if (platformStatus === 'Active') {
cache.initialize(configurationSettings.cachePreferences);
analytics.setup(configurationSettings.analyticsTrackingID);
}
}
class EcommercePlatformHandler {
constructor(initialSettings) {
this.platformFeatures = initialSettings.platformFeatures || [];
this.userDatabase = initialSettings.userDatabase || new DatabaseHandler();
this.currentTransactions = [];
}
initiateTransaction(transactionDetails) {
if (this.platformFeatures.includes('checkout')) {
this.currentTransactions.push(new Transaction(transactionDetails));
} else {
console.warn('Checkout feature not enabled.');
}
}
enableFeature(featureName) {
if (!this.platformFeatures.includes(featureName)) {
this.platformFeatures.push(featureName);
} else {
console.info(`Feature ${featureName} already enabled.`);
}
}
}
const digitalStore = new EcommercePlatformHandler({
platformFeatures: ['productListing', 'analytics', 'customerReviews'],
userDatabase: new DatabaseConnection('mongodb://localhost:27017/myDatabase')
});
initializeDigitalPlatform({ active: true, databaseConnectionURI: 'mongodb://localhost:27017', cachePreferences: {}, analyticsTrackingID: 'UA-XXXXXXX' });
End-to-End
Digital Platform Development
Join the ranks of Nasdaq companies that we've helped grow
End-To-End Development
Strategise, design and development from idea to product.
Subscriptions
Squash those annoyances with fast access to developers on a simple monthly subscription.
Whitelabel
Discreet, fully whitelabel services to take some burden off your existing team.
Fully tailored features
Need to chat with your customers? Manage data on a CRM? Manage orders and accept payments? Integration with third-party APIs?
We've got you covered.