Skip to content

Commit b0f68e0

Browse files
authored
Initial commit
0 parents  commit b0f68e0

File tree

11 files changed

+1016
-0
lines changed

11 files changed

+1016
-0
lines changed

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Server port - The port on which the application will run (default: 3000)
2+
PORT=3000
3+
4+
# App package name - Your application's unique identifier. Make sure it exactly matches the package name in the MentraOS Developer Console
5+
PACKAGE_NAME=org.yourname.appname
6+
7+
# API key - Your MentraOS developer API key from the MentraOS Developer Console (never commit the key to source control)
8+
MENTRAOS_API_KEY=your_api_key_here
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"on":
2+
push:
3+
branches:
4+
- main
5+
name: Deploy to camera-photo-example
6+
jobs:
7+
porter-deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
- name: Set Github tag
13+
id: vars
14+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
15+
- name: Setup porter
16+
uses: porter-dev/setup-porter@v0.1.0
17+
- name: Deploy stack
18+
timeout-minutes: 30
19+
run: exec porter apply -f ./porter.yaml
20+
env:
21+
PORTER_APP_NAME: camera-photo-example
22+
PORTER_CLUSTER: "4689"
23+
PORTER_DEPLOYMENT_TARGET_ID: 4a24a192-04c8-421f-8fc2-22db1714fdc0
24+
PORTER_HOST: https://dashboard.porter.run
25+
PORTER_PR_NUMBER: ${{ github.event.number }}
26+
PORTER_PROJECT: "15081"
27+
PORTER_REPO_NAME: ${{ github.event.repository.name }}
28+
PORTER_TAG: ${{ steps.vars.outputs.sha_short }}
29+
PORTER_TOKEN: ${{ secrets.PORTER_APP_15081_4689 }}

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.env
2+
node_modules/
3+
bun.lock
4+
.DS_Store
5+
*.log
6+
# VSCode
7+
.vscode/
8+
# Mac system files
9+
.DS_Store
10+
# Logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Mentra Community
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# MentraOS-Camera-Example-App
2+
3+
This is a simple example app which demonstrates how to use the MentraOS Camera API to take photos and display them in a webview.
4+
5+
You could also send the photo to an AI api, store it in a database or cloud storage, send it to Roboflow, or do other processing.
6+
7+
### Install MentraOS on your phone
8+
9+
MentraOS install links: [mentra.glass/install](https://mentra.glass/install)
10+
11+
### (Easiest way to get started) Set up ngrok
12+
13+
1. `brew install ngrok`
14+
15+
2. Make an ngrok account
16+
17+
3. [Use ngrok to make a static address/URL](https://dashboard.ngrok.com/)
18+
19+
### Register your App with MentraOS
20+
21+
1. Navigate to [console.mentra.glass](https://console.mentra.glass/)
22+
23+
2. Click "Sign In", and log in with the same account you're using for MentraOS
24+
25+
3. Click "Create App"
26+
27+
4. Set a unique package name like `com.yourName.yourAppName`
28+
29+
5. For "Public URL", enter your Ngrok's static URL
30+
31+
6. In the edit app screen, add the microphone permission
32+
33+
### Get your App running!
34+
35+
1. [Install bun](https://bun.sh/docs/installation)
36+
37+
2. Clone this repo locally: `git clone https://github.com/Mentra-Community/MentraOS-Camera-Example-App`
38+
39+
3. cd into your repo, then type `bun install`
40+
41+
5. Set up your environment variables:
42+
* Create a `.env` file in the root directory by copying the example: `cp .env.example .env`
43+
* Edit the `.env` file with your app details:
44+
```
45+
PORT=3000
46+
PACKAGE_NAME=com.yourName.yourAppName
47+
MENTRAOS_API_KEY=your_api_key_from_console
48+
```
49+
* Make sure the `PACKAGE_NAME` matches what you registered in the MentraOS Console
50+
* Get your `API_KEY` from the MentraOS Developer Console
51+
52+
6. Run your app with `bun run dev`
53+
54+
7. To expose your app to the internet (and thus MentraOS) with ngrok, run: `ngrok http --url=<YOUR_NGROK_URL_HERE> 3000`
55+
* `3000` is the port. It must match what is in the app config. For example, if you entered `port: 8080`, use `8080` for ngrok instead.
56+
57+
58+
### Next Steps
59+
60+
Check out the full documentation at [docs.mentra.glass](https://docs.mentra.glass/camera)

0 commit comments

Comments
 (0)