Tutorials
Commerce starter
This starter is a good choice if you want to explore how Uniform would work with a commerce scenario and you would like to see how marketers and merchandisers can build shopping experiences visually and personalize based on shopping context, interests and virtually any criteria. The starter represents a sample modern e-commerce storefront focusing on the shopping experience part.
About the starter#
This starter is implemented in Next.js 13, using React components, and includes:
- Live preview for all page types and in-line editing.
- Personalization powered by Uniform Context.
- A product catalog (using a mock product catalog API that you can replace with your own).
- Product detail pages.
- A shopping cart (implemented using a mock cart service).
Live demo#
Check out the live version of the Commerce starter.
Source code#
Here is the source code.
Why fake commerce?#
The starter relies on a FakeCommerce integration on Uniform. FakeCommerce is a headless-commerce service for demonstration purposes, and is installed with this starter. A developer will need to set up a running local development environment for FakeCommerce following the steps in the next section.
Replace FakeCommerce with your own headless commerce service during ongoing development.
Installation via CLI#
While you can git clone
this starter and set it up manually, Uniform recommends using the CLI if you have limited experience with Uniform.
Open a terminal, and navigate to where you want your local project to be created.
Run this in terminal or command line:
and enter the following values when prompted:
Prompt Response Can we open a browser window to get a Uniform auth token? Y Paste your Uniform auth token [hidden] [Paste in the value from your clipboard] Hey [username]! Choose a Uniform team for your new project [Select appropriate team name] Choose your preferred framework (Use arrow keys) [Choose Next.js or Nuxt] Choose one of the Uniform starters (for Next.js) (Use arrow keys) Hello World What's your project name? [Give a descriptive name for your project] About this step
This command performs a number of tasks for you:
- Creates a new Uniform project.
- Populates the Uniform project with sample content.
- Creates a new front-end application using your preferred framework connected to your new Uniform project.
- Starts the new front-end app locally.
Open your browser to http://localhost:3000 to access the front-end.
Next steps#
- Replace the FakeCommerce integration with one of the available commerce integrations.
- Implement the real cart functionality depending on the specific commerce engine API.
- Connect external data into one of the components.
- Add an integration for a system that's a part of your stack.
- Try out personalization.
- Deploy to your preferred delivery platform. Uniform offers special capabilities with some CDNs, such as edge-side personalization. Please refer to the list of CDN integrations.