{"id":18940347,"url":"https://github.com/donejs/bitballs","last_synced_at":"2026-03-10T04:03:42.634Z","repository":{"id":136943563,"uuid":"39485259","full_name":"donejs/bitballs","owner":"donejs","description":"A basketball tourney application.","archived":false,"fork":false,"pushed_at":"2020-03-18T17:45:15.000Z","size":7264,"stargazers_count":11,"open_issues_count":41,"forks_count":17,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-29T01:41:20.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://donejs.com/bitballs.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/donejs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-22T04:18:47.000Z","updated_at":"2024-08-16T15:17:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbe98e0a-1ce3-47a8-b74a-c318752537fe","html_url":"https://github.com/donejs/bitballs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fbitballs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fbitballs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fbitballs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donejs%2Fbitballs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donejs","download_url":"https://codeload.github.com/donejs/bitballs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249138716,"owners_count":21218930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T12:22:14.773Z","updated_at":"2026-03-10T04:03:42.625Z","avatar_url":"https://github.com/donejs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"@page bitballs Bitballs\n@group bitballs.components Components\n@group bitballs.clientModels Client Models\n@group bitballs.services Services\n@group bitballs.serviceModels Service Models\n@hide contents\n\n[![Build Status](https://travis-ci.org/donejs/bitballs.svg?branch=master)](https://travis-ci.org/donejs/bitballs)\n\nBitballs is a [DoneJS](https://donejs.com) app that enables users to coordinate\nthe players, teams, games, rounds and recordings of a basketball tournament.\nIt also serves as an example of how to use DoneJS with sessions, user\nprivileges, RESTful services, and ORM models.\n\nTo run the Bitballs app locally, run its tests, or generate its documentation\nfollow the steps outlined below.\n\n## Quick Start with Docker (Recommended)\n\nThe easiest way to run Bitballs is using Docker. This approach automatically sets up the database, runs migrations, and starts the application.\n\n### Prerequisites\n\n- [Docker](https://www.docker.com/get-started)\n- [Docker Compose](https://docs.docker.com/compose/install/) (usually included with Docker Desktop)\n\n### Running the Application\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/donejs/bitballs.git\n   cd bitballs\n   ```\n\n2. Start the application:\n   ```bash\n   docker-compose up\n   ```\n\n3. Open your browser and navigate to [http://localhost:5001](http://localhost:5001)\n\nThat's it! The application will automatically:\n- Set up a PostgreSQL database\n- Run database migrations to create all required tables\n- Install dependencies\n- Start the Node.js application\n\n### Docker Commands\n\n- **Start the application**: `docker-compose up`\n- **Start in background**: `docker-compose up -d`\n- **Stop the application**: `docker-compose down`\n- **Reset database**: `docker-compose down -v` (removes all data)\n- **View logs**: `docker-compose logs app` or `docker-compose logs db`\n- **Rebuild after code changes**: `docker-compose up --build`\n\n### Configuration\n\nThe Docker setup uses environment variables for configuration. Default values are set in `docker-compose.yml`, but you can override them by creating a `.env` file (see `.env.example` for reference).\n\nKey environment variables:\n- `DB_HOST`: Database hostname (default: `db`)\n- `DB_USER`: Database username (default: `postgres`) \n- `DB_PASSWORD`: Database password (default: `postgres`)\n- `DB_NAME`: Database name (default: `bitballs`)\n- `DATABASE_URL`: Complete database connection string (overrides individual DB_* vars)\n\n### Troubleshooting Docker\n\n**Port already in use**: If you get port conflicts, you can change the ports in `docker-compose.yml` or stop other services using those ports.\n\n**Database connection issues**: The application automatically waits for the database to be ready and runs migrations. If you see connection errors, try running `docker-compose down -v` to reset the database and start fresh.\n\n**Module not found errors**: If you encounter missing module errors, rebuild the image with `docker-compose up --build`.\n\n## Manual Setup (Alternative)\n\nIf you prefer to set up the environment manually without Docker, follow these instructions:\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Quick Start with Docker (Recommended)](#quick-start-with-docker-recommended)\n  - [Prerequisites](#prerequisites)\n  - [Running the Application](#running-the-application)\n  - [Docker Commands](#docker-commands)\n- [Manual Setup (Alternative)](#manual-setup-alternative)\n  - [Setup Environment](#setup-environment)\n  - [Installing PostgreSQL on OSX](#installing-postgresql-on-osx)\n  - [Installing PostgreSQL on Linux](#installing-postgresql-on-linux)\n  - [Installing PostgreSQL on Windows](#installing-postgresql-on-windows)\n- [Download Source](#download-source)\n- [Install Dependencies](#install-dependencies)\n- [Prepare the Database](#prepare-the-database)\n- [Start the Server](#start-the-server)\n- [Register a User](#register-a-user)\n- [Enjoy](#enjoy)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n### Setup Environment\n\nMake sure you have installed:\n\n- [Node 5](https://nodejs.org/en/download/)\n- NPM 3 *(packaged with Node)*\n- [PostgreSQL](https://www.postgresql.org/download/)\n\n#### Installing PostgreSQL on OSX\n\nOn a Mac, the easiest way to install and configure [PostgreSQL](https://www.postgresql.org)\nis using the [brew](https://brew.sh/) utility:\n\n```\nbrew install postgresql\n```\n\nPay special attention to the end of the [brew](https://brew.sh/) command's\noutput, which includes instructions on how to start `postgres`:\n\n```\nTo load postgresql:\n  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist\nOr, if you don't want/need launchctl, you can just run:\n  postgres -D /usr/local/var/postgres\n```\n\nThe provided `launchctl` command ensures the `postgres` process is always\nrunning, even after a system restart. The alternative `postgres` command\nstarts the `postgres` process manually.\n\nWe recommend the `launchctl` option. If desired, `postgres` can be\nstopped and uninstalled by running:\n\n```\nbrew uninstall postgresql\n```\n\n#### Installing PostgreSQL on Linux\n\n*Coming Soon*\n\n#### Installing PostgreSQL on Windows\n\nDownload and use the graphical installer available on [postgresql.org](http://www.postgresql.org/download/windows/). Make sure you host it listen to port `5432`.\n\nOpen `pg_hba.conf`, which should be in _C:\\Program Files\\PostgreSQL\\9.5\\data_, and change from `md5` authentication to `trust`. For example, change:\n\n\u003e host    all             all             127.0.0.1/32            md5\n\nto:\n\n\u003e host    all             all             127.0.0.1/32            trust\n\n`trust` should not be used in a production environment.  We are only using it here as a substitute for the `peer` mode available in UNIX environments. Read more about it [here](http://www.postgresql.org/docs/9.5/static/auth-methods.html).\n\n\n\nFinally, using `pgAdmin III` graphical database manager, which should have been installed with `postgres`, create a `bitballs` database.\n\n\n### Download Source\n\nClone this repo using git:\n\n```\ngit clone https://github.com/donejs/bitballs.git\n```\n\nNavigate to the repository's directory\n\n```\ncd bitballs\n```\n\n### Prepare the Database\n\nMake sure the `postgres` process is running:\n\n```\nps | grep postgres\n```\n\nYou should see \"postgres -D\" among the output:\n\n```\n92831 ttys000    0:00.02 postgres -D /usr/local/var/postgres\n92856 ttys000    0:00.00 grep postgres\n```\n\nWith that confirmed we can create the database that the bitballs app\nwill persist its data to:\n\n```\ncreatedb bitballs\n```\n\n### Install Dependencies\n\nTo install the project's JavaScript dependencies run:\n\n```\nnpm install\n```\n\nAdditionally DoneJS's command line utilities need to be installed globally:\n\n```\nnpm install -g donejs-cli\n```\n\n### Start the Server\n\nWith all the prerequisite setup completed the server can be started by running:\n\n```\ndonejs develop\n```\n\n### Register a User\n\nNavigate to [http://localhost:5001/register](http://localhost:5001/register) (Docker) or [http://localhost:5000/register](http://localhost:5000/register) (manual setup)\nin your browser and follow the instructions.\n\n### Enjoy\n\nYou're finished! Explore some of the app's features:\n\n- Live reload (`donejs develop`)\n- Run the tests (`donejs test`)\n- Generate the documentation (`donejs document`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonejs%2Fbitballs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonejs%2Fbitballs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonejs%2Fbitballs/lists"}