Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link new UI to auth and backend #36

Merged
merged 7 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions scripts/frontend-development/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3.7"

services:
# This DB is for the FastAPI Backend.
db:
extends:
file: ../backend-development/docker-compose.yaml
Expand All @@ -10,6 +11,23 @@ services:
interval: 2s
timeout: 2s
retries: 10

# This DB is for Web Authentication and data caching.
webdb:
image: postgres
restart: always
ports:
- 5433:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 2s
timeout: 2s
retries: 10
Comment on lines +17 to +28
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image: postgres
restart: always
ports:
- 5433:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 2s
timeout: 2s
retries: 10
extends: db

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was intentionally dropping extends here to improve readability rather than reduce code. I especially wanted to expose the port and user/password details since they're used below.

That for me at least makes it a little easier to see everything happening without having to check another docker compose file.


# This lets you manually inspect the web and backend databases.
adminer:
extends:
file: ../backend-development/docker-compose.yaml
Expand All @@ -26,3 +44,15 @@ services:
condition: service_healthy
ports:
- "8080:8080"

# This fakes and SMTP email server. User registration emails can be found by going to
# localhost:1080 and opening the emails listed.
maildev:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the mail server needed just for the custom auth or also for the discord auth workflow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's just for the custom auth.

I'll enhance the comment in the next PR.

image: maildev/maildev
restart: always
environment:
- MAILDEV_WEB_PORT=1080
- MAILDEV_SMTP_PORT=1025
ports:
- "1080:1080"
- "1025:1025"
14 changes: 14 additions & 0 deletions website/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# The database created by running the jobs in /scripts/frontend-development/docker-compose.yaml
DATABASE_URL=postgres://postgres:postgres@localhost:5433/ocgpt_website

# The FastAPI backend found by running the jobs in /scripts/frontend-development/docker-compose.yaml
FASTAPI_URL=http://localhost:8080
FASTAPI_KEY=1234

# A dev Auth Secret. Can be exposed if we never use this publically.
NEXTAUTH_SECRET=O/M2uIbGj+lDD2oyNa8ax4jEOJqCPJzO53UbWShmq98=

# The SMTP host and port found by running the jobs in /scripts/frontend-development/docker-compose.yaml
EMAIL_SERVER_HOST=localhost
EMAIL_SERVER_PORT=1025
EMAIL_FROM=info@example.com
8 changes: 0 additions & 8 deletions website/.env.example

This file was deleted.

1 change: 0 additions & 1 deletion website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
.env
.env*.local

# vercel
Expand Down