Skip to content

rohan09-raj/profile-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Profile Service

To join the community Real Dev Squad, follow the instructions below and you will get the Discord Invite Link to join the server.

What are you building?

Profile Service is your own service which will be deployed and verified by you with the help of some precreated APIs and contains all the relevant data of yours, used for building your profile and getting yourself a identity in Real Dev Squad. This service will be maintained by you throughout the term of your journey in Real Dev Squad.

Profile Service Summary

  • User Profile Service consists of 3 APIs /health, /profile and /verification
  • The provided is a template for creating your own JAVA backend of the profile service.
  • This service is used by Real Dev Squad to connect and help new people come aboard to learn development.

Endpoints

  • /health checks whether the server is up and running
  • /profile returns data of the user to whom profile service belong to. It is a protected API so that no one can steal your information.
  • /verification API returns a hash (a unique string) to verify your profile based on the special chaincode generated by user at identity service.

Pre-requisites

Steps to Follow :

Step 1:

Fork the Template Repository from top right corner image

Step 2:

Create a new fork, ensure that Owner is selected as your GitHub username and repository name can be named as :

<YOUR_NAME>'s-profile-service

Example : rohan's-profile-service

image

Step 3:

Now when you have forked the repository. Clone the template repository using the below command in your command terminal

git clone https://github.com/rohan09-raj/profile-service

Step 4:

Open the cloned repository in your local IDE (IntelliJ IDEA / Eclipse).

CHANGE STEPS FROM HERE

Step 5:

Now that you have the code in your local. Next thing to do is: Complete all the TODOs present in the repository except one i.e. Paste your Chaincode here. We will do this remaining part in Step-15.

Step 6:

Run the code locally using the following command:

mvn spring-boot:run

Step 7:

After you have started your JAVA application running, go to Postman, ensure that you are logged in. On Home page, you will be able to find Send Request button as shown below. Click on it image

After clicking, a new tab will appear something like below image There is a field called Enter Request URL. Copy and paste the below URL

http://localhost:8080/health

Then, click on Send button image

You will be able to see a response body status: UP image

Wohooo!!!! 🥳 🎉 🎉 Congratulations you have tested your first API.

Step 8:

Now, further test the remaining one API i.e. /profile. Now we will be changing the Request URL to:

http://localhost:8080/profile

image

Click on the Send button and you will get your own details that you have entered something like below.

image

Step 9:

Great 🎉 🎉, you have tested your APIs successfully, now we need to host your service, so that you can verify your Real Dev Squad account. You can host your service on any dynamic hosting platforms. We will be using Heroku here, so make sure to create an account on Heroku.

Step 10:

Cool, now that you have created your account, and logged in you will see your Heroku account dashboard something like below. image

Click on New and you will see dropdown having two options i.e. Create New App and Create New Pipeline image

Click on Create New App

Step 11:

Now, you will be directed to a new page where you have to create your new heroku app image

Enter the valid app name as per your choice, make sure you have entered a name relevant to the app and available on Heroku. image

Then click on Create App. Wohoo!! you have successfully created your Heroku app, now you have to deploy the code in your local to Heroku.

Step 12:

Now you will seeing your deploy section of the Heroku app as below. image

In the middle of the page, you will be able to see various deployment methods like Heroku Git or GitHub etc. You can use either of them, mostly we use Heroku Git or GitHub one.

If you select Heroku Git, there will be instructions given just below the options to execute in your Terminal/Command Line Interface

Follow the instructions as per in the given order image

After you have run this command git push heroku master Wait for few minutes or seconds to get the deployment done Awesome 🥳 🎉, your service is deployed and you can access your deployed service with the provided url by Heroku

Step 13:

Now, comes the part where you will link your profile service with your Real Dev Squad account. Go to Real Dev Squad website and click on Sign In With GitHub button in the navbar as shown below. image Link your GitHub account, and complete the SignUp steps. Note : Only for users who don't have an account on Real Dev Squad website or who haven't linked their GitHub account on Real Dev Squad website.

Step 14:

Go to My Site or you can simply click the user greeting as shown below (this is after you have Signed In with your GitHub account) image

Once you landed on my-site, you will have to go to Identity Tab (P.S. you can directly click on this hyperlink to get you to the desired page).

Step 15:

You get to see something like the below form image

Click on Generate Chaincode, an alert will appear, click OK to generate the chaincode. image

Click on Copy to copy the chaincode and paste it where a TODO was left, mentioned in Step-5 now when the changes are done. Check that everything looks good and all the TODOs are complete. Run these commands in your terminal to push the code to your deployed service through the Heroku CLI git add . git commit -am "<ENTER_YOUR_COMMIT_MESSAGE>" git push heroku master If you were using the second method of GitHub to deploy your service git add . git commit -am "<ENTER_YOUR_COMMIT_MESSAGE>" If your branch name is master then use this git push origin master Otherwise, git push origin <ENTER_YOUR_BRANCH_NAME>

Step 16:

Now that you have pushed your code with the chaincode. Enter your deployed service URL here. image

And click on Save. After that Check the checkbox to ensure that you have done both the steps correctly. Then, click on Link Chaincode. Woooh, now wait for few seconds or minutes to get your service verified by the Real Dev Squad service. Once you are verified you will get to see a verification message that your verification is completed. image

Awesome, Congratulations 🥳 🎉 on becoming a user in Real Dev Squad and

Welcome to Real Dev Squad 🥳 🎉

**Note : ** If you are unable to verify your service or their are some errors that you get encountered. Please reach out to members of Real Dev Squad from here

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages