Designed a bill Tracking Application where users can keep track of their all kinds of bills like their grocery bills,their rent payment details ,their wifi bills, their food expenses.
- Node.js
- Express
- MySQL
- React
- AWS
- CircleCI
- Continous Integration
- Continous Deployment
- Microservices
- Infrastructure as Code
- Monitoring and Logging
-
Install Node.js in your application.
-
Install MySQl in your application.
-
Create databases db1 and in db folder mention your host and user.
-
Create two tabless users and bill.
-
Schema of Table bill is as given below: CREATE TABLE bill ( id varchar(255) NOT NULL, created_ts varchar(255) NOT NULL, updated_ts varchar(255) NOT NULL, owner_id varchar(255) NOT NULL, vendor varchar(255) NOT NULL, bill_date varchar(255) NOT NULL, due_date varchar(255) NOT NULL, amount_due varchar(255) NOT NULL, categories varchar(255) NOT NULL, payment_status ENUM('paid', 'due', 'past_due', 'no_payment_required') NOT NULL, FOREIGN KEY (owner_id) REFERENCES users(id) );
-
Schema of table user is: CREATE TABLE bill ( id varchar(255) NOT NULL, firstName varchar(255) NOT NULL, lastName varchar(255) NOT NULL, email varchar(255) NOT NULL UNIQUE, password varchar(255) NOT NULL, accountCreated varchar(255) NOT NULL, accountUpdated varchar(255) NOT NULL, );
-
Schema of table file is: CREATE TABLE file ( file_name varchar(255) NOT NULL, id varchar(255) NOT NULL UNIQUE, url varchar(255) NOT NULL, upload_date varchar(255) NOT NULL );
8.Schema of table metaFile is: CREATE TABLE metaFile ( field_name varchar(255) NOT NULL, original_name varchar(255) NOT NULL, encoding varchar(255) NOT NULL, mimetype varchar(255) NOT NULL, destination varchar(255) NOT NULL, file_name varchar(255) NOT NULL, path varchar(255) NOT NULL, size varchar(255) NOT NULL, id varchar(255) NOT NULL, FOREIGN KEY (id) REFERENCES file(id) );
- Schema of table bill is changed and a cloumn attachment of type json was added: ALTER table bill ADD column attachement json Code
- Install dependencies mentioned in package.json. These should be installed by going in webapp folder.Those include: { "aws-sdk": "^2.627.0", "basic-auth": "^2.0.1", "bcrypt": "^3.0.7", "body-parser": "^1.19.0", "chai": "^4.2.0", "chai-http": "^4.3.0", "cors": "^2.8.5", "dotenv": "^8.2.0", "email-validator": "^2.0.4", "express": "^4.17.1", "mocha": "^7.0.1", "multer": "^1.4.2", "multer-s3": "^2.9.0", "mysql": "^2.17.1", "node-statsd": "^0.1.1", "password-validator": "^5.0.3", "sqs-consumer": "^5.4.0", "uuidv4": "^6.0.2", "winston": "^3.2.1" }
- Do git clone of the repository.
- go to webapp_node folder.
- Do npm install or npm run build: This will install all dependecies required for your application.
- Run node server.js and application will run.
- go to webapp_node folder.
- Just check in package.json in script object there is a property "test:mocha".
- Run npm run test command to run test cases.
- Demo purpose.
- Build ami.Run ami repository and circleCi will generate ami in dev and prod account.AMI will be generated in dev account and will be shared in prod account. This happens because in CicrcleCI we have environment variables of dev account.
- Run cloudformation stack then of infrastructure repository: Command is: aws cloudformation --profile prod create-stack --stack-name stack --parameters file://vars.json --template-body file://autoScaling.json --capabilities CAPABILITY_IAM
- After that build this webapp folder. Continous Integration is done using CircleCI. In circleCI enter environment variable of prod account: enter secret_key(AWS_SECRET_ACCESS_KEY), access_key(AWS_ACCESS_KEY_ID), region(AWS_REGION) and s3 bucket name(BUCKET_NAME).Tis bucket is created manually using AWS concole. This bucket creation is not present in cloudformation. Creating a pull request will only run test cases in CircleCI merging a pull request will deploy the app.
- webapp_node folder contains all code of APIS
- Scripts folder contains all scripts needed to execute codeDeploy.
- appspec.yml species how CodeDeploy will deploy app.
- jmeter folder has jmeter test to run post api of bill 500 times.
- .cicrlceci folder has the yml file that circleCi will execute.
- Content Delivery Network: CDN georaphically distributed web servers for high availability of content.It can be your images,videos, assets of application and javascript files etc. AWS cloudfront service allows implementing CDN. It has different edge locations which are geographically distributed web servers and all users close to that edge location gets content from that edge location. It increases performance and helps in delievering the content faster.
- Implementing Email correct functionality of Gmail users.
- DB cache: