Creating a User Profile
This guide will help you create User Profiles for your platformOS site.
For the sake of the tutorials in this section, we will assume that you want to build a marketplace which connects Developers (who build marketplaces) with Clients (who want to hire them). In order to display a different UI based on their role in the marketplace, you will create two profiles: developer and client.
To follow the steps in this tutorial, you should be familiar with the required directory structure for your codebase, and understand the concept of users.
Creating a User Profile is a two-step process:
- Create yml file
- Edit User Profile
Step 1: Create yml file
Create two yml files for the two User Profiles (developer and client) in the
marketplace_builder/user_profile_types directory. Name the files
Step 2: Edit User Profile
name: developer properties: - name: bio type: string - name: years_of_experience type: integer - name: hourly_rate type: float
name: the most important setting. Its snake case version is used in many places like Form Configuration and GraphQL.
properties: the heart of User Profiles, that allow you to specify Properties for the User Profile. They are used to build customized forms that gather user input during registration for later display. They take an array of elements that consist of name and type. To learn more, check our full Properties documentation.
Similarly, add content to the
client.yml User Profile:
Save your User Profiles.
Congratulations! You have created User Profiles. Now you can create a sign up form: