evroon / bracket Goto Github PK
View Code? Open in Web Editor NEWSelfhosted tournament system with web interface
Home Page: https://docs.bracketapp.nl
License: GNU Affero General Public License v3.0
Selfhosted tournament system with web interface
Home Page: https://docs.bracketapp.nl
License: GNU Affero General Public License v3.0
Every stage should consist of poules where every round has a foreign key to a poule.
Allow teams to have team logos. I'd do this myself, but I don't know how to use Alembic ๐
passlib hasn't had updates in 10 years, we should use https://github.com/pyca/bcrypt instead
This seems to be the new standard. Would be nice to follow this!
Now it's not clear what the user is supposed to do after having created a (demo) account, we should show a small introduction.
Your documentation seems to suggest that the environment needs to be set to "DEVELOPMENT" as per your docker compose file. If it can be avoided i would prefer to not do that in production. Is there a specific reason for that and if so can I still avoid that?
Add translations and maybe RTL (right to left) support.
Hello, why does the docker installation always trying to connect to localhost:8400? Its not running on localhost, its running behind a reverse proxy!
Error console when trying to login:
POST http://localhost:8400/token net::ERR_CONNECTION_REFUSED
Traceback (most recent call last):
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/starlette/routing.py", line 734, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "/usr/lib/python3.10/contextlib.py", line 199, in __aenter__
return await anext(self.gen)
File "/home/robigan/Documents/Source/bracket/backend/bracket/app.py", line 51, in lifespan
run_migrations()
File "/home/robigan/Documents/Source/bracket/backend/bracket/app.py", line 42, in run_migrations
command.upgrade(alembic_cfg, "head")
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/command.py", line 403, in upgrade
script.run_env()
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/script/base.py", line 583, in run_env
util.load_python_file(self.dir, "env.py")
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
module = load_module_py(module_id, path)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
spec.loader.exec_module(module) # type: ignore
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/robigan/Documents/Source/bracket/backend/alembic/env.py", line 47, in <module>
run_migrations_online()
File "/home/robigan/Documents/Source/bracket/backend/alembic/env.py", line 39, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/runtime/environment.py", line 948, in run_migrations
self.get_context().run_migrations(**kw)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/runtime/migration.py", line 627, in run_migrations
step.migration_fn(**kw)
File "/home/robigan/Documents/Source/bracket/backend/alembic/versions/6458e0bc3e9d_add_stages_table.py", line 23, in upgrade
op.create_table(
File "<string>", line 8, in create_table
File "<string>", line 3, in create_table
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/operations/ops.py", line 1311, in create_table
return operations.invoke(op)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/operations/base.py", line 445, in invoke
return fn(self, operation)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/operations/toimpl.py", line 131, in create_table
operations.impl.create_table(table)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/alembic/ddl/impl.py", line 363, in create_table
table.dispatch.before_create(
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/event/attr.py", line 346, in __call__
fn(*args, **kw)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 875, in __call__
return getattr(self.target, self.name)(*arg, **kw)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2206, in _on_table_create
self.create(bind=bind, checkfirst=checkfirst)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2111, in create
bind._run_ddl_visitor(self.EnumGenerator, self, checkfirst=checkfirst)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2221, in _run_ddl_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/sql/visitors.py", line 524, in traverse_single
return meth(obj, **kw)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2152, in visit_enum
self.connection.execute(CreateEnumType(enum))
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1385, in execute
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/sql/ddl.py", line 80, in _execute_on_connection
return connection._execute_ddl(
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1477, in _execute_ddl
ret = self._execute_context(
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1953, in _execute_context
self._handle_dbapi_exception(
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2134, in _handle_dbapi_exception
util.raise_(
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
raise exception
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context
self.dialect.do_execute(
File "/home/robigan/.local/share/virtualenvs/backend-j0cBvc18/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateObject) type "stage_type" already exists
[SQL: CREATE TYPE stage_type AS ENUM ('SINGLE_ELIMINATION', 'SWISS', 'SWISS_DYNAMIC_TEAMS', 'ROUND_ROBIN')]
(Background on this error at: https://sqlalche.me/e/14/f405)
round robin: schedule automatically
ladder: schedule manually (with button for automatic scheduling)
pytest-xdist can be used to run integration and unit tests in parallel
Instead of the dashboard being at http://localhost:3000/tournaments/1/dashboard, it would be nice to specify a custom url like http://localhost:3000/tournaments/my_tournament/dashboard
the docker compose stack specifies to use the following env var in prod "ENVIRONMENT=DEVELOPMENT".
is there any specific reason for it? I would like to not do that because its not advised to run nextjs in that way in production
Teams are actually an abstraction level too much. It could be optional.
It's not cleaar from description that this software is designed to handle chess tournaments.
I had to install it to figure out it's not the best fit for soccer tournament ;)
The problem with how Next.js handles environment variables is that environment variables sent to the browser via NEXT_PUBLIC_
are only evaluated at build time, or for Docker users, that would be during build of the Dockerfile. Per Next.js documentation:
In order to make the value of an environment variable accessible in the browser, Next.js can "inline" a value, at build time, into the js bundle that is delivered to the client, replacing all references to process.env.[variable] with a hard-coded value. To tell it to do this, you just have to prefix the variable with NEXT_PUBLIC_.
The logout button only brings the user to the profile edit page. Without any logging out functionality working.
Reproduce Error:
Unhandled Runtime Error
Error: [@mantine/core] Option value must be a string, other data formats are not supported, got number
Unhandled Runtime Error
Error: [@mantine/core] Option value must be a string, other data formats are not supported, got number
Call Stack
validateOptions
node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/validate-options.mjs (16:0)
OptionsDropdown
node_modules/@mantine/core/esm/components/Combobox/OptionsDropdown/OptionsDropdown.mjs (64:17)
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js (16305:0)
mountIndeterminateComponent
node_modules/react-dom/cjs/react-dom.development.js (20074:0)
beginWork
node_modules/react-dom/cjs/react-dom.development.js (21587:0)
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js (4164:0)
Object.invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js (4213:0)
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js (4277:0)
beginWork$1
node_modules/react-dom/cjs/react-dom.development.js (27451:0)
performUnitOfWork
node_modules/react-dom/cjs/react-dom.development.js (26557:0)
workLoopSync
node_modules/react-dom/cjs/react-dom.development.js (26466:0)
renderRootSync
node_modules/react-dom/cjs/react-dom.development.js (26434:0)
performConcurrentWorkOnRoot
node_modules/react-dom/cjs/react-dom.development.js (25738:0)
workLoop
node_modules/scheduler/cjs/scheduler.development.js (266:0)
flushWork
node_modules/scheduler/cjs/scheduler.development.js (239:0)
MessagePort.performWorkUntilDeadline
node_modules/scheduler/cjs/scheduler.development.js (533:0)
To be able to add many players at once, a bulk import function is required.
It would take a player per line, f.e. in csv style, with email addresses (if that's needed for later)
f.e.:
Jeff,Bridges,[email protected]
Mark,Williams,[email protected]
etc.
Add a QR code on the dashboard in the frontend that links to the dashboard page.
The layout is incomplete, especially the front page
fixed by #252
Single and double elimination is not implemented yet.
We can add activity logging for historic and autdit logging purposes.
Such as when you create/update/delete:
And when:
It would be nice to add a "presentation layout" to the dashboard (enabled by a checkbox and query parameter) that makes the dashboard font larger and hides settings etc. such that it can be presented on screens at the tournament venue.
Factors to take into account for scheduling:
It might be nice to be able to manually switch to a different locale, also for testing purposes.
After completing the basic backend setup, I attempted to run ./run.sh
. However, the operation failed, potentially due to an issue related to bcrypt. How could I solve this?
Related issues:
[2023-12-18 13:53:39 +0800] [92564] [INFO] Starting gunicorn 21.2.0
[2023-12-18 13:53:39 +0800] [92564] [INFO] Listening at: http://127.0.0.1:8400 (92564)
[2023-12-18 13:53:39 +0800] [92564] [INFO] Using worker: bracket.uvicorn.RestartableUvicornWorker
[2023-12-18 13:53:39 +0800] [92569] [INFO] Booting worker with pid: 92569
โ Port 3000 is in use, trying 3001 instead.
โ Port 3001 is in use, trying 3002 instead.
โฒ Next.js 14.0.3
- Local: http://localhost:3002
[2023-12-18 13:53:39,826] [bracket] [INFO] Current env: DEVELOPMENT
(trapped) error reading bcrypt version
Traceback (most recent call last):
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
version = _bcrypt.__about__.__version__
AttributeError: module 'bcrypt' has no attribute '__about__'
[2023-12-18 13:53:40 +0800] [92569] [INFO] Started server process [92569]
[2023-12-18 13:53:40 +0800] [92569] [INFO] Waiting for application startup.
[2023-12-18 13:53:40 +0800] [92569] [ERROR] Traceback (most recent call last):
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/starlette/routing.py", line 677, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "/opt/homebrew/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 199, in __aenter__
return await anext(self.gen)
File "/Users/seviche/Desktop/Project/bracket/backend/bracket/app.py", line 36, in lifespan
await database.connect()
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/databases/core.py", line 112, in connect
await self._backend.connect()
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/databases/backends/postgres.py", line 74, in connect
self._pool = await asyncpg.create_pool(**kwargs)
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 403, in _async__init__
await self._initialize()
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 430, in _initialize
await first_ch.connect()
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 128, in connect
self._con = await self._pool._get_new_connection()
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/pool.py", line 502, in _get_new_connection
con = await connection.connect(
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connection.py", line 2329, in connect
return await connect_utils._connect(
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 1017, in _connect
raise last_error or exceptions.TargetServerAttributeNotMatched(
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 991, in _connect
conn = await _connect_addr(
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 828, in _connect_addr
return await __connect_addr(params, True, *args)
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 873, in __connect_addr
tr, pr = await connector
File "/Users/seviche/.local/share/virtualenvs/backend-uNhJPzew/lib/python3.10/site-packages/asyncpg/connect_utils.py", line 744, in _create_ssl_connection
tr, pr = await loop.create_connection(
File "/opt/homebrew/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1084, in create_connection
raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 61] Connect call failed ('::1', 5432, 0, 0), [Errno 61] Connect call failed ('127.0.0.1', 5432)
[2023-12-18 13:53:40 +0800] [92569] [ERROR] Application startup failed. Exiting.
In group stage, matches should be scheduled in separate groups that can come together in a subsequent stage.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.