To join the community Real Dev Squad, follow the instructions below and you will get the Discord Invite Link to join the server.
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.
- 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.
Fork the Template Repository from top right corner
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
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
Open the cloned repository in your local IDE (IntelliJ IDEA / Eclipse).
CHANGE STEPS FROM HERE
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
.
Run the code locally using the following command:
mvn spring-boot:run
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
After clicking, a new tab will appear something like below
There is a field called Enter Request URL
. Copy and paste the below URL
http://localhost:8080/health
You will be able to see a response body status: UP
Wohooo!!!! 🥳 🎉 🎉 Congratulations you have tested your first API.
Now, further test the remaining one API i.e. /profile
. Now we will be changing the Request URL to:
http://localhost:8080/profile
Click on the Send
button and you will get your own details that you have entered something like below.
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.
Cool, now that you have created your account, and logged in you will see your Heroku account dashboard something like below.
Click on New
and you will see dropdown having two options i.e. Create New App
and Create New Pipeline
Click on Create New App
Now, you will be directed to a new page where you have to create your new heroku app
Enter the valid app name as per your choice, make sure you have entered a name relevant to the app and available on Heroku.
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.
Now you will seeing your deploy section of the Heroku app as below.
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
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
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.
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.
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)
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).
You get to see something like the below form
Click on Generate Chaincode
, an alert will appear, click OK
to generate the chaincode.
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>
Now that you have pushed your code with the chaincode. Enter your deployed service URL here.
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.
Awesome, Congratulations 🥳 🎉 on becoming a user in Real Dev Squad and
**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