Skip to content

Commit 2cbccbc

Browse files
committed
Add env to frontend
1 parent a68a5a9 commit 2cbccbc

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ __pycache__/
66
.venv/
77
venv/
88
.env
9+
frontend/.env.local
910
celerybeat-schedule*
1011
db.sqlite3
1112
staticfiles/

‎frontend/lib/api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function getBasicAuthHeader() {
2323

2424
if (!username || !password) {
2525
throw new Error(
26-
"NEWSLETTER_API_USERNAME and NEWSLETTER_API_PASSWORD must be set for the frontend.",
26+
"NEWSLETTER_API_USERNAME and NEWSLETTER_API_PASSWORD must be set for the frontend. Copy frontend/.env.example to frontend/.env.local when running Next.js outside Docker.",
2727
)
2828
}
2929

‎justfile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ backend-dev:
1818
{{compose}} up django celery-worker celery-beat postgres redis qdrant nginx
1919

2020
frontend-dev:
21+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
2122
cd frontend && npm run dev
2223

2324
dev:
@@ -29,13 +30,15 @@ backend-build:
2930
{{compose}} build django
3031

3132
frontend-build:
33+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
3234
cd frontend && npm run build
3335

3436
build:
3537
just backend-build
3638
just frontend-build
3739

3840
frontend-typecheck:
41+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
3942
cd frontend && npm run typecheck
4043

4144
backend-lint:
@@ -49,6 +52,7 @@ backend-lint:
4952
python3 manage.py check
5053

5154
frontend-lint:
55+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
5256
cd frontend && npm run lint
5357

5458
lint:
@@ -64,19 +68,23 @@ backend-lint-fix:
6468
just backend-lint
6569

6670
frontend-lint-fix:
71+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
6772
cd frontend && npm run lint:fix
6873

6974
lint-fix:
7075
just backend-lint-fix
7176
just frontend-lint-fix
7277

7378
frontend-format:
79+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
7480
cd frontend && npm run format
7581

7682
frontend-format-check:
83+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
7784
cd frontend && npm run format:check
7885

7986
frontend-test:
87+
if [ ! -f frontend/.env.local ]; then cp frontend/.env.example frontend/.env.local; fi
8088
cd frontend && npm run test:run
8189

8290
backend-test:

0 commit comments

Comments
 (0)