E-Commerce Website Project and Technologies used
Backend Project
Aganda:
- GitHub
- Backend
- client and server
- Request Response cycle
- Dev Env setup
- Intro to version control system
Tools:
- GitHub
- Intellij Ultimate
- Cloud Environment for deployment of project for global access
- Domains
- Register
- Showcase project to world
Skills required:
- OOPs, Concurrency, Advance Language
- LLD
- HLD
- Project - Practical mode of learning
Learning Trajectory:
- Basic Project
- OOPs, concurrency, Advance Language Concept
- LLD (D.P - [Design Pattern], Machine Coding)
- HLD
- Build more projects
- Project
- Building the project from basic requirement
- Deploy on AWS
- Metrics
- Mention in Resume
- How to mention improvement you have made to your project and saved time and handled traffic.
- Tech/Concept used and express them in your Resume:
- DBs
- APIs
- Cache etc....
- Microservices
- Spring Boot
- Complexity in project
- Payment Gateways implementation
Concepts will be learned during Prject building:
- VCS - Version control system
- Spring
- API's
- DB's
- Deployement(AWS)
- Payment flow
- Implement Basic Search
- Optimize project (Redis)
- Showcase in Resume
Skills to develop:
- Be worthy for Resume to showcase your project to world
- Become independent to google for solution or explanation for error and take your own path to solve the issue and learn from it and build your own skill set and learning trajectory.
- Know how to read a logs
- Google for error to understand the error and to find answer for solving it. (StackOverflow will help you, can use chatgpt as well to learn it but use it wisely)
- Make your own research to solve the issue
- Implement all concepts and make your own functionality in project to learn it nicely
Dev Env Setup:
- GitHub
- Java - 17 for entire porject as need to have compatibility with Spring as Java 17 is more stable and used by most of the industry giants and companies. Supported by AWS as well. As open JDK support is required for AWS EC2 instance to run the project
- Intellij Ultimate (IDE for project building)
- Need to install GitHub pack with license for accessing it.
- Install JetBrains ToolBox
- Intellij for IDE
- Subscribe to GitHub pack for easiness.
Backend and How system work:
UI is the one which we see in internet when accessing any server or website for information. This part of look is know as Frontend.
Layers of a website:
- UI Layer - Website of mobile app or any app look which we can use for interaction. This is part of Frontend. This will help to display data to client in convinient way and in organized way/user frindly manner of data representation. It don't own anydata.
- Resons :
- Security
- Storage issue
- Configuration of devices of client
- Data accuracy and correctness as client can modify the data if it own the data which is used only for data reading activity alone.
- Backend - Service or system which provide information to UI or help UI to fulfill business requirement. Where business logics are defined and used for usecase implementation and it own data and Storage is part of it.
- Storage - RDBMS/NO-SQL to store data.
Interaction sequence:
- UI layer is used by clients for interaction(Website/Mobile application/Application) - known as frontend part of application. They can be even of audio type like alexa, cortana etc. It is known as client as well. As it is asking for data.
- Frontend and Backend interact with each other via internet. Frontend will send request and backend will reply back to request with information. This process is known as request response cycle. eg: google search etc...
- Request and response cycle is also known as API calls.
- Backend system is consist of -
- Code
- Server
- DB's
- Monitoring systems
- deployment and other things according to project of application need.
- Backend system will take decision on request and will supply relevent information as response.
- Backend system is known as server as it have information and fulfill client requirement.
- CDN's (Content Delivery Network) - When you want to send data between two geographically seperated continents then by using interact it will take time to supply information and as a result lag will take place and content will do in buffer mode to fetch data and then will supply to client as a result client will notice performance issue to resolve this issue CDN's are created where a buffer server will be kept near to client and it will provide information to client without any delay as it will store retrienved information from original server to CDN's server and as these CDN's servers are near to client hence fetching data from it will not take any time and performance will be improved and will get rid of buffer issue and latency issue.
Version control system:
If multiple developers are working on same usecase of application development then it will cause issue to maintain code uniformity and will lead to ambiguity issue.
Issue:
As you can see above image we are having a code named as A.java. This A.java code has a bug in main function and this peace of code is getting fixed by Dev2 and in same time Dev1 is implementing new feature into existing code.
Now suppose Dev1 has completed his task first and saved information for the same in A.java file. Now Dev2 has also fixed the issue and want to store new code which is having same name A.java.
Now issue is that Dev1 code int sub() is present in Dev2 code fixed one. So if Dev2 will try to save his changes then definitely Dev2 changes will overwrite Dev1 changes and as a result company will loose new feature int sub() from code base.
This is the situation will occur when we are not using any version control system as one developer is not aware of another developer work and cannot track it and as a result will unknowlingly will cause code loss.
In this situation whoever will change A.java code first that developer work will be lost due to another person updation to existing same code.
Hence to avoid this issue we require version control system. As it will resolve this issue by merging the work of one developer work with another one and will provide code base without any loss.
Version Control System tasks:
- How to merge work of different developers in parallel without loosing there code.
- If anyone pushed bug code into code base and need to track it so that we can understand the mistake and to take care of it.
- Undoing the changes in an instance. Need to go back to previous state. Need to revert back.
Most widely used VCS is github.
Introduction to version controlling system:
Topics:
- GitHub
- Commits
- Branches
- Merge
- Alternatives
Types of Version Control System:
- Centralized
- Single point of contact and managing entire system from single point.
- Having central place where code of all developers are stored.
- Issues:
- Connect to server to have code access to modify it. eg: Google doc - Need internet to access it and modify it. Need to have internet connection all the time.
- Single point of failure, if server go down then it will not allow anyone to make changes to code and will even not provide code for reference, it will cause complete outage.
- Distributed
- Code of server can be copied to developer laptop as well as copy of code is available with them on there own system. It will help to overcome the single point of failure and will even allow to make changes to code without internet usage.
- complete code base is present in multiple machines.
- Steps to follow :
- Connect to server - require internet.
- Copy code from server to laptop.
- Do modification in laptop version of code.
- Push modified code to server so that other developers can use modified codes. It require internet connectivity.
- Advantages:
- No interenet needed all the time]
- No single point of failure
- Disadvantages:
- Download huge amount of code in your laptop even you want to modify only on code.
- Some example of DVCS - GitHub
How Git works:
- Commit - changes made in a code and will be pushed to server from remote system.
- Any change made by anyone in a code base whose version history is managed by Git.
- This code based whose history is maintained by Git is known as Git Repository (Git Repo).
- Git is like a linkedList, on every git commit new linked list node is created and added to GitRepo.
- Commands and demo of Git Bash:
- git init - to initialize the empty git repo over a location where git repo is initialized.
- git status - it will show the status of files which are present in Git Bash folder where this new code file is created in empty gitRepo. It will show red color for all files which are not tracked in git Repo. Green color entry for file means that file is not in track and can be pushed to got server.
- git add - it will allow you to add files which you need to add files to git repo.
- git commit -m 'valuable message which will explain the work done on code' - It will help you to know the history of code modification with valuable entries to track and to help you to know the right commit level which will be required for code recovery or modification.
- On each commit new node get added to gitrepo after pushing the code to server.
- git log --oneline to see all history of commit made to gitRepo
- Git properties
- Git commit is immutable - It will not allow you to role back your gitcommit, all messages will always going to be in history of the product. No never provide any secret information in git commit.
- Git allows you to go back in history and see how the code liked at that point of time. It will help you to roll back to right code where it will help you to modify the code for you.
- You can modify the code but you cannot change the commit associated with the code.
As per above example we can have two way to storing data with respect to commits.
- Store only difference and when want to see result at any commit point then construct the file with exact data which a developer want to see as entire code base.
- Advantage - less storage is needed.
- Disadvantage - It will take time to construct the code base for reference.
- To store entire data into on each commit so that you will get exact data on each commit point and don't need to construct the entire code base at the time of accessing specific code base.
- Advantage - Easy to see entire code at each stage.
- Disadvantage - It will cause storage issue.
Git Branch
Scenario: Branch means place where a developer can make changes to code in isolation.
Two developers A and B need to work on different tasks.
A - implementing calculator
B - implementing chat support
Git behaviour is to have all codes and their changes in central location but if any new developer want to work in isolation then he can create a branch and after testing his changes can merge his new branch changes to main repo.
Commands to make it:
- git branch <branch_name> - it will create a new branch which will have clone of existing main branch of code.
- git checkout <branch_name> - it will allow you to select your newly created or already existing specific branch.
Steps to follow to make a changes to any code.
- Create a new branch
- work on your changes to your new branch
- add
- commit
- push
- Merge
- Create new branch
- Do changes to branch
- Merge branch to main branch
- move to main branch - git checkout main
- ask git to merge the perticular branch to main branch.
- git merge calculato
Working behind these commands:
Git automatically create a new commit that has 2 parents.
- main
- calculato
If you are going to have same file with name in two branches with different contents in it then you need to resolve the conflict in the master branch and need to add new file to git and commit it out and for it you need to discuss it with developer to know if you can delete new data present in file or you need to keep it.
Spring and Spring Boot:
Topics to cover:
- Project Details
- Framework
- Why Spring
- Details about spring and spring-boot.
- Core concepts of Spring
- Dependency inversion
- Dependency injection
- Inversion of control
- MVC - Model view control
- Create first Spring boot application
Project Details:
Basic ecommerce platform.
eg: Flipkart:
- Authentication
- Searching Product
- Product Details
- Cart facility to add products in purchase list
- Payments
- Order Tracking
Tools and concepts required:
- Postman - Platform to test APIs.
- API - Mechanism to help frontend to access backend logic for fetching right information that connectivity is known as API. API expose backend logic to frontend. API full form is application programming interface. Concept of exposing and interaction is known as Request response cycle.
- Request response cycle - mechanism which allow frontend to interact with backend.
- IntelliJ Ultimate/VS Code - IDE for writing code and to build project.
What are frameworks and why do we need it?
Frequent things that software developer do -
- Develop APIs
- Interaction with Database (SQL, NoSQL, messaging Queues, Cache) In-short different types of datastore. Interaction with these datastores is a developer responsibility.
- Logging and Monitoring - It will help to monitor systems and load it is bearing at any time of point. It will help to note-down all details related to process in appropriate manner.
Implementation flow of any project starts with backend design then database and then frontend.
Framework will help you to build your project from scratch without bothering about creating code for most common works which a developer need to do for each and every project.
Framework advantages:
- easy to use
- efficient way of doing common things
Why to use Java and Spring boot for our project?
Java has dominance and then python.
Most common framework for Java is Spring-Boot.
Micro-Service
In a project we can have many services to work together to fulfil business demands.
Disadvantages of having tightly coupled services where every service will run from one single server or code.
- Single point of failure
- If any one service failed then it will lead other services as well to not run
- This type of coding is known as monolithic.
- To much code to read at a location making readability hard.
- As all services are clubbed together so you can't multiple languages for to build different services.
- As a result language usage will also become restricted.
Micro-Services advantages:
- Will allow to have multiple micro-services for respective service or business use-case.
- It will allow to use multiple language for services
- No single point of failure.
- It will use APIs for one service to communicate with other service.
- Each to maintain and don't need to read long codes in one place.
- If any one service is down it will not effect other service run.
- Can have different services deployed to different services.
- Will even help to distribute the load and allow to go for cheap hardware to perform the task without any issue.
- We can have isolated services as well.
- It provide flexibility to developer for choosing language of their choice.
- Help company to have multiple background people to work together on same project and allow them to complete their task independently.
Why Spring?
Go to framework for creating enterprise grade applications in Java.
- Scalable
- Secure
- Modulated
- Logging and Monitoring
Spring data is for interacting with database.
Spring Kafka is for Streaming.
Spring Auth for authentication.
All spring services will use Spring core this is a core modules which will be used by different services of Spring.
Challenges with Spring till 2015:
- Import Spring into your module/project
- XML for DB connection
- Difficult to configure
- Boring and Monotonous work
- Version compatibility issue for different modules - This problem is resolved by Spring Boot
Spring Boot advantages:
- Manage versions of different modules easily
- Maven repository java module or package controller and provide us all modules of Java for use. It is like pip for python.
- Spring boot will help to identify same version modules so that they are work together and will not have any compatibility issue.
- Basically same version modules are already tested by Spring Boot for compatibility.
- It will help developer to develop the project without bothering about the version of different modules.
Spring is Java framework and Spring Boot manages version of modules.
Spring Boot sets up default value for almost every config params. It help us to sort the dependency issue maintenance task. It auto fill entries with default values if available.
Spring Core:
It will help to perform dependency injection where you will define the dependency only over one location and will use it in different classes without any hesitation.
You can use constructor as well in place of using setter method.
Dependency Injection:
Instead of allowing class to create there own dependency objects in their class if we introduce dependency object from outside where this dependency entry is made only over one place then it will allow us to make changes easily and this mechanism is known as dependency injection.
If this same thing is made by Spring Boot for us then it is known as IOC(Inversion of control).
This is done by using annotations.
Topics:
- Create Spring Boot Application
- MVC
- API's
- Rest API's
- Intro to fake-store













Comments
Post a Comment