Skip to content

Commit 3857afa

Browse files
committed
fixup! fixup! fixup! Migrate to vite
1 parent cf74a3d commit 3857afa

File tree

12 files changed

+22
-45
lines changed

12 files changed

+22
-45
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<h1></h1>
5151

5252
Tournament system meant to be easy to use. Bracket is written in async Python (with
53-
[FastAPI](https://fastapi.tiangolo.com)) and [Next.js](https://nextjs.org/) as frontend using the
53+
[FastAPI](https://fastapi.tiangolo.com)) and [Vite](https://vite.dev/) as frontend using the
5454
[Mantine](https://mantine.dev/) library.
5555

5656
It has the following features:
@@ -104,7 +104,7 @@ Read the [configuration docs](https://docs.bracketapp.nl/docs/running-bracket/co
104104
Bracket's backend is configured using `.env` files (`prod.env` for production, `dev.env` for development etc.).
105105
But you can also configure Bracket using environment variables directly, for example by specifying them in the `docker-compose.yml`.
106106

107-
The frontend doesn't can be configured by environment variables as well, as well as `.env` files using Next.js' way of loading environment variables.
107+
The frontend doesn't can be configured by environment variables as well, as well as `.env` files using Vite's way of loading environment variables.
108108

109109
# Running Bracket in production
110110
Read the [deployment docs](https://docs.bracketapp.nl/docs/deployment) for how to deploy Bracket and run it in production.

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ services:
2626
bracket-frontend:
2727
container_name: bracket-frontend
2828
environment:
29-
NEXT_PUBLIC_API_BASE_URL: http://localhost:8400
30-
NEXT_PUBLIC_HCAPTCHA_SITE_KEY: 10000000-ffff-ffff-ffff-000000000001
29+
VITE_API_BASE_URL: http://localhost:8400
30+
VITE_HCAPTCHA_SITE_KEY: 10000000-ffff-ffff-ffff-000000000001
3131
image: ghcr.io/evroon/bracket-frontend
3232
ports:
3333
- 3000:3000

docs/content/deployment/docker.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ services:
2626
- "3000:3000"
2727
environment:
2828
NODE_ENV: "production"
29-
NEXT_PUBLIC_API_BASE_URL: "http://your-site.com:8400"
30-
NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "10000000-ffff-ffff-ffff-000000000001"
29+
VITE_API_BASE_URL: "http://your-site.com:8400"
30+
VITE_HCAPTCHA_SITE_KEY: "10000000-ffff-ffff-ffff-000000000001"
3131
restart: unless-stopped
3232

3333
bracket-backend:
@@ -63,9 +63,9 @@ Replace the lines that are highlighted in the code block from the previous step.
6363
6464
Replace the following values for `bracket-frontend`:
6565

66-
- `NEXT_PUBLIC_API_BASE_URL`: The address of your backend. The frontend will send
66+
- `VITE_API_BASE_URL`: The address of your backend. The frontend will send
6767
requests to this address.
68-
- `NEXT_PUBLIC_HCAPTCHA_SITE_KEY`: Either leave empty to disable it or
68+
- `VITE_HCAPTCHA_SITE_KEY`: Either leave empty to disable it or
6969
[signup for hCaptcha](https://dashboard.hcaptcha.com/signup), create a site and
7070
put the site key here
7171

docs/content/deployment/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ See [the config docs](/docs/running-bracket/configuration.mdx) for more informat
3131

3232
The following configuration variables need to be adjusted for the frontend to run it in production:
3333

34-
- `NEXT_PUBLIC_API_BASE_URL`: The base URL of the backend API to which the frontend sends requests.
34+
- `VITE_API_BASE_URL`: The base URL of the backend API to which the frontend sends requests.
3535
For example: `https://api.bracket.com`
3636

3737
Optional:
3838

39-
- `NEXT_PUBLIC_HCAPTCHA_SITE_KEY`: The HCaptcha key used for captcha challenges when creating new
39+
- `VITE_HCAPTCHA_SITE_KEY`: The HCaptcha key used for captcha challenges when creating new
4040
accounts. You get the secret when you create a new site in HCaptcha. If left blank, HCaptcha will
4141
be disabled for your site.
4242

docs/content/deployment/nomad.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ job "bracket-frontend" {
8989
driver = "docker"
9090
9191
env {
92-
NEXT_PUBLIC_API_BASE_URL = "https://my.bracketdomain.com"
93-
NEXT_PUBLIC_HCAPTCHA_SITE_KEY = "xxxxx"
92+
VITE_API_BASE_URL = "https://my.bracketdomain.com"
93+
VITE_HCAPTCHA_SITE_KEY = "xxxxx"
9494
NODE_ENV = "production"
9595
}
9696

docs/content/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Introduction
55

66
[Bracket](https://github.com/evroon/bracket) is a tournament system meant to be easy to use. Bracket
77
is written in async Python (with [FastAPI](https://fastapi.tiangolo.com)) and
8-
[Next.js](https://nextjs.org/) as frontend using the [Mantine](https://mantine.dev/) library.
8+
[Vite](https://vite.dev/) as frontend using the [Mantine](https://mantine.dev/) library.
99

1010
## Overview of features
1111

@@ -36,7 +36,7 @@ tournament systems that exist usually only support Swiss, no other types of tour
3636
(round-robin, elimination etc.). That is quite a limitation when you want to host a tournament that
3737
starts with Swiss and determines a winner based on a knockoff (elimination) stage.
3838

39-
**Finally**, I developed this project to learn more about Next.js and apply my Python (e.g. FastAPI)
39+
**Finally**, I developed this project to learn more about Vite and apply my Python (e.g. FastAPI)
4040
experience to a project with a real purpose.
4141

4242
## Quickstart

docs/content/running-bracket/configuration.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ AUTO_RUN_MIGRATIONS=true
4444

4545
## Frontend
4646

47-
- `NEXT_PUBLIC_HCAPTCHA_SITE_KEY`: The HCaptcha key used for captcha challenges when creating new
47+
- `VITE_HCAPTCHA_SITE_KEY`: The HCaptcha key used for captcha challenges when creating new
4848
accounts. You get the secret when you create a new site in HCaptcha.
49-
- `NEXT_PUBLIC_API_BASE_URL`: The base URL of the backend API to which the frontend sends requests.
49+
- `VITE_API_BASE_URL`: The base URL of the backend API to which the frontend sends requests.
5050
For example: `https://api.bracket.com`
5151
- `ANALYTICS_DATA_DOMAIN`: The `data-domain` attribute passed to the script for Plausible
5252
analytics
@@ -61,8 +61,8 @@ You can store the config in `.env.local` (as described in the [Next docs][next-c
6161
This is an example of how the config file should look like:
6262

6363
```shell
64-
NEXT_PUBLIC_HCAPTCHA_SITE_KEY='10000000-ffff-ffff-ffff-000000000001'
65-
NEXT_PUBLIC_API_BASE_URL='https://api.bracket.com'
64+
VITE_HCAPTCHA_SITE_KEY='10000000-ffff-ffff-ffff-000000000001'
65+
VITE_API_BASE_URL='https://api.bracket.com'
6666
ANALYTICS_SCRIPT_SRC='https://analytics.bracket.com/script.js'
6767
ANALYTICS_DATA_DOMAIN='bracket.com'
6868
ANALYTICS_DATA_WEBSITE_ID='bracket.com'

docs/content/running-bracket/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: FAQ
1010
This is likely because you are trying to access Bracket on a different address than
1111
`http://localhost:3000` in the browser. In that case, two things need to be changed:
1212

13-
- Change `NEXT_PUBLIC_API_BASE_URL` to the address of the backend, e.g `https://api.example.org`.
13+
- Change `VITE_API_BASE_URL` to the address of the backend, e.g `https://api.example.org`.
1414
- You will also need to update `CORS_ORIGINS` to the address of the frontend, e.g.
1515
`https://app.example.org`.
1616

frontend/.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NEXT_PUBLIC_HCAPTCHA_SITE_KEY='10000000-ffff-ffff-ffff-000000000001'
1+
VITE_HCAPTCHA_SITE_KEY='10000000-ffff-ffff-ffff-000000000001'
22
ANALYTICS_SCRIPT_SRC=''
33
ANALYTICS_DATA_DOMAIN=''
44
ANALYTICS_DATA_WEBSITE_ID=''

frontend/docker-entrypoint.sh

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

0 commit comments

Comments
 (0)