Creating a User Profile

Last edit:  Mar 02, 2019

Contributors:  szabosteve Slashek pavelloz diana-lakatos lemingos

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.

Requirements

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.

Steps

Creating a User Profile is a two-step process:

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 developer.yml and client.yml.

Step 2: Edit User Profile

marketplace_builder/user_profile_types/developer.yml

name: developer
properties:
- name: bio
  type: string
- name: years_of_experience
  type: integer
- name: hourly_rate
  type: float

Explanation:

  • 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:

name: client

Save your User Profiles.

Next steps

Congratulations! You have created User Profiles. Now you can create a sign-up form:

Questions?

We are always happy to help with any questions you may have. Check out our Help page, or contact us.