Skip to content

Commit 8509f8c

Browse files
committed
Improvements after vite migration
1 parent d084e03 commit 8509f8c

File tree

17 files changed

+75
-76
lines changed

17 files changed

+75
-76
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ uv.lock
66
.mypy_cache
77
.dmypy.json
88
.pytest_cache
9-
.yarn
109

1110
*.env
1211
!ci.env
@@ -15,7 +14,6 @@ node_modules
1514
coverage.xml
1615
coverage.json
1716

18-
backend/yarn.lock
1917
backend/static
2018

2119
/process-compose.yml

backend/yarn.lock

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

docs/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ next-env.d.ts
1818
_pagefind/
1919

2020
npm-debug.log*
21-
yarn-debug.log*
22-
yarn-error.log*

docs/content/community/development.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The database URL can be specified per environment in the `.env` files (see
3535

3636
## Running the frontend and backend
3737

38-
To run Bracket (frontend and backend) locally without Docker, one needs `yarn` and `uv`.
38+
To run Bracket (frontend and backend) locally without Docker, one needs `pnpm` and `uv`.
3939

4040
The following starts the frontend and backend for local development in the root
4141
directory of Bracket:
Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
---
22
title: Cloud services
33
---
4+
import {Callout} from "nextra/components"
5+
46
# Cloud services
57

8+
The frontend of Bracket is powered by Vite and can be simply statically hosted on any cloud
9+
service, such as Vercel or Cloudflare. Vite's [documentation](https://vite.dev/guide/static-deploy)
10+
provides detailed instructions on how to deploy your Vite application.
11+
12+
<Callout type="info">
13+
Essentially, the only thing you (or a cloud provider) needs to do is to run `pnpm run build`
14+
to generate a production build, and then serve the contents of the `dist` directory to the internet.
15+
</Callout>
16+
17+
## Cloudflare
18+
19+
To deploy the frontend to Cloudflare, go to `Workers & Pages` and click on `Import an existing Git repository`.
20+
21+
Make sure to:
22+
- Select `React (Vite)` as framework
23+
- Select the `frontend` directory as root directory
24+
25+
## GitHub Pages
26+
27+
To deploy the frontend to GitHub Pages, follow the steps outlined in
28+
Vite's [docs](https://vite.dev/guide/static-deploy#github-pages).
29+
630
## Vercel
731

832
To deploy the frontend to Vercel, use the following link:
@@ -11,4 +35,16 @@ To deploy the frontend to Vercel, use the following link:
1135
https://vercel.com/new/project?template=https://github.com/evroon/bracket
1236
```
1337

14-
Make sure to select the `frontend` directory as root directory, and use Next.js as framework.
38+
Make sure to:
39+
- Select `Vite` as framework
40+
- Select the `frontend` directory as root directory
41+
42+
This should work. If it fails, Vercel didn't automatically detect the right build settings.
43+
Change the following settings under `Build and Output settings`:
44+
- Set the build command to `pnpm run build`
45+
- Set the install command to `pnpm install`
46+
47+
## Other cloud providers
48+
49+
Vite's [documentation](https://vite.dev/guide/static-deploy)
50+
provides detailed instructions on how to deploy your Vite application.

docs/content/deployment/systemd.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This section describes how to deploy Bracket (frontend and backend) as a Systemd
88

99
This assumes:
1010

11-
- You have installed `yarn` and `pipenv`.
11+
- You have installed `pnpm` and `uv`.
1212
- You have a PostgreSQL cluster running.
1313
- You have cloned Bracket in `/var/lib/bracket`.
1414
- You have created a new user called Bracket with the permissions to read
@@ -29,7 +29,7 @@ After=network.target
2929
Type=simple
3030
User=bracket
3131
WorkingDirectory=/var/lib/bracket/backend
32-
ExecStart=pipenv run gunicorn -k uvicorn.workers.UvicornWorker bracket.app:app --bind localhost:8400 --workers 1
32+
ExecStart=uv run gunicorn -k uvicorn.workers.UvicornWorker bracket.app:app --bind localhost:8400 --workers 1
3333
Environment=ENVIRONMENT=PRODUCTION
3434
TimeoutSec=15
3535
Restart=always

docs/content/running-bracket/configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Copy `ci.env` to `prod.env` and fill in the values:
2222
- `ALLOW_INSECURE_HTTP_SSO`: Should not be used in production. Allows use of INSECURE requests for
2323
SSO auth.
2424
- `AUTO_RUN_MIGRATIONS`: Whether to run (alembic) migrations automatically on startup or not.
25-
Migrations can be applied manually using `pipenv run alembic upgrade head`.
25+
Migrations can be applied manually using `uv run alembic upgrade head`.
2626

2727
### Backend: Example configuration file
2828

docs/content/running-bracket/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ be able to view bracket at `http://localhost:3000`. You can log in with the foll
2222
To insert dummy rows into the database, run:
2323

2424
```bash
25-
sudo docker exec bracket-backend pipenv run ./cli.py create-dev-db
25+
sudo docker exec bracket-backend uv run ./cli.py create-dev-db
2626
```

frontend/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
# debug
2424
npm-debug.log*
25-
yarn-debug.log*
26-
yarn-error.log*
2725

2826
# local env files
2927
.env.local

frontend/Caddyfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:3000 {
2+
root * /app/dist
3+
file_server
4+
try_files {path} /index.html
5+
}

0 commit comments

Comments
 (0)