{"id":21338685,"url":"https://github.com/daneffx/dane.lol","last_synced_at":"2025-10-03T13:31:03.594Z","repository":{"id":262634398,"uuid":"865570631","full_name":"danexrc/dane.lol","owner":"danexrc","description":"🕹️ A web project where I make random things when I'm bored.","archived":false,"fork":false,"pushed_at":"2024-11-13T15:06:01.000Z","size":34129,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T15:57:34.110Z","etag":null,"topics":["api","css","docker-image","html","javascript","javascript-game","viewguesser","views","webgame","website"],"latest_commit_sha":null,"homepage":"https://dane.lol","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danexrc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-30T18:43:38.000Z","updated_at":"2024-11-14T00:47:58.000Z","dependencies_parsed_at":"2024-11-13T13:58:42.407Z","dependency_job_id":null,"html_url":"https://github.com/danexrc/dane.lol","commit_stats":null,"previous_names":["danexrc/dane.lol"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danexrc%2Fdane.lol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danexrc%2Fdane.lol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danexrc%2Fdane.lol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danexrc%2Fdane.lol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danexrc","download_url":"https://codeload.github.com/danexrc/dane.lol/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235134778,"owners_count":18941326,"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":["api","css","docker-image","html","javascript","javascript-game","viewguesser","views","webgame","website"],"created_at":"2024-11-22T00:34:33.809Z","updated_at":"2025-10-03T13:30:58.524Z","avatar_url":"https://github.com/danexrc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/e68dtaZ.png\" alt=\"dane.lol logo\"/\u003e\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003cb\u003eA web project where I make random things when I'm bored.\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\n\u003ca href=\"https://dane.lol\"\u003e\u003cimg src=\"https://img.shields.io/website-up-down-green-red/http/dane.lol.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://GitHub.com/danexrc/dane.lol/graphs/commit-activity\"\u003e\u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n## 🕹️ Projects\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch4\u003eViewguesser\u003c/h4\u003e\u003c/summary\u003e\n\u003cb\u003eViewguesser is a higher-lower guessing game based on YouTube video views.\u003c/b\u003e\n\u003cbr\u003e\u003cbr\u003e\n\u003cb\u003e🚀 Features\u003c/b\u003e\n\u003cul\u003e\n  \u003cli\u003eAutomatic pulling from YouTube's API (videos are cached for 12 hours)\u003c/li\u003e\n  \u003cli\u003eScoreboard functionality.\u003c/li\u003e\n  \u003cli\u003eEasy score sharing on social media.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cb\u003e🪄 Details\u003c/b\u003e\n\u003cbr\u003e\nThe player is presented with two videos, one video on the left and a different video on the right. These will be different random videos pulled from YouTube. This uses the YouTube API to fetch videos using the backend API calls.\n\u003cbr\u003e\u003cbr\u003e\nEach video will display the title, the name of the creator that made the video, the video's view count \u0026 the video's thumbnail in the background.\n\u003cbr\u003e\u003cbr\u003e\nThe view count of the first video will be displayed on the left. The video on the right will have two buttons, one for higher and one for lower. The player must guess if this video has higher or lower views than the video on the left.\n\u003cbr\u003e\u003cbr\u003e\n\u003cimg src=\"https://dane.lol/assets/viewguesser/instructions/example.gif\" alt=\"Viewguesser example\"/\u003e\n\u003cbr\u003e\u003cbr\u003e\nOnce the player has made their selection, the view count of the video will then be displayed. If correct, the video will then move to the left and a new video will be populated on the right. If incorrect, the game will end and a losing screen is displayed. The losing screen will change depending on the final score.\n\u003c/details\u003e\n\n## 📦 Build\n### Docker (Recommended)\n#### Running with Docker Compose\n##### 1. Pull the Docker Image\nYou can pull the latest version of the pre-built Docker image from GitHub's Container Registry:\n```\ndocker pull ghcr.io/danexrc/danexrc/dane.lol:latest\n```\n\n##### 2. Start the Services with Docker Compose\nTo start both the server and PostgreSQL database, use the provided docker-compose.yml file. This will automatically set up the environment, including creating the necessary database schema.\n```\nversion: '3'\nservices:\n  dane.lol:\n    image: ghcr.io/danexrc/danexrc/dane.lol:latest\n    container_name: dane.lol\n    restart: unless-stopped\n    environment:\n      - PG_DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/yourdatabase\n      - VIEWGUESSER_YOUTUBE_API_KEY=$VIEWGUESSER_YOUTUBE_API_KEY\n      - VIEWGUESSER_SEARCH_QUERY_AMOUNT=$VIEWGUESSER_SEARCH_QUERY_AMOUNT\n      - VIEWGUESSER_NODE_CACHE_TTL_SECONDS=$VIEWGUESSER_NODE_CACHE_TTL_SECONDS\n      - VIEWGUESSER_USER_QUEUE_TTL_MILLISECONDS=$VIEWGUESSER_USER_QUEUE_TTL_MILLISECONDS\n      - VIEWGUESSER_NODE_CACHE_CHECK_PERIOD_SECONDS=$VIEWGUESSER_NODE_CACHE_CHECK_PERIOD_SECONDS\n      - VIEWGUESSER_JWT_SECRET=$VIEWGUESSER_JWT_SECRET\n      - VIEWGUESSER_BLOCK_DURATION_MILLISECONDS=$VIEWGUESSER_BLOCK_DURATION_MILLISECONDS\n    ports:\n      - \"3000:3000\"\n    depends_on:\n      - postgres\n    networks:\n      - web\n\n  postgres:\n    image: postgres:16-bullseye\n    hostname: postgresql\n    container_name: postgresql\n    ports:\n      - \"5432:5432\"\n    environment:\n      POSTGRES_USER: $POSTGRES_USER\n      POSTGRES_PASSWORD: $POSTGRES_PASSWORD\n      POSTGRES_DB: $DATABASE_NAME\n    volumes:\n      - pgdata:/var/lib/postgresql/data\n      - ./sql/schema.sql:/docker-entrypoint-initdb.d/schema.sql\n    restart: unless-stopped\n    networks:\n      - web\n\nvolumes:\n  pgdata:\n  \nnetworks:\n  web:\n```\n```\ndocker-compose up -d\n```\n\nThis will start both dane.lol and the postgres services, with the server accessible on port 3000 and the database on port 5432.\n\n#### Running Standalone with Docker (Optional)\n\nIf you want to run only the server container without PostgreSQL, you can do so by setting the required environment variables inline:\n\n```\ndocker run -d \\\n  -p 3000:3000 \\\n  --name dane.lol-api \\\n  -e PG_DATABASE_URL=postgresql://username:password@postgres:5432/database-name \\\n  -e VIEWGUESSER_YOUTUBE_API_KEY=your-api-key \\\n  -e VIEWGUESSER_SEARCH_QUERY_AMOUNT=40 \\\n  -e VIEWGUESSER_NODE_CACHE_TTL_SECONDS=3600 \\\n  -e VIEWGUESSER_USER_QUEUE_TTL_MILLISECONDS=10000 \\\n  -e VIEWGUESSER_NODE_CACHE_CHECK_PERIOD_SECONDS=60 \\\n  -e VIEWGUESSER_JWT_SECRET=your-jwt-secret \\\n  -e VIEWGUESSER_BLOCK_DURATION_MILLISECONDS=5000 \\\n  ghcr.io/danexrc/danexrc/dane.lol:latest\n```\nThe server will now be accessible at ``http://localhost:3000``\n\n### Node.js\n##### 1. Clone the Repository\nClone the repository from GitHub:\n```\ngit clone https://github.com/your-username/your-repository.git\n```\n\n##### 2. Navigate to the Project Directory\n```\ncd dane.lol\n```\n\n##### 3. Set Up PostgreSQL\nIf you're running outside of Docker, you need to have PostgreSQL installed and configured.\n  - Create a Database and User:\n    Open a psql session and run the following commands, replacing placeholders with your desired database name, username, and password:\n\n    ```\n    CREATE DATABASE yourdatabase;\n    CREATE USER youruser WITH PASSWORD 'yourpassword';\n    GRANT ALL PRIVILEGES ON DATABASE yourdatabase TO youruser;\n    ```\n\n- Run the Database Schema:\n    Execute the schema.sql file to set up the necessary tables. Run this command in your terminal:\n  \n    ```\n    psql -U youruser -d yourdatabase -f path/to/sql/schema.sql\n    ```\n    Replace ``youruser``, ``yourdatabase``, and the ``path`` as necessary.\n\n##### 4. Create a .env File\nIn the root directory of the project, create a .env file and add the necessary environment variables:\n\n```\n# YouTube API key\nVIEWGUESSER_YOUTUBE_API_KEY=your-api-key \n\n# PostgreSQL Connection String (for scoreboard)\nPG_DATABASE_URL=postgresql://youruser:yourpassword@localhost:5432/yourdatabase \n\n# Number of search queries to run when collecting videos from the YouTube API\nVIEWGUESSER_SEARCH_QUERY_AMOUNT=40\n\n# Cache and Queue Settings\nVIEWGUESSER_NODE_CACHE_TTL_SECONDS=3600\nVIEWGUESSER_USER_QUEUE_TTL_MILLISECONDS=10000\nVIEWGUESSER_NODE_CACHE_CHECK_PERIOD_SECONDS=60\n\n# JWT Secret\nVIEWGUESSER_JWT_SECRET=your-jwt-secret\n\n# Block duration for incorrect attempts\nVIEWGUESSER_BLOCK_DURATION_MILLISECONDS=5000\n```\n\n##### 5. Install Required Packages\nRun the following command to install all dependencies:\n```\nnpm install\n```\n\n##### 6. Run the Project\nTo start the server, use:\n```\nnpm start\n```\n\nThe server should now be running on http://localhost:3000.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaneffx%2Fdane.lol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaneffx%2Fdane.lol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaneffx%2Fdane.lol/lists"}