Skip to main content

Starter template

The starter template is a public repository with a small, complete integrated app: an appointment scheduler that books an appointment for a contact, confirms or cancels it and prepares the confirmation message for the conversation.

Use it to see how an app integrates with ConsulPoint in real code, and as a starting point for your own app: keep the base and replace the sample feature.

Repository: github.com/akui-solutions/consul-point-app-starter

Starter template Appointments screen, with upcoming appointments grouped by day
The template's appointment scheduler, in demo mode

Requirements: Node.js 20 or later and yarn or pnpm.

Run it locally​

You don't need an account. Demo mode works offline, with made-up data that is lost when you reload the page.

git clone https://github.com/akui-solutions/consul-point-app-starter.git
cd consul-point-app-starter
yarn install
yarn dev:mock

The terminal shows the address where it opens. To try the variants, add parameters to that address: ?theme=dark or ?language=en.

What it looks like​

All screenshots are from demo mode: the people and appointments are made up.

Starter template New appointment form, with two contacts suggested while typing
When booking, the app suggests contacts from the organization
Actions menu of an appointment in the template: Insert confirmation into the message, View contact, Add to Google Calendar, Edit appointment, Cancel appointment and Delete appointment
The actions for each appointment, including the ones requested from the platform
Template appointment scheduler in dark theme, at the width of a conversation's side panel
The same scheduler in dark theme, at the width of a conversation's side panel

What it teaches​

Each feature of the scheduler maps to one part of the integration.

What the app doesWhat it teachesRelated page
Opens with the user's language and themeReading the context the platform providesContext it receives
Records who booked each appointmentGetting the user's verified identityCalling the API
Keeps working after half an hourRenewing the session without reloadingCalling the API
Saves, edits and deletes appointmentsKeeping your own records in a data modelOwn data
Suggests contacts when bookingReading organization data with a permissionReference
Books even without that permissionTreating a missing permission as an unavailable feature, not as an errorCommon issuesUser guide
Inserts the confirmation into the message, opens the contact's record and opens an external linkAsking the platform for actionsCommunicating with the platform
Works offline with made-up dataWorking on the interface before you have an environmentTest

The repository's README.md file says which file each one is in. It's written in English, like the code comments; the app works in Spanish and English.

Create an app from the template​

The base stays as is; what changes is the feature.

  1. On the repository page, click Use this template and create a new repository. It gets the files, not the history, and it can be private.
  2. Change the name consul-point-app-starter in package.json, the default identifier in src/config/index.ts and the title in index.html.
  3. Replace the src/features/appointments/ folder with your own feature, keeping its shape: types, texts, logic and screen kept separate.
  4. Define the data models in MODELS.md and replace the made-up data in src/services/.
  5. Adjust the accent color in src/styles/tokens.css.

The src/services/ and src/config/ folders contain the communication with the platform and don't need changes to get started.

Publish it in ConsulPoint​

  1. Run yarn package. It generates a ZIP file with index.html at the root.
  2. Create the app with the Extension type and upload the ZIP as its first version.
  3. In the Models tab, create the appointment model with the schema from the MODELS.md file.
  4. In the Permissions tab, grant read access on Contacts. This is optional: without that permission, the person's name is typed by hand.

Each step is explained in detail in Publish.

What it includes besides the sample​

IncludesWhat for
Tests for the communication with the platformCatch a change that breaks the integration before publishing it
Tests for the sample featureServe as a model for your app's own tests
Code and formatting checksKeep the style consistent as the project grows
Continuous integration workflowRun checks, tests and the build on every proposed change

Best practices​

Keep the base

Change the sample feature first and leave the src/services/ folder for later: its tests pin down how the app talks to the platform.

License

The template is published under the MIT license: you can copy, modify and use it in your own projects.