{"id":19961120,"url":"https://github.com/dense-analysis/pricewarp","last_synced_at":"2025-05-03T22:30:33.607Z","repository":{"id":111472398,"uuid":"371161999","full_name":"dense-analysis/pricewarp","owner":"dense-analysis","description":"A self-serve FOSS cryptocurrency price alert and portfolio tracking system.","archived":false,"fork":false,"pushed_at":"2023-03-11T07:33:07.000Z","size":193,"stargazers_count":7,"open_issues_count":29,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-21T16:57:34.897Z","etag":null,"topics":["cryptocurrency","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dense-analysis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2021-05-26T20:32:41.000Z","updated_at":"2024-01-17T19:22:47.000Z","dependencies_parsed_at":"2023-06-03T07:00:33.019Z","dependency_job_id":null,"html_url":"https://github.com/dense-analysis/pricewarp","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/dense-analysis%2Fpricewarp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dense-analysis%2Fpricewarp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dense-analysis%2Fpricewarp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dense-analysis%2Fpricewarp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dense-analysis","download_url":"https://codeload.github.com/dense-analysis/pricewarp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224374785,"owners_count":17300691,"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":["cryptocurrency","go","golang"],"created_at":"2024-11-13T02:06:26.671Z","updated_at":"2024-11-13T02:06:27.395Z","avatar_url":"https://github.com/dense-analysis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pricewarp\n\nA self-serve FOSS cryptocurrency price alert and portfolio tracking system.\n\nWith this tool you can keep track of cryptocurrency price changes and your crypto portfolio, without having to share your private information with third parties. This project uses an AGPL licence to ensure that it will always be available for those who need it. No frontend frameworks are employed to complicate matters, and Go is used as the backend to ensure timely and reliable delivery of content.\n\n![price alert list](https://user-images.githubusercontent.com/3518142/155859069-5bd83752-8201-444b-887a-1df436b3531b.png)\n![portfolio](https://user-images.githubusercontent.com/3518142/155859067-be96392a-16e8-4bcc-9b1e-a1ba629af1b0.png)\n![example email](https://user-images.githubusercontent.com/3518142/154852169-13587064-2b98-4aa3-a2c2-e85ec3013375.png)\n\n## Installation\n\nYou can install this application with the following steps.\n\n1. Install Go 1.18\n2. Create a `.env` file in the project\n3. Run `./build.sh`\n4. Create a Postgres user and database\n5. Apply database migrations with `bin/migrate`\n\nYou may wish to set up a Postgres user for development like so:\n\n```\nsudo su postgres\npsql\n\npostgres=# CREATE ROLE some_user WITH LOGIN PASSWORD 'some_password';\npostgres=# CREATE DATABASE some_database;\npostgres=# \\c some_database\nsome_database=# GRANT ALL ON ALL TABLES IN SCHEMA public to some_user;\nsome_database=# GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO some_user;\n```\n\nYour `.env` file should look like so:\n\n```\nDEBUG=true\nADDRESS=:8000\n\nDB_USERNAME=some_user\nDB_PASSWORD=some_password\nDB_HOST=localhost\nDB_PORT=5432\nDB_NAME=some_database\n\nSMTP_USERNAME=email_username\nSMTP_PASSWORD=email_password\nSMTP_FROM=email_username@email.host\nSMTP_HOST=email.host\nSMTP_PORT=465\n\nSESSION_SECRET=some_32_char_secret_cookie_value\n```\n\nThe `DEBUG` flag enables serving files from `/static`, and other debugging\ninformation. This should be set to `false` in production.\n\n## Loading Price Data\n\nRun `bin/ingest` to load cryptocurrency price data into the database. This\nshould be run periodically to get the latest prices for cryptocurrencies.\nIt is recommended to run this program before `bin/notify`.\n\n### Reducing Database Size\n\nStoring this price data can take up lots of space. You can condense the price\ndata into daily average prices by running `./condense-prices.sh`.\n\nYou can keep track of how much space your database is using like so:\n\n```\n$ sudo su postgres\n$ psql\n\npostgres=# select pg_size_pretty(pg_database_size('pricewarp'));\n pg_size_pretty \n----------------\n 29 MB\n(1 row)\n```\n\nYou can consider running `VACUUM FULL ANALYZE;` to compress the price data as \nsmall as possible. Please refer to \n[the Postgres documentataion](https://www.postgresql.org/docs/current/sql-vacuum.html)\nfor information on vacuuming.\n\n## Sending Email Alerts\n\nRun `bin/notify` to send price alert emails using the SMTP credentials set in\nthe `.env` file. You should create test alerts to ensure emails will be delivered.\nPopular mail hosts can reject mail for all kinds of reasons.\n\nOne easy way to ensure your mail will be delivered is to send with GMail as the SMTP\nprovider to a GMail address, or similar for other popular email providers.\n\n## Creating users\n\nRun `bin/adduser EMAIL PASSWORD` to add a user with a given email address and\npassword. You should be able to log in to the site after the program completes\nsuccessfully.\n\n## Running the Server\n\nThis section will describe running the server with nginx.\n\nCopy at least the contents of `bin` and `static` to a directory on a webserver,\nand set up nginx to serve your static content and work as a reverse proxy.\n\n```nginx\nserver {\n    # ...\n\n    location /static {\n        include expires_headers;\n        root /your/dir;\n    }\n\n    location / {\n        proxy_set_header X-Forwarded-For $remote_addr;\n        proxy_set_header X-Forwarded-Proto $scheme;\n        proxy_set_header Host $http_host;\n        proxy_set_header REMOTE_ADDR $remote_addr;\n        proxy_redirect off;\n\n        # Use the port you're running the server with here.\n        proxy_pass http://localhost:8000/;\n    }\n}\n```\n\nYou can set cron rules to start the server up on boot, and to periodically load\nprice data and send email alerts.\n\n```cron\n@reboot cd /your/dir \u0026\u0026 bin/pricewarp \u0026\u003e server.log\n\n  */10    *  *   *   *     cd /your/dir \u0026\u0026 bin/ingest\n  1-59/10 *  *   *   *     cd /your/dir \u0026\u0026 bin/notify\n  2       0  *   *   *     cd /your/dir \u0026\u0026 ./condense-prices.sh\n```\n\nYou should configure Postgres to vacuum deleted rows for the database, or space\nwill not be reclaimed for condensed prices. You could use the following in the\ncrontab for the `postgres` user.\n\n```cron\n  3       0  *   *   *     psql pricewarp -qc 'vacuum full analyze;'\n```\n\nYou could start your server right away with `nohup`.\n\n```bash\nnohup bin/pricewarp \u0026\u003e server.log \u0026\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdense-analysis%2Fpricewarp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdense-analysis%2Fpricewarp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdense-analysis%2Fpricewarp/lists"}