Move sample apps into samples/ and tidy up docs · bufferapp/buffer-sample-apps@09c0bd3 · GitHub
Skip to content

Commit 09c0bd3

Browse files
JustinaPetrclaude
andcommitted
Move sample apps into samples/ and tidy up docs
Move app-client-starter-app under samples/ and update CI, Dependabot and README paths to match. While here, fix the inconsistencies found in a review pass: - Remove references to docs that don't exist - Drop the app-level LICENSE so the root MIT license covers everything - Move CONTRIBUTING.md to the root and state what contributions we accept - Rename the npm package from buffer-app to app-client-starter-app - Describe the rate-limit handling as it actually works - Remove PORT from .env.example - Clarify a misleading test name and fixture - Add a samples table to the root README and clean up formatting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e005f1a commit 09c0bd3

28 files changed

Lines changed: 79 additions & 75 deletions

‎.github/dependabot.yml‎

Lines changed: 1 addition & 1 deletion

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
defaults:
1515
run:
16-
working-directory: app-client-starter-app
16+
working-directory: samples/app-client-starter-app
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: actions/setup-node@v4
2020
with:
2121
node-version: 22
2222
cache: npm
23-
cache-dependency-path: app-client-starter-app/package-lock.json
23+
cache-dependency-path: samples/app-client-starter-app/package-lock.json
2424
- run: npm ci
2525
- run: npm test
2626
- run: npm run lint

‎CONTRIBUTING.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Contributing
2+
3+
Thanks for helping improve the Buffer sample apps.
4+
5+
## What we accept
6+
7+
- **Pull requests for fixes and improvements** to the existing samples are welcome.
8+
- **New samples** aren't accepted at the moment. If you have an idea for one, please [open an issue](../../issues) instead.
9+
- **Bugs and suggestions** can be reported by [opening an issue](../../issues).
10+
11+
## Guidelines
12+
13+
- Keep each sample small and copyable. A change should teach one clear Buffer API practice.
14+
- Include a test when you change behavior.
15+
- Avoid adding frameworks or dependencies unless they make the example clearer.
16+
- Before opening a pull request, run the sample's checks. For the Node.js samples, that's `npm test` and `npm run lint`.
17+
- Never commit `.env` files, certificates, client secrets, sessions, or real tokens.

‎README.md‎

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,69 @@
11
# Buffer Sample Apps
2+
23
A collection of sample applications that show how to build on the Buffer API. Each sample is a small, self-contained project you can clone, run, and use as a starting point for your own build.
34

45
> **Note:** These samples are meant for learning and prototyping. Make sure to review and adapt them to your own security, error-handling, and scaling needs before using them in production.
56
6-
### Prerequisites
7-
7+
## Samples
8+
9+
| Sample | What it shows | Stack |
10+
| --- | --- | --- |
11+
| [App client starter app](samples/app-client-starter-app) | A third-party app that connects a Buffer account over OAuth 2.0 with PKCE, lists its channels, and adds a draft post to a channel's queue. | Node.js, Express |
12+
13+
## Prerequisites
14+
815
- A [Buffer](https://buffer.com) account
9-
- API access credentials - see the [Buffer developer docs](https://developers.buffer.com/guides/authentication.html) for how to get them
16+
- API access credentials. See the [Buffer developer docs](https://developers.buffer.com/guides/authentication.html) for how to get them.
1017
- Any language-specific tooling listed in the sample's own README
1118

1219
## Repository structure
13-
14-
Each sample app lives in its own folder with everything it needs to run:
15-
20+
21+
All sample apps live in the `samples/` directory. Each one has its own folder with everything it needs to run:
22+
1623
```
1724
.
18-
├── sample-app-name/
19-
│ ├── README.md # Setup and usage instructions for this sample
20-
│ ├── .env.example # Environment variables the sample needs
21-
│ └── ... # Source code
22-
├── another-sample/
23-
│ └── ...
25+
├── samples/
26+
│ ├── sample-app-name/
27+
│ │ ├── README.md # Setup and usage instructions for this sample
28+
│ │ ├── .env.example # Environment variables the sample needs
29+
│ │ └── ... # Source code
30+
│ └── another-sample/
31+
│ └── ...
32+
├── CONTRIBUTING.md
2433
├── LICENSE
2534
└── README.md
2635
```
2736

28-
### Run a sample app
29-
37+
## Run a sample app
38+
3039
1. Clone the repository:
31-
```bash
40+
41+
```bash
3242
git clone https://github.com/bufferapp/buffer-sample-apps.git
3343
cd buffer-sample-apps
34-
```
35-
44+
```
45+
3646
2. Move into the sample you want to try:
37-
```bash
38-
cd sample-app-name
39-
```
40-
47+
48+
```bash
49+
cd samples/sample-app-name
50+
```
51+
4152
3. Follow the setup instructions in that sample's `README.md`.
42-
Never commit your API credentials. Each sample reads them from environment variables - copy `.env.example` to `.env` and fill in your own values.
4353

54+
Never commit your API credentials. Each sample reads them from environment variables: copy `.env.example` to `.env` and fill in your own values.
4455

4556
## Resources
46-
57+
4758
- [Buffer developer docs](https://developers.buffer.com)
4859
- [Buffer Help Center](https://support.buffer.com)
4960

5061
## Contributing
51-
52-
These sample apps are provided as-is for educational purposes. They're maintained on a best-effort basis and aren't covered by Buffer's product support or service-level agreements.
5362

54-
We welcome issues and suggestions for improvements. If you spot a bug or have an idea for a new sample, please [open an issue](../../issues). At the moment we don't accept direct contributions of new samples.
63+
These sample apps are provided as-is for educational purposes. They're maintained on a best-effort basis and aren't covered by Buffer's product support or service-level agreements.
64+
65+
See [CONTRIBUTING.md](CONTRIBUTING.md) for what we accept and how to contribute.
5566

5667
## License
57-
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
5868

69+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

‎app-client-starter-app/CONTRIBUTING.md‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎app-client-starter-app/LICENSE‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

app-client-starter-app/.env.example renamed to samples/app-client-starter-app/.env.example

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ REDIRECT_URI=https://localhost:3000/callback
99
# the app generates one into .session-key on first boot. Required in production:
1010
# openssl rand -hex 32
1111
SESSION_SECRET=
12-
13-
PORT=3000
File renamed without changes.
Lines changed: 13 additions & 20 deletions

0 commit comments

Comments
 (0)