In software, when something is painful, the way to reduce the pain is to do it more frequently, not less. ― David FarleyNamaste Developers,
Deployment for learning purposes can sometimes be a tedious task. It was for me as a student because of the following reasons :
- Unsure about what changes to make in my code in order to deploy it?
- Where to deploy in order to not incur charges?
- How to connect back-end to front-end if deployed?
- Once Deployed how to we access the public IP for the front end.
- If working on MySQL, how to have an online database for free and connect that database to my backend application?
- Front end : Angular,HTML,CSS,Typescript.
- Back end : Spring Boot, Java , Hibernate
- Database: MySQL
- IDE and code editors : Eclipse(for java) and Visual Studio Code (for Angular).
What changes to make in our code in order to deploy it?
In angular if your code is ready and running well in local machine, we just need to run the command: ng build 'project name' without quotes from terminal window inside the working directory, where your project is present. This command creates an output folder named /dist in your working directory, where your project is present. This /dist folder is used by the online platforms, wherever you will deploy to run your front-end. If you want to read more about this command, you can visit ng build commandFor java backend As our backend is built over spring boot framework, which uses maven. Maven creates a folder named Target which is the output folder for our backend. The server on which we deploy our back-end application will read our files from this folder. For database, we do not need to make any changes, but we will be changing the database address in our backend application from local to an online server where we will be hosting our database as well as change the credentials that is username and password which will be discussed in detail when we host the database.
Where to deploy in order to not incur charges?
We will be making use of Heroku for back-end deployment and AWS free tier S3 bucket for front end deployment with a free online MySQL database hosting site for database deployment.How to connect back-end to front-end if deployed?
We will be using basic networking here. We know everything in internet communicates to each other based on IP addresses. So in our application, wherever we are communicating among front-end and back-end or back-end and database server. We will replace those addresses from localhost to the IP addresses/DNS address of the servers we are deploying our application i.e. front-end and back-end in. Basically we just need to find the piece of code where we are making a call to the backend and change the address from local to the deployed system's DNS or IP address. Simple! Isn't it?Last two questions will be answered as we deploy our website online in the next blog.
Stay Home Stay Safe !



Comments
Post a Comment