Skip to content

Commit bad67de

Browse files
committed
added .env.example files
1 parent 52c8988 commit bad67de

10 files changed

Lines changed: 90 additions & 90 deletions

File tree

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
node_modules
2-
.env
3-
.vscode/
4-
hand_server.log
52
.venv
63
.pytest_cache
4+
5+
.env
6+
.env.*
7+
!env.example
8+
9+
hand_server.log
710
autojoin.log
8-
todo.todo
11+
12+
.vscode/

hand/app/.env.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# for tactile notifications
2+
VAPID_PRIVATE_KEY=
3+
VAPID_EMAIL=
4+
5+
# for text to speech
6+
ELEVENLABS_API_KEY=
7+
8+
# for AI schedule
9+
OPENAI_API_KEY=
10+
11+
# for push to talk (if using)
12+
LIVEKIT_API_KEY=
13+
LIVEKIT_API_SECRET=
14+
15+
# for vite client push to talk
16+
VITE_LIVEKIT_URL=
17+
# for vite client tactile notifications
18+
VITE_SAVE_SUB_URL=
19+
VITE_NOTIF_APP_KEY=
20+
21+
# set APP_ENV to dev for testing, set it to prod on raspberry pi
22+
APP_ENV=dev

hand/app/.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
__pycache__/
2-
test.rest
3-
webmoti-sa.json
42
.venv
3+
static/build/
4+
55
test.py
66
example_pdf.pdf
77
test.rest
8-
static/build/
8+
9+
.env
10+
.env.*
11+
!env.example

setup.md

Lines changed: 9 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ It's set up to use the twilio video `go` room type (2 participant max) when
6969

7070
#### Local setup
7171

