Hand-on | Building Microservices

Simple development of different microservices using Docker

Application for e-commerce Hub

REST API to support application features
    Express as web framework with Typescript
    Passport js for social authentication
    Express CORS enabled
    boom for error codes & Joi for Validation
    Winston for logging and express minitor for monitoring
    Mongoose as ODM driver
    eslint validation extending airbnb styleguide
    git hooks & CI/CD in place
    Typescript based compilation tsc compiler
    TDD in progress with Mocha
    JWT based authentication
    multiple Mongoose collection with referencing
    payment gateway Integration
    Heroku deployment
    Mini e-commerce platform

Cart Application

"It's just simple application to provide REST APIs for mini e-commerce platform where individual can buy products and can pay the bills
    microservices architecture
    Client application in React
    User Auth microservices
    Cart services
    Admin Microservices
1
# Application Execution
2
```javascript
3
git clone repo
4
npm install
5
npm run startdev
6
tsc -- watch
Copied!

Application configuration

1
env.sh need to be added locally
2
export NODE_ENV="dev"
3
export PORT="3005"
4
export MONGOURL="mongodb://mongo/hello"
5
export EXPRESS_SESSION_SECRET="************************"
6
export F_CLIENTID="**************"
7
export F_CLIENTSECRET="**********************"
Copied!

update etc/hosts file

1
##
2
# Host Database
3
#
4
# localhost is used to configure the loopback interface
5
# when the system is booting. Do not change this entry.
6
##
7
127.0.0.1 localhost
8
255.255.255.255 broadcasthost
9
::1 localhost
10
127.0.0.1 mysql redis mongo
11
127.0.0.1 ms-commerce.com
Copied!

Sevices end-point

Application NPM Script

1
"start": "cd dist && nodemon server.js",
2
"prestart": "tsc && cp -r uploads dist/ && cp -r app/global dist/app/",
3
"clean" : "rm -rf dist",
4
"copy" : "cp -r uploads dist/ && cp -r app/global dist/app/"
5
Copied!
Last modified 2yr ago