|
1 | | -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). |
| 1 | +# Plain headless portal |
2 | 2 |
|
3 | | -## Getting Started |
| 3 | +This is a minimally styled example [Next.js](https://nextjs.org/) project demonstrating how you can use the Plain API to create a custom support portal. In the portal your customers can log in to: |
4 | 4 |
|
5 | | -First, run the development server: |
| 5 | +- Raise new support requests |
| 6 | +- View requests raised by anyone in their tenant |
6 | 7 |
|
7 | | -```bash |
8 | | -npm run dev |
9 | | -# or |
10 | | -yarn dev |
11 | | -# or |
12 | | -pnpm dev |
13 | | -# or |
14 | | -bun dev |
15 | | -``` |
| 8 | +## Getting Started |
16 | 9 |
|
17 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 10 | +In order to use this example you first need to have a workspace set up with [Plain](https://www.plain.com/) on at least the [Grow plan](https://www.plain.com/pricing). |
18 | 11 |
|
19 | | -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. |
| 12 | +Now you will need to create an API key for the support portal backend to authenticate with Plain. |
20 | 13 |
|
21 | | -This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. |
| 14 | +- Log in to Plain and go to `Settings -> Machine users` |
| 15 | +- Click `Add machine user` and fill in the details |
| 16 | +- You should be taken to your machine user, now click `Add API key` |
| 17 | +- Copy the permissions from below and click 'Paste permissions' |
| 18 | +- Fill in the description and save the key |
22 | 19 |
|
23 | | -## Learn More |
| 20 | +``` |
| 21 | +attachment:download,company:read,customer:read,customerGroup:read,customerGroupMembership:read,customerTenantMembership:read,email:read,label:read,labelType:read,note:read,roles:read,serviceLevelAgreement:read,tenant:read,tenant:search,thread:read,tier:read,tierMembership:read,timeline:read,user:read,workspace:read,threadField:read,threadFieldSchema:read,customer:create,customer:edit,thread:create,thread:edit |
| 22 | +``` |
24 | 23 |
|
25 | | -To learn more about Next.js, take a look at the following resources: |
| 24 | +Once you have your key you can get started: |
26 | 25 |
|
27 | | -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
28 | | -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
| 26 | +```bash |
| 27 | +npm install |
| 28 | +PLAIN_API_KEY=<your_key> npm run dev |
| 29 | +``` |
| 30 | + |
| 31 | +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
29 | 32 |
|
30 | | -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! |
| 33 | +## Screenshots |
31 | 34 |
|
32 | | -## Deploy on Vercel |
| 35 | +  |
33 | 36 |
|
34 | | -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. |
| 37 | +  |
35 | 38 |
|
36 | | -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
| 39 | +  |
0 commit comments