72+
Copy the [example](webmoti-react/.env.example)
73+
environment file to `.env` in the same directory and fill in the values below
74+
7275
- Open the [Twilio Console](https://www.twilio.com/console).
7376
- Click on 'Settings' and take note of your Account SID.
7477
- Create a new API Key in the [API Keys Section](https://www.twilio.com/console/video/project/api-keys)
@@ -77,42 +80,11 @@ It's set up to use the twilio video `go` room type (2 participant max) when
7780
- (This step is optional because plugin-rtc will
7881
create a new conversation service called
7982
`${APP_NAME}-conversations-service`. Make sure that both the react app .env
80-
and the autojoin .env use the same conversation SID, otherwise they will be
83+
and the standalone-join .env use the same conversation SID, otherwise they'll be
8184
in isolated chats) Create a new Conversations service in the [Services section](https://www.twilio.com/console/conversations/services)
8285
under the Conversations tab in the Twilio Console. Take note of the SID generated.
8386
- Store your Account SID, API Key SID, API Key Secret, and Conversations Service
84-
SID in a new file called `.env` in the root level of the application (example below).
85-
86-
```bash
87-
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
88-
TWILIO_API_KEY_SID=SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
89-
TWILIO_API_KEY_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
90-
TWILIO_CONVERSATIONS_SERVICE_SID=ISxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
91-
92-
# Using no auth is useful for testing multiple users (or testing in general)
93-
# VITE_SET_AUTH=none
94-
# You can also enable passcode authentication for use with the Twilio CLI rtc-plugin.
95-
# See: https://github.com/twilio-labs/plugin-rtc
96-
# VITE_SET_AUTH=passcode
97-
98-
# Use firebase auth for deploying and only use passcode/none for testing
99-
VITE_SET_AUTH=firebase
100-
101-
# The following values are used to configure the Firebase library.
102-
# See https://firebase.google.com/docs/web/setup#config-object
103-
# These variables must be set if FIREBASE_AUTH is enabled
104-
VITE_FIREBASE_API_KEY=
105-
VITE_FIREBASE_AUTH_DOMAIN=
106-
VITE_FIREBASE_STORAGE_BUCKET=
107-
VITE_FIREBASE_MESSAGING_SENDER_ID=
108-
109-
# set this to the remote.it persistent link (ending in /api)
110-
# if running hand server locally, comment this out
111-
VITE_API_DOMAIN=
112-
113-
# set this to the livekit websocket url (if using livekit)
114-
VITE_LIVEKIT_URL=
115-
```
87+
SID in the `.env` file.
11688

11789
### Weird errors that happen sometimes
11890

@@ -242,32 +214,8 @@ pip install -r ~/webmoti-react/hand/app/requirements.txt
242214
>
243215
> You can also activate it by typing activatehs (this is setup in .bashrc)
244216
245-
Create `.env` file in project root:
246-
247-
```bash
248-
# for tactile notifications
249-
VAPID_PRIVATE_KEY=
250-
VAPID_EMAIL=
251-
252-
# for text to speech
253-
ELEVENLABS_API_KEY=
254-
255-
# for AI schedule
256-
OPENAI_API_KEY=
257-
258-
# for push to talk (if using)
259-
LIVEKIT_API_KEY=
260-
LIVEKIT_API_SECRET=
261-
262-
# for vite client push to talk
263-
REACT_APP_LIVEKIT_URL=
264-
# for vite client tactile notifications
265-
REACT_APP_SAVE_SUB_URL=
266-
REACT_APP_NOTIF_APP_KEY=
267-
268-
# set APP_ENV to dev for testing, set it to prod on raspberry pi
269-
APP_ENV=dev
270-
```
217+
Next, copy the [example](hand/app/.env.example)
218+
environment file to `.env` in the same directory and fill in the values
271219

272220
Vapid key pairs (for tactile push notifications) can be generated using
273221
`npx web-push generate-vapid-keys`.
@@ -423,22 +371,8 @@ Installing `puppeteer` on raspberry pi (arm64) is broken. It doesn't install
423371

424372
#### Create .env in home directory
425373

426-
```bash
427-
# these are the same values used in the react app .env
428-
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
429-
TWILIO_API_KEY_SID=SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
430-
TWILIO_API_KEY_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
431-
TWILIO_CONVERSATIONS_SERVICE_SID=ISxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
432-
433-
# set this to the url of the deployed react app
434-
WEBMOTI_URL=
435-
436-
# for student-view raspberry pi (remove this for board-view)
437-
IS_STUDENT_VIEW=true
438-
439-
# for testing autojoin.js
440-
# IS_TEST_USER=true
441-
```
374+
Copy the [example](standalone-join/.env.example)
375+
environment file to `.env` in the same directory and fill in the values
442376

443377
#### Making the autojoin script run on boot
444378

standalone-join/.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# these are the same values used in the react app .env
2+
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3+
TWILIO_API_KEY_SID=SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4+
TWILIO_API_KEY_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5+
TWILIO_CONVERSATIONS_SERVICE_SID=ISxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
6+
7+
# set this to the url of the deployed react app
8+
WEBMOTI_URL=
9+
10+
# for student-view raspberry pi (remove this for board-view)
11+
IS_STUDENT_VIEW=true
12+
13+
# for testing autojoin.js on a non raspberry pi device
14+
# IS_TEST_USER=true

webmoti-react/.env.example

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# credentials from twilio console
2+
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3+
TWILIO_API_KEY_SID=SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4+
TWILIO_API_KEY_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5+
TWILIO_CONVERSATIONS_SERVICE_SID=ISxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
6+
7+
# Auth mode: (choose one)
8+
# none: local testing without auth
9+
# passcode: passcode that expires after a week (not secure)
10+
# firebase: secure with firebase auth (use this for deploying)
11+
# VITE_SET_AUTH=none
12+
# VITE_SET_AUTH=passcode
13+
VITE_SET_AUTH=firebase
14+
15+
# required for firebase auth
16+
# See https://firebase.google.com/docs/web/setup#config-object
17+
VITE_FIREBASE_API_KEY=
18+
VITE_FIREBASE_AUTH_DOMAIN=
19+
VITE_FIREBASE_STORAGE_BUCKET=
20+
VITE_FIREBASE_MESSAGING_SENDER_ID=
21+
22+
# set to persistent API endpoint or leave blank for local dev
23+
VITE_API_DOMAIN=
24+
25+
# livekit server websocket URL (optional)
26+
VITE_LIVEKIT_URL=

webmoti-react/.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ yarn-error.log*
2323
# secrets
2424
.env
2525
.env.*
26-
.env.local
27-
.env.development.local
28-
.env.test.local
29-
.env.production.local
26+
!env.example
3027
firebase_service_account.json
3128

3229
# generated

webmoti-react/src/components/MenuBar/MenuBar.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ describe('the MenuBar component', () => {
113113
// expect(wrapper.find(ToggleScreenShareButton).exists()).toBe(false);
114114
// });
115115

116-
// it('should render the ToggleChatButton when REACT_APP_DISABLE_TWILIO_CONVERSATIONS is not true', () => {
116+
// it('should render the ToggleChatButton when VITE_DISABLE_TWILIO_CONVERSATIONS is not true', () => {
117117
// render(<MenuBar />);
118118
// expect(screen.getByTestId('toggle-chat-button')).toBeInTheDocument();
119119
// });
120120

121-
// it('should hide the ToggleChatButton when REACT_APP_DISABLE_TWILIO_CONVERSATIONS is true', () => {
121+
// it('should hide the ToggleChatButton when VITE_DISABLE_TWILIO_CONVERSATIONS is true', () => {
122122
// (clientEnv.DISABLE_TWILIO_CONVERSATIONS as jest.Mock).mockReturnValue('true');
123123
// render(<MenuBar />);
124124
// expect(screen.getByTestId('toggle-chat-button')).not.toBeInTheDocument();

webmoti-react/src/state/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('the useAppState hook', () => {
4242
expect(() => renderHook(useAppState)).toThrow('useAppState must be used within the AppStateProvider');
4343
});
4444

45-
it('should get a token using the REACT_APP_TOKEN_ENDPOINT environment variable when avaiable', async () => {
45+
it('should get a token using the VITE_TOKEN_ENDPOINT environment variable when avaiable', async () => {
4646
(clientEnv.TOKEN_ENDPOINT as jest.Mock).mockReturnValue('http://test.com/api/token');
4747

4848
const { result } = renderHook(useAppState, { wrapper });

webmoti-react/src/state/usePasscodeAuth/usePasscodeAuth.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe('the usePasscodeAuth hook', () => {
177177
});
178178
});
179179

180-
it('should call the API with the correct parameters when REACT_APP_DISABLE_TWILIO_CONVERSATIONS is true', async () => {
180+
it('should call the API with the correct parameters when VITE_DISABLE_TWILIO_CONVERSATIONS is true', async () => {
181181
(clientEnv.DISABLE_TWILIO_CONVERSATIONS as jest.Mock).mockReturnValue('true');
182182

183183
//@ts-expect-error: mock browser property

0 commit comments

Comments
 (0)