<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Manan Aggarwal on Medium]]></title>
        <description><![CDATA[Stories by Manan Aggarwal on Medium]]></description>
        <link>https://medium.com/@mananaggarwal2001?source=rss-f992849e0bc0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jM5MAGIdLtNhkbA07wONsA.jpeg</url>
            <title>Stories by Manan Aggarwal on Medium</title>
            <link>https://medium.com/@mananaggarwal2001?source=rss-f992849e0bc0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:55:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mananaggarwal2001/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Job Portal Application Development Process (Part 7)]]></title>
            <link>https://medium.com/@mananaggarwal2001/job-portal-application-development-process-part-7-fa6a07e357c0?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa6a07e357c0</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[java-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[spring-training]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 14:38:54 GMT</pubDate>
            <atom:updated>2024-07-16T14:38:54.212Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I will discuss, how I made the recruiter profile in my job portal application.</p><p><strong>The steps that are followed to create the recruiter profile are:-</strong></p><ol><li>Entity classes which are <strong>user, userTypes</strong> and <strong>recruiter profiles.</strong></li><li>Then made the repositories interface of the <strong>userType, user and recruiterprofile.</strong></li><li>Then made the service for the <strong>user</strong>, <strong>userType </strong>and <strong>recruiterprofile</strong>.</li><li>Controller classes for the <strong>Recruiter</strong> <strong>and user.</strong></li><li>Frontend Portion of the <strong>recruiter profile.</strong></li></ol><p>Let’s take a deep exploration of each step and what are the behind the scenes analogies of each step, So let’s start!!</p><h3>1. Entity classes which are <strong>user, userTypes </strong>and <strong>recruiter profiles.</strong></h3><p>Firstly, I made the user entity which consists of <strong>id, email, password, isActive, registration date and userTypeId </strong>that will become the columns of the user table.</p><p>Then I set the <strong>getters and setters </strong>for making it a <strong>POJO(Plain Old Javascript Object) class</strong> which, then be changed into the object with the help of <strong>Spring Jackson</strong>, then the data is sent to the controller for doing further stuff.</p><p>In this, I would like to discuss the <strong>ORM(Object Relation Mappings) </strong>which are used in this class.</p><p>Now I use the <strong>manyToOne</strong> ORM mapping in the user class. This mapping is generally used by one of the fields which is <strong>userTypeClass </strong>which contains the type of user that the particular user wants to become i.e <strong>JobSeeker or recruiter.</strong></p><p>The logic behind using this ORM mapping is <strong><em>one userType can have many users but the user can have only one userType which is the user can become either a recruiter or a jobSeeker.</em></strong></p><p>Then I made a <strong>constructor </strong>and <strong>ToString()</strong> method for printing the details in the console, without the ToString() method, you can’t print the whole class object in the console.</p><p>After that, I made the <strong>userTypeClass </strong>which consists of the <strong>ID and name </strong>of the type of users that we want.</p><p>In the <strong>userTypeClass the ORM </strong>which I used in this class is<strong> <em>@oneToMany </em></strong>for getting all the list of users that belong to this type category.</p><pre>@OneToMany(targetEntity = Users.class, mappedBy = &quot;userTypeId&quot;, cascade = CascadeType.ALL)<br>private List&lt;Users&gt; users;</pre><p>The above is the syntax for the <strong><em>@oneToMany annotation </em></strong>for getting the list of all users.</p><p>Then I made the <strong>recruiterProfile entity </strong>which consists of all the details which is completed by the recruiter after the user is logged in the job portal.</p><p>The <strong>recruiterProfile</strong> consists of many fields which are <strong>userAccountID, city, company, country, firstName, lastName, profilePhoto and state etc.</strong></p><p>Apart from these fields it also contains the <strong><em>@oneToOne </em>unidirectional mapping,</strong> which tells that <strong><em>each user who is a recruiter should have only one recruiter profile and due to this mapping not more than one profile is being allowed for the recruiter to generate.</em></strong></p><h3>2. Then made the repositories interface of the <strong>userType, user and recruiterprofile.</strong></h3><p>In this step, I made the repository interface for all of these 3 entity classes. The repository interface is a type of interface that will provide all of the crud operations for free and we don’t need to write the extra lines of code.</p><p>These extend the <strong>jpaRepository&lt;&gt;() interface </strong>that made it possible to do the crud operations for free.</p><p>I would like to show all the code snippets for the implementation of these crud operations.</p><pre>public interface UserRepository extends JpaRepository&lt;Users, Long&gt; {<br>    Optional&lt;Users&gt; findByEmail(String emailAddress);<br>    // leave it empty as jpa will provide the crud operation for free and for doing the further stuffs.<br>}</pre><pre>public interface UserTypeRepository extends JpaRepository&lt;UserType, Long&gt; {<br>        <br>}</pre><pre>public interface RecruiterProfileRepository extends JpaRepository&lt;RecruiterProfile, Integer&gt; {<br><br>}</pre><p>These all are the interfaces that extend the <strong>jpaRepository&lt;&gt;() interface, </strong>which will provide all the crud operations for free.</p><p>One speciality I want to define about these repositories is that when we define the external function in these repositories as we have defined in the first code snippet which is <strong><em>Optional&lt;Users&gt; findByEmail(String emailAddress) </em></strong>the speciality of the <strong>jpaRepository&lt;&gt;()</strong> is that they will perform fetching operation automatically according to the function provided in the interface. They will create a query and then perform that query on that particular database to fetch the required information.</p><p>This is all about the repositories which I want to deliver to you.</p><h3>3. Then make the service layer for the <strong>user</strong>, <strong>userType </strong>and <strong>recruiterprofile</strong>.</h3><p>Now you are thinking!! what is the work of this layer? well, this layer comes between the <strong>controller layer and the repository layer</strong> that holds all the business logic about what is genuinely happening in the backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zWnivRRZOWUNox-X.jpg" /></figure><p>As you can see in the above diagram the main architecture of the spring boot where the sequence of the layers in the spring boot is<strong> the controller layer, Service Layer, DAO repository layer and DB(database) Layer.</strong></p><p>Now, the main purpose of this layer is to hold the business logic and do the secure transaction of data between the <strong>controller and the repository layer </strong>so that the repository layer will send the response data back to the service layer after the communication with the database is finished.</p><p>The service layer will be provided with the annotation of <strong>@Service </strong>so that Spring will know that this is the service layer and lies between the <strong>controller layer</strong> and the <strong>repository layer</strong> for doing the data communication between the layers.</p><p>Now, I would like to discuss the classes that are used for making the <strong>service layer for the recruiter profile.</strong></p><h4>1. RecruiterService class file</h4><p>This RecruiterService class file contains all the business logic in the form of functions that <strong>are called by the controller</strong> for performing a certain amount of operations.</p><p>I would like to discuss these functions which are:-</p><ol><li>public optional&lt;RecruiterProfile&gt; findById(Integer Id)</li><li>public RecruiterProfile addNew(RecruiterProfile recruiterProfile)</li><li>public RecruiterProfile getCurrentRecruiterProfile()</li></ol><h4>1. public optional&lt;RecruiterProfile&gt; findById(Integer Id)</h4><p>This is the simple function which is used for finding the <strong>recruiterProfile</strong> by the ID which is passed in the function parameter. Now the code snippet is shown below:-</p><pre>public Optional&lt;RecruiterProfile&gt; findById(Integer id) {<br>    return recruiterProfileRepository.findById(id);<br>}</pre><h4>2. public RecruiterProfile addNew(RecruiterProfile recruiterProfile)</h4><p>This is also the simple function which is used for adding the recruiterProfile or updating the recruiter profile in the database. Now the code snippet is given below for adding new profiles.</p><pre>public RecruiterProfile addNew(RecruiterProfile recruiterProfile) {<br>    return recruiterProfileRepository.save(recruiterProfile);<br>}</pre><h4>3. public RecruiterProfile getCurrentRecruiterProfile()</h4><p>This function is used for fetching the current logged-in recruiter profile with the help of the <strong>SecurityContextHolder </strong>class which is a predefined class in Spring. This class is used for getting the username of the user who is currently logged in to the job portal application. Then with the help of the username, we fetch the user details by using the <strong>userRepository interface.</strong></p><pre>public RecruiterProfile getCurrentRecruiterProfile() {<br>    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();<br>    Optional&lt;RecruiterProfile&gt; recruiterProfile = null;<br>    if (!(authentication instanceof AnonymousAuthenticationToken)) {<br>        String currentUserName = authentication.getName();<br>        Users user = userRepository.findByEmail(currentUserName).orElseThrow(() -&gt; new UsernameNotFoundException(&quot;Couldn&#39;t find the Profile with this username&quot;));<br>        recruiterProfile = recruiterProfileRepository.findById(user.getId());<br>    }<br>    return recruiterProfile.orElse(null);<br>}</pre><h4>2. UserService class file</h4><p>Now I will discuss the functions that are used by me in the UserService class file which are:-</p><ol><li>public Users addNewUser(Users users)</li><li>public Object getCurrentUserProfile()</li><li>public Users getCurrentUser()</li><li>public user findByEmail(String currentLoggedInUser)</li></ol><h4>1. public Users addNewUser(Users users)</h4><p>This is the simple function which is used for adding a new user to the database according to the authority which is chosen by the user while doing the user registration.</p><pre>public Users addNewUser(Users users) {<br>    users.setActive(true);<br>    users.setRegistrationDate(new Date(System.currentTimeMillis()));<br>    users.setPassword(bCryptPasswordEncoder.encode(users.getPassword()));<br>    Users savedusers = userRepository.save(users);<br>    long userTypeId = savedusers.getUserTypeId().getUserTypeId();<br>    if (userTypeId == 1) {<br>        recruiterProfileRepository.save(new RecruiterProfile(savedusers));<br>    } else {<br>        jobSeekerProfileRepository.save(new JobSeekerProfile(savedusers));<br>    }<br>    return savedusers;<br>}</pre><h4>2. public Object getCurrentUserProfile()</h4><p>This function is also used for getting the current logged-in user and according to the authority of the user, the user profile is being returned which is either jobSeeker or the recruiter profile.</p><pre>public Object getCurrentUserProfile() {<br>    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();<br>    // to make sure that is user is not the anonymous user and the user should  be the valid logged in user.<br>    if (!(authentication instanceof AnonymousAuthenticationToken)) {<br>        String username = authentication.getName();<br>        Users users = userRepository.findByEmail(username).orElseThrow(() -&gt; new UsernameNotFoundException(&quot;Couldn&#39;t Found the username&quot;));<br>        Integer userId = users.getId();<br>        if (authentication.getAuthorities().contains(new SimpleGrantedAuthority(&quot;Recruiter&quot;))) {<br>            RecruiterProfile recruiterProfile = recruiterProfileRepository.findById((int) userId).orElse(new RecruiterProfile());<br>            return recruiterProfile;<br>        } else {<br>            JobSeekerProfile jobSeekerProfile = jobSeekerProfileRepository.findById(userId).orElse(new JobSeekerProfile());<br>            return jobSeekerProfile;<br>        }<br>    }<br>    return null;<br>}</pre><h4>3. public Users getCurrentUser()</h4><p>This is the same function for finding the current User who is currently logged in to the job portal application by using the <strong><em>SecurityContextHolder class.</em></strong></p><pre>public Users getCurrentUser() {<br>    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();<br>    if (!(authentication instanceof AnonymousAuthenticationToken)) {<br>        // for finding the current authenticated user for doing the things right.<br>        String currentUserName = authentication.getName();<br>        Users users = userRepository.findByEmail(currentUserName).orElseThrow(() -&gt; new UsernameNotFoundException(&quot;Couldn&#39;t find the Username For Doing the Things&quot;));<br>        return users;<br>    }<br>    return null;<br>}</pre><h4>4. public user findByEmail(String currentLoggedInUser)</h4><p>This is used for finding the profile of the user who is currently logged into the portal application.</p><pre>public Users findByEmail(String currentLoggedInUser) {<br>    return userRepository.findByEmail(currentLoggedInUser).orElse(null);<br>}</pre><h4>3. UserTypeService class file</h4><p>This class file contains only 1 function which is</p><h4>1. public List&lt;UserType&gt; getAll()</h4><p>This function is used for getting all the user Types.</p><pre>public List&lt;UserType&gt; getAll() {<br>    return userTypeRepository.findAll();<br>}</pre><p>This is all about the service and repository files which I used for creating the recruiter profile.</p><p>Now in the next blog, I would like to discuss one special feature which is how to upload and show a profile photo in the profile.</p><p>So Stay Tuned and follow me follow back!!!!</p><p>Till then bye bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa6a07e357c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job Portal Application Development Process (Part 6)]]></title>
            <link>https://medium.com/@mananaggarwal2001/job-portal-application-development-process-part-6-edcfd60cdf95?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/edcfd60cdf95</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 08:43:10 GMT</pubDate>
            <atom:updated>2024-07-16T08:45:37.049Z</atom:updated>
            <content:encoded><![CDATA[<p>In the previous blog, I discussed the configuration file, for filtering the security endpoints. Now I will discuss the login process that takes place while the users are trying to authenticate themselves.</p><p>As in the spring boot for doing the login process then the spring doesn’t require any additional endpoint for doing the login process. If we add the <strong>username and password </strong>in the <strong>name parameter of the input field</strong> then Spring will automatically pick that name field with the username and password then authenticate the user.</p><p>Generally, the login feature is already set in the spring configuration file as the login parameter was passed in the <strong>security filter chain for configuring the login feature. </strong>The login parameter requirements, which I used in this project are <strong>loginForm</strong> <strong>and successHandler.</strong></p><p>Let me show you this code snippet again as you still need to!!</p><pre>@Bean<br>public SecurityFilterChain securityFilterChain(HttpSecurity http, CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler) throws Exception {<br>    http.authenticationProvider(authenticationProvider()); // for letting know that how the spring will authenticate the users for doing the further work.<br>    http.authorizeHttpRequests(configuration -&gt; configuration.requestMatchers(publicUrl).permitAll()<br>                    .anyRequest().authenticated()).formLogin(form -&gt; form.loginPage(&quot;/login&quot;).permitAll()<br>                    .successHandler(customAuthenticationSuccessHandler))<br>            .logout(logout -&gt; logout.logoutUrl(&quot;/logout&quot;).logoutSuccessUrl(&quot;/&quot;))<br>            .cors(Customizer.withDefaults())<br>            .csrf(csrf -&gt; csrf.disable());<br>    return http.build();<br>}</pre><p>These 2 things, I used in this project to implement the login feature successfully.</p><p>Now I will explain in detail what these features do.</p><h4><strong>loginForm</strong></h4><p>This parameter is used for telling the spring that you have to use this login form for authenticating the user, not the default login form which the spring provides.</p><h4><strong>successHandler</strong></h4><p>This function is used for handling the process after the authentication procedure is done.</p><p>This function mainly contains the class which implements <strong>AuthenticationSuccessHandler</strong> <strong>interface</strong>.</p><p>This interface mainly contains one function which needs to be overridden in the class which is</p><blockquote>public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException</blockquote><p>This is the main function which needs to be implemented in the class. This function is used mainly for redirecting or giving a response to the user after the authentication procedure is done.</p><p>In this function, what I mainly did was to redirect the user to the dashboard which is either <strong>the</strong> <strong>recruiter or the job seeker. </strong>According to the profile position, necessary requirements are rendered on the main dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPH4eOE8MOWL7R4QwH7kgw.png" /><figcaption>Job Seeker Profile Dashboard</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwt_kdjFO1PF6Rrf3zihjA.png" /><figcaption>Recruiter Profile Dashboard</figcaption></figure><p>Now the code Snippet for the class which implements <strong>AuthenticationSuccessHandler interface </strong>is given below:-</p><pre>@Component<br>public class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandler {<br>    @Override<br>    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {<br>        String username = authentication.getName();<br>        System.out.println(&quot;The Username is :- &quot; + username + &quot; is logged in. &quot;);<br>        boolean hasJobSeekerRole = authentication.getAuthorities().stream().anyMatch(r -&gt; r.getAuthority().equals(&quot;Job Seeker&quot;));<br>        boolean hasRecruiterRole = authentication.getAuthorities().stream().anyMatch(r -&gt; r.getAuthority().equals(&quot;Recruiter&quot;));<br>        if (hasJobSeekerRole || hasRecruiterRole) {<br>            response.sendRedirect(&quot;/dashboard/&quot;);<br>        }<br>    }<br>}</pre><p>In this, I was just checking whether the role, the user has entered matches the existing role or not which is in the database, just for security purposes as the user is not trying to modify the role maliciously and then send the request to break the website which can cause the severe effects on the server.</p><p>When the handler successfully handles the request, then the user is redirected to the dashboard with the required things available for him according to the role which he chose.</p><p>This is all about the login feature, that is how the login feature works inside the spring boot in my project.</p><p>That’s all for this blog. In the next blog, I will discuss that, how I made the recruiter profile.</p><p>So stay tuned and follow me for follow back!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edcfd60cdf95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job Portal Application Development Process Part-5]]></title>
            <link>https://medium.com/@mananaggarwal2001/job-portal-application-development-process-part-5-7f30e42657c7?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f30e42657c7</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[development-and-growth]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 16:46:29 GMT</pubDate>
            <atom:updated>2024-07-14T16:50:04.934Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Programming isn’t about what you know; it’s about what you can figure out.</blockquote><p>In this blog, I will discuss the remaining 2 functions of the <strong>WebSecurityConfig </strong>file. So let’s start!</p><p>Now the remaining 2 functions are:-</p><ol><li>public BcryptPasswordEncoder bcryptPasswordEncoder()</li><li>public AuthenticationProvider authenticationProvider()</li></ol><p>The first function I have already explained in the previous blog so read that blog and then come to this blog.</p><h3>public BcryptPasswordEncoder bcryptPasswordEncoder()</h3><p>This function is mainly used for returning the bean related to the bcryptPasswordEncoder() as the bcryptPasswordEncoder doesn’t posses his own bean for doing the stuff, so we have to externally provide a bean for the spring to know that the bcryptPasswordEncoder exists.</p><p>The code snippet for the <strong>bcryptPasswordEncoder </strong>is given below:-</p><pre>@Bean<br>    public BCryptPasswordEncoder bcryptPasswordEncoder() {<br>        return new BCryptPasswordEncoder();<br>    }</pre><p>Now the next function which is</p><h3>public AuthenticationProvider authenticationProvider()</h3><p>The code snippet of this function is given below which is:-</p><pre>@Bean<br>public AuthenticationProvider authenticationProvider() {<br>    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();<br>    authenticationProvider.setPasswordEncoder(bcryptPasswordEncoder());<br>    authenticationProvider.setUserDetailsService(customUserDetailService);<br>    return authenticationProvider;<br>}</pre><p>Now, what is the requirement of this function in the configuration file?</p><p>Let me tell you the purpose of this function which is to tell the spring that <strong>what type of authentication we are using and how to authenticate users. </strong>It is basically the instructions that are given to the spring that to authenticate users you must use these things which are mentioned in this function.</p><p>Now let me explain these things line by line that what are things that I have used in this function to tell Spring that, you have to authenticate the user which is:-</p><h4><strong>1. DaoAuthenticationProvider()</strong></h4><p>It is the inbuilt class in the spring, whose main purpose is to authenticate the user by fulfilling the requirements which are needed by the function.</p><h4><strong>2. bycryptPasswordEncoder()</strong></h4><p>It is used for telling the spring that we are using this type of encoding feature for encoding the passwords and storing them in the database. Spring must use this encoding algorithm to match the password when the user tries to log into the account.</p><h4><strong>3. customerUserDetailsService()</strong></h4><p>This is important and also plays a major role in user authentication. This function tells the spring that, which fields will be used by the spring for authenticating the user.</p><p>During the user registration process, there are many columns in the data so this function is used for telling the spring, which column will the spring use for doing the user authentication.</p><p>This function is also used for telling the access level to be provided to that account, according to the position for which the user has registered.</p><p>The code snippet is given below.</p><pre>public class CustomUserDetails implements UserDetails {<br>    private final Users findedUser;<br><br>    public CustomUserDetails(Users findedUser) {<br>        this.findedUser = findedUser;<br>    }<br><br>    @Override<br>    public Collection&lt;? extends GrantedAuthority&gt; getAuthorities() {<br>        UserType userType = findedUser.getUserTypeId();<br>        List&lt;SimpleGrantedAuthority&gt; authorities = new ArrayList&lt;&gt;();<br>        authorities.add(new SimpleGrantedAuthority(userType.getUserTypeName()));<br>        return authorities;<br>    }<br><br>    @Override<br>    public String getPassword() {<br>        return findedUser.getPassword();<br>    }<br><br>    @Override<br>    public String getUsername() {<br>        return findedUser.getEmail();<br>    }<br><br>    @Override<br>    public boolean isAccountNonExpired() {<br>        return true;<br>    }<br><br>    @Override<br>    public boolean isAccountNonLocked() {<br>        return true;<br>    }<br><br>    @Override<br>    public boolean isCredentialsNonExpired() {<br>        return true;<br>    }<br><br>    @Override<br>    public boolean isEnabled() {<br>        return true;<br>    }<br>}</pre><p>Now this is the main code snippet which is used for doing the authentication, which tells about the columns which are used for doing the user authentication to spring and spring does all actions for authenticating the user then.</p><p>This is all about things that are mentioned in the configuration file for security purposes.</p><p>In the Next Blog, I will tell you about the login process which takes place while the user authentication process is going on.</p><p>Stay tuned for more updates and follow me follow back!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f30e42657c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job Portal Application Development Process (Part-4)]]></title>
            <link>https://medium.com/@mananaggarwal2001/job-portal-application-development-process-part-4-42cb5a9eb02c?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/42cb5a9eb02c</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-training]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring-boot-project]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 09:41:31 GMT</pubDate>
            <atom:updated>2024-07-11T09:54:44.506Z</atom:updated>
            <content:encoded><![CDATA[<p>As in the previous blog, I discussed the controller section of the registration form. Now I will discuss the security logic which I implemented in my project. So Let’s start!</p><p>First I have given the support for the security by adding the <strong>security dependency</strong> in the <strong>POM.xml file.</strong></p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><p>This dependency will ensure that Spring will support security, which will help in authentication and authorization of the user for doing their task and the chances of getting hacked will be minimal as most of the work is done by the Spring itself.</p><p>This dependency will automatically <strong>lock all the endpoints</strong> and provide the form for entering the <strong>login ID and password.</strong></p><p>Then the user will have to enter the login ID which is the <strong>user</strong> by default and the password which has to be copy-pasted by the user, which is generated by the <strong>spring itself in the command terminal,</strong> when the application is in running state.</p><p>Then I made the configuration file for configuring the security and filtering which endpoints, I have to secure and which endpoints are made to be publicly available.</p><p>First I made a configuration package for putting all the <strong>config files.</strong></p><p>Then I made the configuration file named <strong>WebSecurityConfig.java, </strong>which will hold all the security configuration information that which endpoints, I have to secure or which endpoints, I have to make publicly available.</p><p>This file contains a class which is as same name as the file name <strong>WebSecurityConfig and contains function names which are:-</strong></p><ol><li>public SecurityFilterChain securityFilterChain(HttpSecurity http, CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler).</li><li>public AuthenticationProvider authenticationProvider()</li><li>public BcryptPasswordEncoder byCryptPasswordEncoder()</li></ol><p>These are all the functions which are implemented in this configuration file. Now let me explain the workings of these functions.</p><h3>public SecurityFilterChain securityFilterChain(HttpSecurity http, CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler).</h3><p>This is the main function for filtering the endpoints that we have to make either <strong>free</strong> or <strong>secure</strong>.</p><p>This function contains the <strong>HttpSecurity</strong> and <strong>customAuthenticationSucessHandler</strong>. HttpSecurity is for handling the security and customAuthenticationSucessHandler is for handling the direction of the endpoint after the authentication of the user is successful.</p><p>Now <strong>customAuthenticationSucessHandler </strong>implementation is given below:-</p><pre>@Component<br>public class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandler {<br>    @Override<br>    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {<br>        String username = authentication.getName();<br>        System.out.println(&quot;The Username is :- &quot; + username + &quot; is logged in. &quot;);<br>        boolean hasJobSeekerRole = authentication.getAuthorities().stream().anyMatch(r -&gt; r.getAuthority().equals(&quot;Job Seeker&quot;));<br>        boolean hasRecruiterRole = authentication.getAuthorities().stream().anyMatch(r -&gt; r.getAuthority().equals(&quot;Recruiter&quot;));<br>        if (hasJobSeekerRole || hasRecruiterRole) {<br>            response.sendRedirect(&quot;/dashboard/&quot;);<br>        }<br>    }<br>}</pre><p>This implements the AuthenticationSucessHandler interface which contains the function which has to be implemented by default which is</p><p><strong>public void onAuthenticationSuccess(HttpServeletRequest request, HttpServeletResponse response, Authentication authentication)</strong></p><p>when the authentication of the user is successful then I redirect the user to the dashboard which is either the <strong>jobSeeker or recruiter</strong> dashboard based on the roles they want.</p><p>In this function, the String is made for fetching the name of the user who <strong>logged in</strong> to the account.</p><p>Then I check whether the particular user who logged in has mentioned his authority or not and if mentioned then I check the authority type <strong>mentioned is available or not.</strong></p><p>Then after doing all these things, I redirect the user to the dashboard if successful.</p><p>Now come back to the main function whose code snippet is shown below.</p><pre>@Bean<br>public SecurityFilterChain securityFilterChain(HttpSecurity http, CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler) throws Exception {<br>    http.authenticationProvider(authenticationProvider()); // for letting know that how the spring will authenticate the users for doing the further work.<br>    http.authorizeHttpRequests(configuration -&gt; configuration.requestMatchers(publicUrl).permitAll()<br>                    .anyRequest().authenticated()).formLogin(form -&gt; form.loginPage(&quot;/login&quot;).permitAll().successHandler(customAuthenticationSuccessHandler))<br>            .logout(logout -&gt; logout.logoutUrl(&quot;/logout&quot;).logoutSuccessUrl(&quot;/&quot;))<br>            .cors(Customizer.withDefaults())<br>            .csrf(csrf -&gt; csrf.disable());<br>    return http.build();<br>}</pre><p>In this function first I provided the <strong>authentication provider </strong>for telling the spring how to authenticate the user.</p><p>Then in the next line, I tell the spring how to authorize the incoming requests by giving the requirements for authorizing the request.</p><p>Let me discuss the functionality of the requirements, which I gave to the security for authorizing the incoming requests, which are as follows.</p><ol><li><strong>Request Matchers:- </strong>This will help the user control the behaviour of the security according to the pattern of the endpoints mentioned in this function which is either to be publicly available or to be authenticated first and then made available to the user.</li><li><strong>Form Login:- </strong>This will help to provide a custom form made by the user for authentication. This will overwrite the default form behaviour which is provided by the spring security itself for authentication.</li><li><strong>Sucess Handler:- </strong>This function will help in controlling the direction of the endpoint when the user is successfully authenticated.</li><li><strong>Logout:- </strong>This will provide the direction to the user in the logout procedure.</li><li><strong>Logout Success URL:- </strong>After successful logout, this function will control where to redirect the user.</li></ol><p>These are the main functions, that I discussed and also that are given by the authorisedHttpRequest function itself.</p><p>Now I will end this blog here as it is getting too long.</p><p>The rest of the functions, I will discuss in the next blog.</p><p>See you there in the next blog!</p><p>Thank You for reading and kindly upvote this if you liked my work.</p><p>Please ignore the grammatical mistakes if you found in the blog while reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42cb5a9eb02c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job Portal Application Development Process (Part 3)]]></title>
            <link>https://medium.com/@mananaggarwal2001/job-portal-application-development-process-part-3-bfb75d3c9e13?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfb75d3c9e13</guid>
            <category><![CDATA[spring-training]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 18:06:01 GMT</pubDate>
            <atom:updated>2024-06-23T18:06:01.940Z</atom:updated>
            <content:encoded><![CDATA[<p>As in the last blog, I discussed the service file that I used for user registration. Now I will discuss the controller file I used in this blog for user registration.</p><p>As far as doing the user registration the API points, which I made in this file for the registration of the user is <strong>/register, /register/new.</strong></p><h4><strong>/register</strong></h4><p>In this endpoint, this endpoint is responsible for serving the user registration form for the user with the <strong>userTypes</strong> to the users.</p><p>Now the coding part which is:-</p><pre>@GetMapping(&quot;/register&quot;)<br>public String showRegistrationForm(Model themodel) {<br>    List&lt;UserType&gt; userTypeList = userTypeServices.getAll();<br>    themodel.addAttribute(&quot;getAllRoles&quot;, userTypeList);<br>    themodel.addAttribute(&quot;user&quot;, new Users());<br>    return &quot;register&quot;;<br>}</pre><p>In this code snippet,</p><p>The List is formed for getting and storing all the user types to show in the frontend part of the registration form with the help of <strong>Spring MVC technology.</strong></p><p>Then the required data is sent in the frontend part for rendering the data and showing it to the user.</p><p>Now let me discuss the second endpoint which is.</p><h4><strong>/register/new</strong></h4><p>In this endpoint, the main motive for this endpoint is to store the user details in the database.</p><pre>@PostMapping(&quot;/register/new&quot;)<br>public String processRegistrationForm(@Valid @ModelAttribute(&quot;user&quot;) Users user, BindingResult bindingResult) {<br>    userService.addNewUser(user);<br>    return &quot;redirect:/dashboard/&quot;;<br>}</pre><p>In this above code snippet, we have used the <strong>UserService </strong>interface for adding the user to the database which I made and discussed in the previous blog.</p><p>Then after the operation is successful, I redirect the user to the dashboard which is the home page for the user.</p><p>Now this is enough for the registration controller part.</p><p>We will meet in the next blog with the new concept which I have used in this blog which <strong>security concept</strong> and will discuss it in detail. So just</p><h4><strong>Stay tuned!!</strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfb75d3c9e13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job Portal Application Development Process (Part 2)]]></title>
            <link>https://medium.com/@mananaggarwal2001/job-portal-application-development-process-part-2-88cff5cf3bc5?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/88cff5cf3bc5</guid>
            <category><![CDATA[java-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[projects]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Sun, 16 Jun 2024 16:49:09 GMT</pubDate>
            <atom:updated>2024-06-16T16:49:09.140Z</atom:updated>
            <content:encoded><![CDATA[<p>Now as in the last blog I told you about the repositories that I have made for the application which is <strong>job portal.</strong> Now I will discuss two features which is the<strong> service file which I have made for this user profile </strong>in the application. So pay attention and let’s go!!</p><h3>Service File</h3><p>The Service files which I have made in this application is <strong>userService and userTypeService.</strong></p><h4>UserService File</h4><p>In this file I made 4 functions which are:-</p><ol><li>addNewUser()</li><li>getCurrentUserProfile()</li><li>getCurrentUser()</li><li>findByEmail()</li></ol><h4>addNewUser(Users user)</h4><p>In this function, I have done coding for adding the new user to the database.</p><p>The database which is used in the application is <strong>mySQL</strong> database for storing the user information in the database.</p><p>Through the function, I passed the user object which is being prepopulated from the controller itself with the help of Spring MVC controller which is used in the controller section.</p><p>Now in this function I set all the requirements and then fetch the userType whether the userType which is either J<strong>obSeeker or Recruiter.</strong></p><p>What’s the point fetching the userType which is either <strong>jobSeeker or Recruiter ??</strong></p><p>I think you are also thinking about this! Now let me give you an answer which is that this profile is incomplete when we log in as the <strong>jobSeeker or Recruiter </strong>and due to the mapping we have to show the profiles according to the userType for completing their actions respectively.</p><p>The Recruiter will perform the different actions and jobSeeker will perform the different actions according to the userType assigned to them they will do their tasks either for <strong>hiring or job seeking.</strong></p><p>Now this is the only functionality of this function.</p><h4>getCurrentUserProfile()</h4><p>This is the next function which I have implemented in the UserService file.</p><p>The functionality of this function is to fetch the details about the logged-in user and then <strong>display them in the profile when the user is currently logged in.</strong></p><p>The code is a little bit tricky, so let me explain you what I have done in this code!!</p><pre>public Object getCurrentUserProfile() {<br>    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();<br>    // to make sure that is user is not the anonymous user and the user should  be the valid logged in user.<br>    if (!(authentication instanceof AnonymousAuthenticationToken)) {<br>        String username = authentication.getName();<br>        Users users = userRepository.findByEmail(username).orElseThrow(() -&gt; new UsernameNotFoundException(&quot;Couldn&#39;t Found the username&quot;));<br>        Integer userId = users.getId();<br>        if (authentication.getAuthorities().contains(new SimpleGrantedAuthority(&quot;Recruiter&quot;))) {<br>            RecruiterProfile recruiterProfile = recruiterProfileRepository.findById((int) userId).orElse(new RecruiterProfile());<br>            return recruiterProfile;<br>        } else {<br>            JobSeekerProfile jobSeekerProfile = jobSeekerProfileRepository.findById(userId).orElse(new JobSeekerProfile());<br>            return jobSeekerProfile;<br>        }<br>    }<br>    return null;<br>}</pre><p>In this code, I have done major things which as fetching the authentication details like which user is <strong>currently logged in to the website.</strong></p><p>After that, I checked whether the currently logged-in user either the original user or an anonymous user by using the condition which is shown in the code snippet above.</p><p>If the user is not an anonymous user then we further proceed to find the profile according to the userType which is as shown in the above code snippet.</p><p>Then we return the profile which is either <strong>jobSeekerProfile() or recruiterProfile()</strong></p><p>That’s it, As this function is doing this much only.</p><h4>getCurrentUser()</h4><p>This function is the same as the above function as this function is used for fetching the current logged-in user details and then passing it to the controller for further use.</p><h4>findByEmail()</h4><p>This is just used for returning the current Logged user to the controller.</p><p>Now that’s for all for this blog application</p><p>I will meet you in the next blog with the continuation of this blog for implementing the controller file for this application.</p><p>Till then Stay Tuned!!!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZkLVrTzEL9KniaWy" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88cff5cf3bc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job Portal Application Development Process (Part 1)]]></title>
            <link>https://medium.com/@mananaggarwal2001/job-portal-application-development-process-part-1-d76a100fb4d6?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d76a100fb4d6</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-security]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Wed, 05 Jun 2024 17:34:40 GMT</pubDate>
            <atom:updated>2024-06-05T17:35:15.554Z</atom:updated>
            <content:encoded><![CDATA[<p>Good evening everybody! this is your boy <strong>Manan Aggarwal </strong>and today I am going to discuss my application which I have developed under the guidance of my teacher <strong>Chad Darby. </strong>I will discuss every aspect of my application, its process, and the technologies that I have used in this project.</p><p><strong>Tech Stack Used:- </strong>Spring Boot, Spring MVC, Hibernate, Maven, Thymeleaf, MySQL, Spring Data JPA (Jakarta Persistence API), Spring Security etc.</p><p>Let me come straight to the point of how I started developing my application. I am here to recall all the things that I have used in this application when this application is in the process of development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZSSzi2AH_cY2blhC" /></figure><p>First I created the registration portion of this website</p><h3>Registration Portion</h3><p>In this portion, I created some entities which are <strong>Users</strong> and <strong>UserTypes </strong>so that these entities can store data directly into the database.</p><p><strong>Entity </strong>is the annotation that refers to the database table name connected to the class.</p><p>The user entity contains information about the user which includes <strong>Email,</strong> <strong>Password, isActive, RegistrationDate etc.</strong></p><p>This user also contains one <strong>ManytoOne </strong>annotation mapping which is mapping <strong>users </strong>to their respective <strong>user roles. ManyToOne </strong>is used in this case because one role can have many users but users can only have one role which is either <strong>Job seeker or recruiter.</strong></p><p>Here is the source code</p><pre>@Entity<br>@Table(name = &quot;users&quot;)<br>public class Users {<br>    @Id<br>    @GeneratedValue(strategy = GenerationType.IDENTITY)<br>    @Column(name = &quot;user_id&quot;)<br>    private int id;<br><br>    @Column(name = &quot;email&quot;, unique = true)<br>    private String email;<br><br>    @Column(name = &quot;password&quot;)<br>    @NotEmpty<br>    private String password;<br><br>    @Column(name = &quot;is_active&quot;)<br>    private boolean isActive;<br><br>    @Column(name = &quot;registration_date&quot;)<br>    @DateTimeFormat(pattern = &quot;dd-MM-yyyy&quot;)<br>    private Date registrationDate;<br><br><br>    @ManyToOne(cascade = CascadeType.ALL)<br>    @JoinColumn(name = &quot;user_type_id&quot;, referencedColumnName = &quot;user_type_id&quot;)<br>    private UserType userTypeId;<br><br>    public Users() {<br>        // default empty constructor for doing the further stuffs.<br>    }<br><br>    public Users(String email, String password, boolean isActive, Date registrationDate) {<br>        this.email = email;<br>        this.password = password;<br>        this.isActive = isActive;<br>        this.registrationDate = registrationDate;<br>    }<br><br>    public Integer getId() {<br>        return id;<br>    }<br><br>    public void setId(int id) {<br>        this.id = id;<br>    }<br><br>    public String getEmail() {<br>        return email;<br>    }<br><br>    public void setEmail(String email) {<br>        this.email = email;<br>    }<br><br>    public @NotEmpty String getPassword() {<br>        return password;<br>    }<br><br>    public void setPassword(@NotEmpty String password) {<br>        this.password = password;<br>    }<br><br>    public boolean isActive() {<br>        return isActive;<br>    }<br><br>    public void setActive(boolean active) {<br>        isActive = active;<br>    }<br><br>    public Date getRegistrationDate() {<br>        return registrationDate;<br>    }<br><br>    public void setRegistrationDate(Date registrationDate) {<br>        this.registrationDate = registrationDate;<br>    }<br><br>    public UserType getUserTypeId() {<br>        return userTypeId;<br>    }<br><br>    public void setUserTypeId(UserType userTypeId) {<br>        this.userTypeId = userTypeId;<br>    }<br><br>    @Override<br>    public String toString() {<br>        return &quot;Users{&quot; +<br>                &quot;id=&quot; + id +<br>                &quot;, email=&#39;&quot; + email + &#39;\&#39;&#39; +<br>                &quot;, password=&#39;&quot; + password + &#39;\&#39;&#39; +<br>                &quot;, isActive=&quot; + isActive +<br>                &quot;, registrationDate=&quot; + registrationDate +<br>                &quot;, userTypeId=&quot; + userTypeId +<br>                &#39;}&#39;;<br>    }<br>}</pre><p>After creating this user entity, I also created the userType entity which contains data for the type of user which is either <strong>Job Seeker or Recruiter.</strong></p><pre>package com.mananluvtocode.jobportal.entity;<br><br>import jakarta.persistence.*;<br><br>import java.lang.annotation.Target;<br>import java.util.List;<br><br>@Entity<br>@Table(name = &quot;users_type&quot;)<br>public class UserType {<br>    @Id<br>    @GeneratedValue(strategy = GenerationType.IDENTITY)<br>    @Column(name = &quot;user_type_id&quot;)<br>    private Long userTypeId;<br><br>    @Column(name = &quot;user_type_name&quot;)<br>    private String userTypeName;<br><br><br>    @OneToMany(targetEntity = Users.class, mappedBy = &quot;userTypeId&quot;, cascade = CascadeType.ALL)<br>    private List&lt;Users&gt; users;<br><br>    public UserType() {<br><br>    }<br><br>    public UserType(String userTypeName) {<br>        this.userTypeName = userTypeName;<br>    }<br><br>    public Long getUserTypeId() {<br>        return userTypeId;<br>    }<br><br>    public void setUserTypeId(Long userTypeId) {<br>        this.userTypeId = userTypeId;<br>    }<br><br>    public String getUserTypeName() {<br>        return userTypeName;<br>    }<br><br>    public void setUserTypeName(String userTypeName) {<br>        this.userTypeName = userTypeName;<br>    }<br><br>    public List&lt;Users&gt; getUsers() {<br>        return users;<br>    }<br><br>    public void setUsers(List&lt;Users&gt; users) {<br>        this.users = users;<br>    }<br><br>    @Override<br>    public String toString() {<br>        return &quot;UserType{&quot; +<br>                &quot;userTypeId=&quot; + userTypeId +<br>                &quot;, userTypeName=&#39;&quot; + userTypeName + &#39;\&#39;&#39; +<br>                &#39;}&#39;;<br>    }<br>}</pre><p>After that, I created the <strong>UserRepositories </strong>which is used for handling basic <strong>CRUD</strong> <strong>operations.</strong></p><p>Then I created the UserSerivces for providing the services to the controllers for doing the operations on the database as we don’t use these repository files directly into the controllers, through services we used these <strong>CRUD</strong> <strong>repositories files </strong>in <strong>controller files</strong> for doing operations.</p><p>As it is shown below</p><pre>public interface UserRepository extends JpaRepository&lt;Users, Long&gt; {<br>    Optional&lt;Users&gt; findByEmail(String emailAddress);<br>}</pre><p>That above is a user repository.</p><pre>public interface UserTypeRepository extends JpaRepository&lt;UserType, Long&gt; {<br><br>}</pre><p>Now this is a userType Repository File.</p><p>As we see, these files are extending the<strong> JpaRepository&lt;Class, PrimaryKeyDataType&gt;. </strong>Now this <strong>Jparepository&lt;&gt;</strong> is a gift of Spring Boot which provides the basic <strong>CRUD operations for free</strong> and it saves time also in development to prevent extra files and code headaches.</p><p>This <strong>JpaRepository&lt;&gt;</strong> also has the extended functionality which is when we write the function name inside the above interface which extends this repository. The powers of <strong>JpaRepository&lt;&gt;</strong> will automatically create a query according to the function name and will <strong>perform a query in a database</strong> <strong>behind the scenes</strong> and <strong>give results according to the function name mentioned in the interface.</strong></p><pre>public interface UserRepository extends JpaRepository&lt;Users, Long&gt; {<br>    Optional&lt;Users&gt; findByEmail(String emailAddress);<br>}</pre><p>Now in this code snippet above the function is written in the interface which extends <strong>JpaRepository. </strong>Now what this JpaRepository does that the JpaRepository will create a query like <strong>“Select * from Users where Email =:emailAddress” </strong>behind the scenes and then performs the execution of the query behind the scenes after that it gives the suitable result according to the query created from <strong>function name.</strong></p><p>Make sure the function name is correct in order to perform the execution of the query through <strong>JpaRepository without writing any extra amount of code for that function.</strong></p><p>This is the power of <strong>JpaRepository.</strong></p><p>After that let me also show you the Service file which I have used that is the <strong>UserService file</strong> for creating the services.</p><pre>package com.mananluvtocode.jobportal.services;<br><br>import com.mananluvtocode.jobportal.entity.JobSeekerProfile;<br>import com.mananluvtocode.jobportal.entity.RecruiterProfile;<br>import com.mananluvtocode.jobportal.entity.Users;<br>import com.mananluvtocode.jobportal.repository.JobSeekerProfileRepository;<br>import com.mananluvtocode.jobportal.repository.RecruiterProfileRepository;<br>import com.mananluvtocode.jobportal.repository.UserRepository;<br>import org.apache.catalina.User;<br>import org.springframework.beans.factory.annotation.Autowired;<br>import org.springframework.security.authentication.AnonymousAuthenticationToken;<br>import org.springframework.security.core.Authentication;<br>import org.springframework.security.core.authority.SimpleGrantedAuthority;<br>import org.springframework.security.core.context.SecurityContextHolder;<br>import org.springframework.security.core.userdetails.UsernameNotFoundException;<br>import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;<br>import org.springframework.stereotype.Service;<br><br>import java.util.Date;<br><br>@Service<br>public class UserService {<br>    private final UserRepository userRepository;<br>    private JobSeekerProfileRepository jobSeekerProfileRepository;<br>    private RecruiterProfileRepository recruiterProfileRepository;<br>    private final BCryptPasswordEncoder bCryptPasswordEncoder;<br><br>    @Autowired<br>    public UserService(UserRepository userRepository, JobSeekerProfileRepository jobSeekerProfileRepository, RecruiterProfileRepository recruiterProfileRepository, BCryptPasswordEncoder bCryptPasswordEncoder) {<br>        this.userRepository = userRepository;<br>        this.jobSeekerProfileRepository = jobSeekerProfileRepository;<br>        this.recruiterProfileRepository = recruiterProfileRepository;<br>        this.bCryptPasswordEncoder = bCryptPasswordEncoder;<br>    }<br><br>    public Users addNewUser(Users users) {<br>        users.setActive(true);<br>        users.setRegistrationDate(new Date(System.currentTimeMillis()));<br>        users.setPassword(bCryptPasswordEncoder.encode(users.getPassword()));<br>        Users savedusers = userRepository.save(users);<br>        long userTypeId = savedusers.getUserTypeId().getUserTypeId();<br>        if (userTypeId == 1) {<br>            recruiterProfileRepository.save(new RecruiterProfile(savedusers));<br>        } else {<br>            jobSeekerProfileRepository.save(new JobSeekerProfile(savedusers));<br>        }<br>        return savedusers;<br>    }<br><br>    public Object getCurrentUserProfile() {<br>        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();<br>        // to make sure that is user is not the anonymous user and the user should  be the valid logged in user.<br>        if (!(authentication instanceof AnonymousAuthenticationToken)) {<br>            String username = authentication.getName();<br>            Users users = userRepository.findByEmail(username).orElseThrow(() -&gt; new UsernameNotFoundException(&quot;Couldn&#39;t Found the username&quot;));<br>            Integer userId = users.getId();<br>            if (authentication.getAuthorities().contains(new SimpleGrantedAuthority(&quot;Recruiter&quot;))) {<br>                RecruiterProfile recruiterProfile = recruiterProfileRepository.findById((int) userId).orElse(new RecruiterProfile());<br>                return recruiterProfile;<br>            } else {<br>                JobSeekerProfile jobSeekerProfile = jobSeekerProfileRepository.findById(userId).orElse(new JobSeekerProfile());<br>                return jobSeekerProfile;<br>            }<br>        }<br>        return null;<br>    }<br><br>    public Users getCurrentUser() {<br>        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();<br>        if (!(authentication instanceof AnonymousAuthenticationToken)) {<br>            // for finding the current authenticated user for doing the things right.<br>            String currentUserName = authentication.getName();<br>            Users users = userRepository.findByEmail(currentUserName).orElseThrow(() -&gt; new UsernameNotFoundException(&quot;Couldn&#39;t find the Username For Doing the Things&quot;));<br>            return users;<br>        }<br>        return null;<br>    }<br><br>    public Users findByEmail(String currentLoggedInUser) {<br>        return userRepository.findByEmail(currentLoggedInUser).orElse(null);<br>    }<br>}</pre><p>Now for this blog, I would prefer to end this blog here only as it is getting too long in the next Part I will explain this service file and will discuss about the controller file which I have made for controlling the users profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j-BUcLZGmWdqWlRM" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d76a100fb4d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything you need to know about the STL (Standard Template Library) and algorithms in C++ for…]]></title>
            <link>https://medium.com/@mananaggarwal2001/everything-you-need-to-know-about-the-stl-standard-template-library-and-algorithms-in-c-for-72f68e8f0719?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f68e8f0719</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[cplusplus]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Sat, 20 Aug 2022 17:57:29 GMT</pubDate>
            <atom:updated>2022-08-20T17:57:29.500Z</atom:updated>
            <content:encoded><![CDATA[<h3>Everything you need to know about the STL (Standard Template Library) and algorithms in C++ for Competitive Programming Part 2</h3><p>Hello folks hope you are doing well in your coding journey. In the last blog I discussed the basic things that are <strong>arrays, what STL is and the type of STL etc.</strong></p><p>Today I will be discussing some more STL concepts So Let’s get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*aYNFB4fEPWfRUS71.jpg" /></figure><blockquote>Guidelines for what we are Discussing Today</blockquote><blockquote>1. Vectors</blockquote><blockquote>2. Intialization of Vectors.</blockquote><blockquote>3. Methods to Access the elements of the vectors</blockquote><h3><strong>Vectors</strong></h3><h4>What are Vectors ?</h4><p>Vectors are dynamic Arrays in which the size can be varied during the runtime of the program. They are just like arrays but this is something special which is loved by the competitive programmers the most but why the most you will see now 😉😉😉😉.</p><h3>Initialization of the vectors</h3><h4>Initialization of the 1-D vectors</h4><pre>// To intialize the 1-D vectors</pre><pre>vector&lt;datatype name&gt; variable-name;</pre><pre>// Example of intialization of the 1-D vector.<br>vector&lt;int&gt; vec;<br>vector&lt;string&gt; vec;<br>vector&lt;double&gt; vec;<br>vector&lt;char&gt; vec;<br>vector&lt;pair&lt;int,int&gt;&gt; vec;</pre><pre>we can also do the intialization for all type of primitive datatypes, derived datatypes etc.</pre><h4>Initialization of the 2-D vectors</h4><pre>// To intialize the 2-D vectors<br>vector&lt;vector&lt;datatype&gt;&gt; variable-name;</pre><pre><br>// Example of the intialization of the 2-D vector.<br>vector&lt;vector&lt;int&gt;&gt; vec;<br>vector&lt;vector&lt;string&gt;&gt; vec;<br>vector&lt;vector&lt;char&gt;&gt; vec;<br>vector&lt;vector&lt;double&gt;&gt; vec;<br>vector&lt;vector&lt;pair&lt;int,int&gt;&gt;&gt; vec; </pre><p>Likewise, we can also initialize the vectors for the 3-D, 4-D……n-D dimensions. Let’s take the example of how to initialize the 3-D vectors.</p><pre>// To intialize the 3-D vectors<br>vector&lt;vector&lt;vector&lt;data-type&gt;&gt;&gt; variable-name;</pre><pre>// Example of the intialization of the 3-D vectors.<br>vector&lt;vector&lt;vector&lt;int&gt;&gt;&gt; vec;<br>vector&lt;vector&lt;vector&lt;char&gt;&gt;&gt; vec;<br>vector&lt;vector&lt;vector&lt;string&gt;&gt;&gt; vec;<br>vector&lt;vector&lt;vector&lt;double&gt;&gt;&gt; vec;<br>vector&lt;vector&lt;vector&lt;pair&lt;int,int&gt;&gt;&gt;&gt;</pre><h3>Methods to access the elements of vectors</h3><h4>By the normal array or iterative approach</h4><pre>// How to access the elements of the vectors by the normal array method</pre><pre>vector&lt;int&gt; elementvector;<br>for(int i =0; i&lt;elementvector.size();i++){<br>      cout&lt;&lt;elementvector[i];<br>}</pre><pre><br>// for 2-D vectors to access the elements we have</pre><pre>for(int i=0; i&lt;elementvector.size();i++){<br>     for(int j=0; j&lt;elementvector.size(); j++){<br>         cout&lt;&lt;elementvector[i][j];<br>     }<br>}<br></pre><h4>By using the for-each loop iteration method</h4><pre>// How to access the element of the vectors by using the for-each method</pre><pre>// my favourite method for approaching the elements in the vectors.</pre><pre>vector&lt;int&gt; elementsvector;<br>for(auto it: elementsvector){<br>     cout&lt;&lt;it&lt;&lt;&quot; &quot;;<br>}</pre><pre><br><strong>// auto is the keyword in the C++ which automatically assign the datatype of the variable which is being used by the variable</strong></pre><pre><strong>// In 2-D vector accessing of the elements using the auto variable is easy take a look</strong></pre><pre>vector&lt;vector&lt;int&gt;&gt; dimensionalvector;</pre><pre><strong>for(auto it : dimensionalavector){<br>    for(auto element: it){<br>        cout&lt;&lt;element&lt;&lt;&quot; &quot;;<br>}<br>       cout&lt;&lt;endl;<br>}</strong></pre><pre><br>// In this the 2-D loop the first variable which is <strong>it</strong> is of the vector type which is 1-D vector.<br>// And the second variable <strong>element</strong> is of the type <strong>int </strong>which is accessing the <strong>element </strong>from the <strong>it</strong> vector and the <strong>element variable in the above example is used to display all the elements in the 2-D vector.</strong></pre><h4>By using the iterators</h4><p>As discussed in my previous blog the iterators are the reference to the elements in the container.</p><p><strong>How to initialize iterators and use them to access the element in the vectors which are:-</strong></p><pre>vector&lt;int&gt; elementvector<br>vector&lt;int&gt;::iterator it= elementvector.begin()</pre><pre>// This is used to point to the first element of the vector.<br>// How to iterate using the iterator <strong>it</strong>.</pre><pre>while(it!=end){</pre><pre>    cout&lt;&lt;(*it); // it is the pointer which points the element of  the vector now to access the elements of the vector we use it pointer.</pre><pre>}</pre><pre><br>// Another method for accessing the elements of the vectors by using the <strong>auto</strong> keyword.</pre><pre>for(auto it= elementvector.begin(); it!=elementvector.end();it++){</pre><pre>    cout&lt;&lt;(*it); </pre><pre>}<br>// as the auto keyword will detect the it variable which is of type pointer and refering to the element in the vector. </pre><p>This is all for the blog Now in the Next Blog we will discuss the methods used in the vectors and start the set container.</p><p>Now for knowing about the introduction of the STL and the iterators you can check out this blog</p><p><a href="https://medium.com/@mananaggarwal2001/everything-you-need-to-know-about-the-stl-standard-template-library-and-algorithms-in-c-for-8a924c3dbeab">Everything you need to know about the STL (Standard Template Library) and algorithms in C++ for…</a></p><p><strong>Follow me for Follow Back</strong></p><p><strong>Meet you in my next blog Soon Till then keep coding and keep growing…</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f68e8f0719" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything you need to know about the STL (Standard Template Library) and algorithms in C++ for…]]></title>
            <link>https://medium.com/@mananaggarwal2001/everything-you-need-to-know-about-the-stl-standard-template-library-and-algorithms-in-c-for-8a924c3dbeab?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a924c3dbeab</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[dreams]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Sun, 14 Aug 2022 20:21:02 GMT</pubDate>
            <atom:updated>2022-08-15T09:15:01.793Z</atom:updated>
            <content:encoded><![CDATA[<h3>Everything you need to know about the STL (Standard Template Library) and algorithms in C++ for Competitive Programming Part 1</h3><p>Hello, folks hope your coding life is going well. Now, this is an important blog for every competitive programmer who wants to get the offer in their dream company like <strong>google or Microsoft.</strong> I know those who are coding in C++ know the importance of STL as it plays an important role in getting jobs in our dream companies.</p><p>In this blog, I will tell you everything about STL from scratch to start your competitive programming journey to become a master in it.</p><p>Let’s get started</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*FsvCEMk5kE2rpfFC.jpg" /></figure><blockquote>Guidelines for what we are discussing today</blockquote><blockquote>1. What is STL ?</blockquote><blockquote>2. Types of STL</blockquote><blockquote>3. Arrays</blockquote><blockquote>4. Iterators</blockquote><h3>What is STL?</h3><p>STL are the predefined templates or data structures in C++ that can be used directly in the code for increasing <strong>the readability of the code.</strong> As it plays a huge role in competitive programming for applying all the data structures directly in the code whenever needed. Now we will discuss a little bit about the <strong>types of STL and then directly jump onto the most common STL that will be used in competitive programming.</strong></p><h3><strong>Types of STL</strong></h3><p>There are 4 types of STL.</p><ol><li><strong>Sequential Containers</strong></li><li><strong>Containers Adapters</strong></li><li><strong>Associative Containers</strong></li><li><strong>Unordered Associative Containers</strong></li></ol><p>Now I will give you only a short preview that what are these containers about then we will jump to the main topic which is <strong>how to use these containers in competitive programming.</strong></p><h4>1. Sequential Containers</h4><p>The containers that store the data in the container sequentially like <strong>Array, Vector, dequeue, List etc.</strong></p><h4>2. Containers Adapters</h4><p>The container adapters are those containers that don’t only stores the data efficiently but also put some constraints on it during the storage and retrieval process of the elements. <strong>Example:-</strong> <strong>stack, Queue and priority_queue. We will see about each and everything in detail in the upcoming blogs.</strong></p><h4>3. Associative containers</h4><p>Associative containers only store the sorted data in their containers because of these containers the data can be searched in a much more faster and efficient manner to provide you with the suitable output which you want.</p><p><strong>Example:- Set, multiset, map and multimap.</strong></p><h4>4. Unordered Associative containers</h4><p>As the name suggests the container which doesn’t have any order means the elements can be stored in random order and <strong>don’t follow the strict order to store the elements.</strong> As the elements are stored with the help of the hashing the searching can be done in <strong>O(1) time complexity best-case or O(n) time complexity worst-case.</strong></p><p><strong>Example:- unordered_set, unordered_map, unordered_multiset, unordered_multimap.</strong></p><p>As I have given a brief description of the types of containers now we will start with the main topic which is how to use these containers.</p><h3>3. Arrays</h3><h4>what are arrays ??</h4><p>Arrays are the collection of items with similar datatypes which is stored in the <strong>contiguous memory location.</strong></p><p>Now the normal declaration of the array as we all know is</p><pre>datatype arr[size];<br>// for example</pre><pre>int arr[30]; </pre><p>This declaration will reserve the 30 slots of the memory which is <strong>4 bytes each as an Integer takes 4 bytes each in the memory for storing values in memory. The memory is allocated during the declaration time only as it is a static declaration.</strong></p><p>Now come to Array STL which is also declared like this and it is also a <strong>static declaration because the size is fixed.</strong></p><h4>The syntax for the Array STL</h4><pre>array&lt;datatype , size&gt; variable_name;</pre><pre>// for example  </pre><pre>Array&lt;int , 30&gt; arr;</pre><ul><li>If we do not insert the values in it initially then it will contain the garbage value in it.</li><li>If we declare the <strong><em>array&lt;int, 30&gt; arr</em></strong> globally then all the values will automatically be initialised by 0.</li></ul><h4>Operation Perform in the Array STL</h4><ul><li><strong>arr.fill(element)</strong></li></ul><p>This operation is performed to fill the whole array with the given element which is passed as the function parameter in it when the array is declared locally otherwise it will take the garbage values in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*vUfmDoCmyyc-Mj0K-nF75Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/190/1*CvtNzGn9QahV5td6eR3KDg.png" /></figure><ul><li><strong>arr.at(index position)</strong></li></ul><p>It gives the value specified at a given index position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*aNKQsTU7F9HxdqOVMSKJkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*Isw1Q3TfSt_6VDOnQoK6CA.png" /></figure><ul><li><strong>arr.front()</strong></li></ul><p>It gives the value which is at the first position in the array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*WazsQbHXk5RJDQbs7kXZMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*dyW8w5hF9z_HIImXrPGpGQ.png" /></figure><ul><li><strong>arr.back()</strong></li></ul><p>It gives the value which is at the last position in the array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*_Q57IgZoTg7q2uBF3freww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*ck0Ipak9ys61iklZ9IvkZA.png" /></figure><ul><li><strong>arr.size()</strong></li></ul><p>It gives the number of the elements which is inserted in the array at present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*qjk9Daqg5_sEGXPmVP5iOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*k2JR9f3dRzWllZwR0tT7Pg.png" /></figure><p>This is all about the arrays Now the next topic is iterators <strong>which is the most important topic for the competitive programming.</strong></p><h3>4. Iterators</h3><h4>What are Iterators?</h4><p>Iterators are just like pointers which point to the element stored in the memory. We can access the iterators just like pointers. Most of the STL containers have the functionality of using iterators.</p><p>There are 4 iterators that we will be using in the competitive programming is:-</p><ul><li><strong>begin()</strong></li><li><strong>end()</strong></li><li><strong>rbegin()</strong></li><li><strong>rend()</strong></li></ul><h4><strong>begin()</strong></h4><p>This iterator will point to the first element in the required STL container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*lUe4u-LM4KNI7rSppkkNTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*ZB6qk0CfHz2x3PvAj-VmIw.png" /></figure><h4>end()</h4><p>This iterator will point to the element which is next to the last element in the container. i.e This iterator will point to the <strong>empty/garbage value in the STL container.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*c-H6B7wCl9sBtK-Od9ljSA.png" /></figure><p>This will give the output as the garbage value which is not present in an array which is <strong>32.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*svXlGrGN6yr19ZGUN4FlaA.png" /></figure><p>Now to access the last element of the array which is 100 in the given example <strong>simply subtract 1 from the iterator.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8cAv1ypanLZuxoWvlOHtsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*h07VXoOALXy-ANSE96uFyg.png" /></figure><h4><strong>rbegin()</strong></h4><p>This iterator means the reverse begin which points to the last element stored in the container. In this, we will not subtract 1 from the <strong>arr.rbegin() to get the last element.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jx3sMlONTwX35FTBODSSMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*RfyBvFtCL-1BhFtrrxme0A.png" /></figure><h4>rend()</h4><p>This iterator means the reverse end and the functionality is just the reverse of the end iterator discussed above. It points to the element <strong>which is just below the first element.</strong> Example:- if the first element at the index 0 which is always there then this iterator will point to the index -1 means to the <strong>garbage/ empty value in the container. Now to access the first element in the iterator then we have to add 1 in the arr.rend() to access the first element in the container.</strong></p><h4><strong>reverse_end iterator (rend()) is working abnormally?</strong></h4><p>Here it is jumping to the arbitrary value which is just next to the first element so we have to perform -1 in order to get the first element in the container.</p><p>Why this is happening I will tell you in the next part of my blog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIYgyqNUbTToSvm5dA_6-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*eBuM2U4yEpC5RZoxa0jiXw.png" /></figure><p>Now, this is all for <strong>Part 1</strong> in the next part we will discuss the vectors <strong>which are dynamic array, dequeue and List.</strong> So stay tuned to learn more.</p><p><strong>FOLLOW ME FOR FOLLOW BACK.</strong></p><p>If you want to learn more about the VS code features then check out this blog.</p><ul><li><a href="https://medium.com/@mananaggarwal2001/top-10-vs-code-extensions-used-for-making-your-web-development-journey-easy-faster-and-smoother-efca22e7e5b7">Top 10 VS Code Extensions Used For Making Your Web Development Journey Easy, Faster and Smoother</a></li><li><a href="https://medium.com/@mananaggarwal2001/top-5-killer-features-of-the-vs-code-and-my-favorite-features-of-all-the-times-that-make-my-life-49dd57438554">Top 5 killer features of the VS Code and My Favorite features of all the times that make my life…</a></li></ul><p>Meet you with my next blog till then keep learning and keep growing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a924c3dbeab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Honest Analysis of my medium Journey till now]]></title>
            <link>https://medium.com/@mananaggarwal2001/honest-analysis-of-my-medium-journey-till-now-8136e0384526?source=rss-f992849e0bc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8136e0384526</guid>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[100followerschallenge]]></category>
            <category><![CDATA[writer]]></category>
            <category><![CDATA[100-followers]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Manan Aggarwal]]></dc:creator>
            <pubDate>Fri, 12 Aug 2022 15:16:09 GMT</pubDate>
            <atom:updated>2022-08-12T15:16:09.470Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, folks hope you are doing well. Now I will tell you about my honest medium journey till now. So let’s get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*zxPEZw9vucto9ybm.jpg" /></figure><p>Now as I started my medium journey in February and then stopped because of my college started and then I started my medium journey again. Lastly, I stopped in May and then started in June again as the main reason was <strong>demotivation and procrastination which is the biggest hurdle for every writer when they have started writing on this platform in the beginning as we say the beginning was the hardest for every person’s life</strong>. As you can see a screenshot of my report is shared below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*fEj0dnegJog0A1cY8kzN7A.png" /><figcaption><strong>My Medium Analytics till now</strong></figcaption></figure><p>Now you can see the correct analytics of my medium journey till now I have earned about 379 Followers till now and growing continuously on this platform.</p><p>Now one question is arise in everyone’s mind about how I have achieved these <strong>three-figure followers within two months.</strong></p><h3>A Ray of hope</h3><p>When I stopped my medium journey then my friend started the medium journey and earned 100 followers within <strong>one month. </strong>I was shocked by seeing his massive speed of growth on this platform and if he can do this why can’t I?</p><p>Then In June, I started my medium journey again and <strong>break all the limits of getting followers</strong> and growth on this due to a technique that my friend followed on this platform which is</p><blockquote>Follow For Follow back</blockquote><p>This technique is really useful for amateur writers who want 100 followers as quick as possible and to start the real journey of the medium by accessing the <strong>medium partner’s program where they earn what they deserve.</strong></p><h3><strong>Hit the wall again</strong></h3><p>But sadly I can’t start my <strong>medium partner’s program because in India this program is not available now but the happiest moment was the love that is given by the followers to me and the motivation which is seen in the form of growth of followers on this platform.</strong></p><p>Thank you for showing this Love and support and I promise to give the best articles I can give. I will become a good writer and content creator one day.</p><p>Some of the people were telling me in my comment section that while writing blogs I tend to make grammatical errors and I have a poor vocabulary. I know this and thank you for raising this issue as I belong to India and usually speak in my mother tongue <strong>which is Hindi </strong>and didn’t have a habit of speaking English normal but I will develop this habit of speaking English and I will learn from my mistakes which I have done while writing the blogs till now.</p><p>Thank You For giving me this kind of love and support.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8136e0384526" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>