Skip to content

Commit

Permalink
chg: cleanup notification service
Browse files Browse the repository at this point in the history
  • Loading branch information
wemakshaychavan committed Mar 1, 2023
1 parent 4facd44 commit 7a326f7
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 283 deletions.
58 changes: 22 additions & 36 deletions notifications/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
# Node module installation stage
FROM node:16.14.0 AS npmPackageInstallationStage
WORKDIR /usr/src/app-staging-folder
COPY package*.json ./
FROM node:16.14.0

# Set the working directory to /usr/src/app
WORKDIR /usr/src/app

#Need to copy utils as well

RUN npm cache verify

COPY . .

# Note: all npm packages are installed directly in the workdir and not under node_modules.
RUN npm install
# Copy the current directory contents into the container at /usr/src/app
COPY . .

# Babel build creation stage
FROM node:16.14.0 AS distCreationStage
WORKDIR /usr/src/app-staging-folder
RUN mkdir node_modules

# Copy node_modules from npmPackageInstallationStage
COPY --chown=node:node --from=npmPackageInstallationStage /usr/src/app-staging-folder/* /usr/src/app-staging-folder/node_modules/

# Copy code base for babel compilation
COPY package*.json ./
COPY ./app ./app

ENV NODE_ENV production
ENV APP_ENV production
RUN pwd
RUN ls -alrt
RUN npm run babelBuild

# Production docker image creation stage
FROM node:16.14.0 AS dockerImageCreationStage
RUN apt update
RUN apt-get install -y dumb-init

ENV NODE_ENV production
ENV APP_ENV production

USER node
COPY --chown=node:node --from=distCreationStage /usr/src/app-staging-folder/node_modules /usr/src/app-staging-folder/node_modules/
COPY --chown=node:node --from=distCreationStage /usr/src/app-staging-folder/package.json /usr/src/app-staging-folder/package.json
COPY --chown=node:node --from=distCreationStage /usr/src/app-staging-folder/dist /usr/src/app-staging-folder/dist
CMD ["dumb-init", "node", "./dist/bin/www"]
#RUN npm run build

#ENV NODE_ENV production
#ENV APP_ENV production
ENV HOST 0.0.0.0
ENV PROTOCOL "http://"
ENV USE_FQDN_FOR_APIS false
ENV FQDN ""

#CMD [ "npm", "serve", "--port", $PORT]
CMD exec npm run start
9 changes: 1 addition & 8 deletions notifications/app/config/constant/notificationConstants.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
module.exports = Object.freeze({
MOM_MENTION: 'MOM_MENTION',
TASK_ASSIGN: 'TASK_ASSIGN',
PROJECT_ASSIGN: 'PROJECT_ASSIGN',
COMMENT_MENTION: 'COMMENT_MENTION',
NEW_COMMENT: 'NEW_COMMENT',
TEAM_ASSIGN: 'TEAM_ASSIGN',
TASK_APPROVE_SUCCESS: 'TASK_APPROVE_SUCCESS',
TASK_APPROVE_FAIL: 'TASK_APPROVE_FAIL',

});
11 changes: 0 additions & 11 deletions notifications/app/config/environments/base/env.cors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ module.exports = {
'*',
'http://localhost:3000',
'https://localhost:3000',
'https://artifex.com',
'http://artifex.com',
'https://staging.artifex.com',
'http://staging.artifex.com',
'http://dev.artifex.com',
'https://dev.artifex.com',
'https://artifex-auth-dev.wemotive.in',
'https://artifex-pm-dev.wemotive.in',
'https://artifex.artifex-dev.com:3000',
'https://auth.artifex-dev.com:3005'

]
}
};
8 changes: 0 additions & 8 deletions notifications/app/config/environments/base/env.db.js

This file was deleted.

3 changes: 0 additions & 3 deletions notifications/app/config/environments/base/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import baseConfig from './env.base';
import corsConfig from './env.cors';
import dbConfig from './env.db';
const mailConfig = require('./env.email');


const mergedEnvironmentConfig = {
...baseConfig,
...corsConfig,
...dbConfig,
...mailConfig
};

Expand Down
11 changes: 0 additions & 11 deletions notifications/app/init/database.init.js
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
import mongoose from 'mongoose';
import { mergedEnvironmentConfig } from '../config/env.config.js';

const config = mergedEnvironmentConfig.mongodb;
mongoose.connect(`${config.host}/${config.name}`,{
useNewUrlParser:true
});

mongoose.set('debug', (collectionName, method, query, doc) => {
console.log(`[MONGOOS]:${collectionName}.${method}`, JSON.stringify(query), doc);
});
64 changes: 25 additions & 39 deletions notifications/app/lib/mailer/emails/sign-up/html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ head
o:pixelsperinch 96
style(type='text/css').
#outlook a {
padding:0;
padding:0;
}
.es-button {
mso-style-priority:100!important;
text-decoration:none!important;
mso-style-priority:100!important;
text-decoration:none!important;
}
a[x-apple-data-detectors] {
color:inherit!important;
text-decoration:none!important;
font-size:inherit!important;
font-family:inherit!important;
font-weight:inherit!important;
line-height:inherit!important;
color:inherit!important;
text-decoration:none!important;
font-size:inherit!important;
font-family:inherit!important;
font-weight:inherit!important;
line-height:inherit!important;
}
.es-desk-hidden {
display:none;
float:left;
overflow:hidden;
width:0;
max-height:0;
line-height:0;
mso-hide:all;
display:none;
float:left;
overflow:hidden;
width:0;
max-height:0;
line-height:0;
mso-hide:all;
}
[data-ogsb] .es-button {
border-width:0!important;
padding:10px 30px 10px 30px!important;
border-width:0!important;
padding:10px 30px 10px 30px!important;
}
@media only screen and (max-width:600px) {p, ul li, ol li, a { line-height:150%!important } h1, h2, h3, h1 a, h2 a, h3 a { line-height:120%!important } h1 { font-size:36px!important; text-align:left } h2 { font-size:26px!important; text-align:left } h3 { font-size:20px!important; text-align:left } .es-header-body h1 a, .es-content-body h1 a, .es-footer-body h1 a { font-size:36px!important; text-align:left } .es-header-body h2 a, .es-content-body h2 a, .es-footer-body h2 a { font-size:26px!important; text-align:left } .es-header-body h3 a, .es-content-body h3 a, .es-footer-body h3 a { font-size:20px!important; text-align:left } .es-menu td a { font-size:12px!important } .es-header-body p, .es-header-body ul li, .es-header-body ol li, .es-header-body a { font-size:14px!important } .es-content-body p, .es-content-body ul li, .es-content-body ol li, .es-content-body a { font-size:14px!important } .es-footer-body p, .es-footer-body ul li, .es-footer-body ol li, .es-footer-body a { font-size:14px!important } .es-infoblock p, .es-infoblock ul li, .es-infoblock ol li, .es-infoblock a { font-size:12px!important } *[class="gmail-fix"] { display:none!important } .es-m-txt-c, .es-m-txt-c h1, .es-m-txt-c h2, .es-m-txt-c h3 { text-align:center!important } .es-m-txt-r, .es-m-txt-r h1, .es-m-txt-r h2, .es-m-txt-r h3 { text-align:right!important } .es-m-txt-l, .es-m-txt-l h1, .es-m-txt-l h2, .es-m-txt-l h3 { text-align:left!important } .es-m-txt-r img, .es-m-txt-c img, .es-m-txt-l img { display:inline!important } .es-button-border { display:inline-block!important } a.es-button, button.es-button { font-size:20px!important; display:inline-block!important } .es-adaptive table, .es-left, .es-right { width:100%!important } .es-content table, .es-header table, .es-footer table, .es-content, .es-footer, .es-header { width:100%!important; max-width:600px!important } .es-adapt-td { display:block!important; width:100%!important } .adapt-img { width:100%!important; height:auto!important } .es-m-p0 { padding:0!important } .es-m-p0r { padding-right:0!important } .es-m-p0l { padding-left:0!important } .es-m-p0t { padding-top:0!important } .es-m-p0b { padding-bottom:0!important } .es-m-p20b { padding-bottom:20px!important } .es-mobile-hidden, .es-hidden { display:none!important } tr.es-desk-hidden, td.es-desk-hidden, table.es-desk-hidden { width:auto!important; overflow:visible!important; float:none!important; max-height:inherit!important; line-height:inherit!important } tr.es-desk-hidden { display:table-row!important } table.es-desk-hidden { display:table!important } td.es-desk-menu-hidden { display:table-cell!important } .es-menu td { width:1%!important } table.es-table-not-adapt, .esd-block-html table { width:auto!important } table.es-social { display:inline-block!important } table.es-social td { display:inline-block!important } .es-m-p5 { padding:5px!important } .es-m-p5t { padding-top:5px!important } .es-m-p5b { padding-bottom:5px!important } .es-m-p5r { padding-right:5px!important } .es-m-p5l { padding-left:5px!important } .es-m-p10 { padding:10px!important } .es-m-p10t { padding-top:10px!important } .es-m-p10b { padding-bottom:10px!important } .es-m-p10r { padding-right:10px!important } .es-m-p10l { padding-left:10px!important } .es-m-p15 { padding:15px!important } .es-m-p15t { padding-top:15px!important } .es-m-p15b { padding-bottom:15px!important } .es-m-p15r { padding-right:15px!important } .es-m-p15l { padding-left:15px!important } .es-m-p20 { padding:20px!important } .es-m-p20t { padding-top:20px!important } .es-m-p20r { padding-right:20px!important } .es-m-p20l { padding-left:20px!important } .es-m-p25 { padding:25px!important } .es-m-p25t { padding-top:25px!important } .es-m-p25b { padding-bottom:25px!important } .es-m-p25r { padding-right:25px!important } .es-m-p25l { padding-left:25px!important } .es-m-p30 { padding:30px!important } .es-m-p30t { padding-top:30px!important } .es-m-p30b { padding-bottom:30px!important } .es-m-p30r { padding-right:30px!important } .es-m-p30l { padding-left:30px!important } .es-m-p35 { padding:35px!important } .es-m-p35t { padding-top:35px!important } .es-m-p35b { padding-bottom:35px!important } .es-m-p35r { padding-right:35px!important } .es-m-p35l { padding-left:35px!important } .es-m-p40 { padding:40px!important } .es-m-p40t { padding-top:40px!important } .es-m-p40b { padding-bottom:40px!important } .es-m-p40r { padding-right:40px!important } .es-m-p40l { padding-left:40px!important } }
.es-wrapper-color(style='background-color:#FAFAFA')
Expand All @@ -63,10 +63,6 @@ head
table(cellpadding='0' cellspacing='0' width='100%' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px')
tr
td.es-m-p0r(valign='top' align='center' style='padding:0;Margin:0;width:560px')
table(cellpadding='0' cellspacing='0' width='100%' role='presentation' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px')
tr
td(align='center' style='padding:0;Margin:0;padding-bottom:20px;font-size:0px')
img(src='https://umiopo.stripocdn.email/content/guids/CABINET_2b907483313026d011fe1fd327aed97b/images/viasimplex.png' alt='Logo' style='display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic;font-size:12px' width='70' title='Logo' height='69')
table.es-content(cellpadding='0' cellspacing='0' align='center' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%')
tr
td(align='center' style='padding:0;Margin:0')
Expand All @@ -79,7 +75,7 @@ head
table(cellpadding='0' cellspacing='0' width='100%' role='presentation' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px')
tr
td(align='center' style='padding:0;Margin:0;padding-top:10px;padding-bottom:10px;font-size:0px')
img(src='https://umiopo.stripocdn.email/content/guids/CABINET_9ca3362f6e3ce2c3ea60da8fe4f8a850/images/78491618321704551.png' alt='' style='display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic' width='150' height='150')
img(src='https://edu-static-files.s3.us-east-2.amazonaws.com/forgot+password' alt='' style='display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic' width='150' height='150')
table.es-content(cellpadding='0' cellspacing='0' align='center' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%')
tr
td(align='center' style='padding:0;Margin:0')
Expand All @@ -97,28 +93,18 @@ head
br
br
p(style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:17px;color:#333333;font-size:14px")
| Welcome to Artifex! Your account is almost ready!
| Welcome to ONDC seller app, please use below OTP to login.
br
br
p(style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:17px;color:#333333;font-size:14px")
| As a next step, please login at the link below using the temporary password #{temporaryPassword}.
| OTP   #{ password }
br
br
|
a(href=appLoginUrl target='_blank' style='-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:underline;color:#00AFEF;font-size:18px') #{appLoginUrl}
p(style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:17px;color:#333333;font-size:14px")
| We recommend that you log in and change your password.
br
br
table.es-content(cellpadding='0' cellspacing='0' align='center' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%')
tr
td(align='center' style='padding:0;Margin:0')
table.es-content-body(bgcolor='#ffffff' align='center' cellpadding='0' cellspacing='0' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:600px')
tr
td(align='left' style='padding:0;Margin:0;padding-top:20px;padding-left:20px;padding-right:20px')
table(cellpadding='0' cellspacing='0' width='100%' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px')
tr
td(align='center' valign='top' style='padding:0;Margin:0;width:560px')
table(cellpadding='0' cellspacing='0' width='100%' role='presentation' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px')
tr

table.es-footer(cellpadding='0' cellspacing='0' align='center' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%;background-color:transparent;background-repeat:repeat;background-position:center top')
tr
td(align='center' style='padding:0;Margin:0')
Expand All @@ -131,4 +117,4 @@ head
table(cellpadding='0' cellspacing='0' width='100%' role='presentation' style='mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px')
tr
td(align='center' style='padding:0;Margin:0;padding-bottom:35px')
p(style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:18px;color:#333333;font-size:12px") 401, S No 30, Saraswati Ranta, Near Shashitara Vihar, Hingane Khurd, Pune Maharashtra 411051
p(style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:18px;color:#333333;font-size:12px")
1 change: 1 addition & 0 deletions notifications/app/lib/mailer/emails/sign-up/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SignUp extends Email {
name = `${user.firstName} ${user.lastName}`;
return {
temporaryPassword,
password:temporaryPassword,
name: name,
logo,
appLoginUrl,
Expand Down
2 changes: 1 addition & 1 deletion notifications/app/lib/mailer/emails/sign-up/subject.pug
Original file line number Diff line number Diff line change
@@ -1 +1 @@
= `Invitation to ARTIFEX from ${organization}`
= `Invitation to ONDC Seller APP`
Loading

0 comments on commit 7a326f7

Please sign in to comment.