Manage environments
A user can belong to multiple organizations and an organization can have one or more environments. This article explains what an environment is and how to use environments in Prepr.
Introduction
An environment is an isolated container for your project, for example for a website or an app. An environment contains the schema, content items, media files, customer segments and users. When you have multiple environments, it allows you to safely test your project without affecting your production-ready content. Let's look at how to do this in more detail.
Create an environment
If you haven't already done so, go to https://signup.prepr.io/ (opens in a new tab) and sign up for a Prepr account. After you sign up, create an environment as follows:
- Click the Create environment button.
- Enter a meaningful Name for your environment. The URL will be generated automatically based on specified name.
- Select a Default locale for your project. Learn more about how to use locales in the Localization guide.
- Set the Development stage to either Development, Testing, Acceptance or Production according to your DTAP configuration.
- Click Create environment to confirm the settings.
Next, you’ll be prompted to load Prepr demo data or start from scratch.
-
Load Baking Community demo / Load Acme Lease demo. If you’re exploring Prepr we recommend loading demo data from either the Baking Community or the Acme Lease examples. They include examples for common use cases, like a blog and landing pages. Also, you'll get sample customer segments to try A/B testing and Personalization features in Prepr.
-
Start from scratch. If you’re setting up a Prepr environment with a specific project in mind, choose to start from scratch. This allows you to add models, components, and fields yourself.
Once you've made your choice, the environment is now ready for you to use. Check out the Users and Roles and permissions docs to manage additional users.
Set up a DTAP configuration
Many development teams use a DTAP (Development, Test, Acceptance and Production) configuration to manage their development, testing, acceptance and deployment to production. One of the first things that you need to decide before starting your project is your DTAP strategy. Your DTAP strategy will define how many environments you need to create.
1. Create your DTAP environments.
It's good practice to create one environment for each phase of your integration and deployment process as follows.
- Development - used by developers to freely test their initial development without affecting production-ready content and systems.
- Testing - used by testers to test the web site or app without affecting production-ready content.
- Acceptance - front-end users can QA the front-end in accordance with their requirements.
- Production - used by content editors to manage content, media files and to add adaptive content and run A/B tests.
When logged into one of your environments, you'll see a label at the top to highlight when you're not in Production.
2. Add your users.
Some basic user roles and permissions are available out of the box. If needed, set up additional user roles and add users for each environment. Check out the Users and Roles and permissions docs for more details.
3. Create a schema.
The production environment is used by content editors to maintain the content so this is where you create your schema first. Copy this schema to the other environments when needed for development and testing.
Check out the Sync schemas doc on how to synchronize the entire source schema.
If you only want to copy a couple of models and components, check out the Export/Import models and Export/Import components docs for more details.
4. Copy content.
Sometimes developers and testers need more realistic content to do their testing. In this case, you may want to copy the published content from one environment to another. As a developer you can do this by following the Export content process.
Environment setup for multiple brands
Prepr offers specific features to support multiple brands in an organization. We recommend that you create an environment per brand and manage your schema and content using the following features:
- Shared schema
- Shared content
Shared schema
Different brands often need different content, but it makes sense for an organization to keep the structure of all the content the same across their brands. In this case, it's useful to use the same schema across multiple environments. That's what we call a shared schema. This will also simplify and speed up development by enabling a leaner and more consistent code base.
To create a Shared schema do the following:
- Click the environment dropdown at the top right, choose your organization and click to open the environments overview.
- Click Shared schema to open the Schema Editor.
Now you can create models and components that will be shared by multiple environments within your organization. Check out the Create schema docs for more details.
Shared content
Sometimes, different brands want to share content within the same organization. For example, each brand creates their own articles, but these articles belong to common categories. This can be done with shared content.
To enable sharing of specific content, enable the toggle Allow items from all environments when you add the Content reference field to a model.
Check out the Create schema docs for more details.
Manage Environment settings
You can update your environment settings anytime by navigating to Settings → General. Here, you can rename your environment, change its timezone, interface language, and development stage.
Please note you must be an owner, admin or have the Environment permission to access the environment settings. Read more about roles and permissions in Prepr.
Was this article helpful?
We’d love to learn from your feedback