{"id":13672352,"url":"https://github.com/kooparse/bast","last_synced_at":"2025-04-10T18:34:06.604Z","repository":{"id":42385781,"uuid":"221123523","full_name":"kooparse/bast","owner":"kooparse","description":":monkey: Web analytics focusing on privacy and simplicity.","archived":false,"fork":false,"pushed_at":"2024-06-01T14:38:13.000Z","size":1677,"stargazers_count":96,"open_issues_count":10,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T00:08:06.429Z","etag":null,"topics":["analytics","javascript","rust","typescript"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/kooparse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2019-11-12T03:39:01.000Z","updated_at":"2025-03-15T19:54:59.000Z","dependencies_parsed_at":"2024-05-01T15:40:41.095Z","dependency_job_id":"29196917-73f4-464b-a4fd-a9a97d6bcca2","html_url":"https://github.com/kooparse/bast","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fbast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fbast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fbast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fbast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kooparse","download_url":"https://codeload.github.com/kooparse/bast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271894,"owners_count":21075800,"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":["analytics","javascript","rust","typescript"],"created_at":"2024-08-02T09:01:33.207Z","updated_at":"2025-04-10T18:34:06.585Z","avatar_url":"https://github.com/kooparse.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Bast\n![CI](https://github.com/kooparse/bast/workflows/CI/badge.svg)\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n# ⚠️ This project is not maintained anymore.\n\u003cbr/\u003e\n\u003cbr/\u003e\n\nBast is an open sourced web analytics, giving simple informations about your site traffics. \n\nI did this project for myself. It is currently used by a couple of friends so it might be useful for others (if you’re a small business, an indie, a blogger…). This project is free and you can do whatever you want with it.\n\nThe backend is made in Rust using [actix-web](https://github.com/actix/actix-web) web framework and [diesel](https://github.com/diesel-rs/diesel) as PostgreSQL ORM. The frontend is (mostly) static and made in React with [Next](https://github.com/zeit/next.js). I used [chakra-ui](https://chakra-ui.com/) for the interface (but the graph is custom).\n\n## Interface\n\n\u003cimg src=\"https://i.imgur.com/DsE3xcM.png\" alt=\"preview\" /\u003e\n\u003cbr/\u003e\n\n## Tracking\nWe track all metrics over time, days as our atomic scale.\n\n**Pageviews** are anonymous or identified visitors, so 3 visitors equals 3 pageviews. On each pageview we store the **referrer**, the current **url**, etc... \n\n**Users** is the number of unique visitors to your website. We don’t rely on cookies to identify any particular user. We construct an identifier from his IP address and his user-agent (hashed and stored in the database), It’s really inspired by what [Ackee](https://github.com/electerious/Ackee) does. So if a user visits two pages, you will see 2 pageviews but only 1 user. \n\nA new **session** starts after 30 minutes of inactivity. So if a user opens your websites 3 times under 30 minutes, it counts as 1 session. If it's 1 time under 30 minutes and 1 time after; it counts as 2 sessions by the same user.\n\nThe **average time** is stored only if it’s between 5 secondes and 30 minutes on each sessions. \n\nWe use the [woothee](https://github.com/woothee/woothee-rust) to parse and get information from user-agents; we get the **browser name**, **operating system** and other useful data.\n\nAnd that’s it! Also, I would love to have the geolocation but not for now.\n\n\u003cbr/\u003e\n\n## Contributing to the project\n\nDon’t be shy about shooting any questions you may have. If you are a beginner/junior, don’t hesitate, I will always encourage you. It’s a safe place here. Also, I would be very happy to receive any kind of pull requests, you will have (at least) some feedback/guidance rapidly.\n\nBehind screens, there are human beings, living any sort of story. So be always kind and respectful, because we all sheer to learn new things. See [contributing](https://github.com/kooparse/bast/blob/master/CONTRIBUTING.md) file for more exhaustive details.\n\n\u003cbr/\u003e\n\n## Deploy Bast with Heroku\nEasiest way to deploy the project!\u003cbr/\u003e\n\u003cbr/\u003e\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Install on your machine\n\n### Unix and OS/X\n\n### For the api.\n\n- Fork or download this repository.\n- `cd` to the project's location.\n- `cargo install diesel_cli --no-default-features --features \"postgres\"`.\n- `diesel setup` (You'll need postgres up and running).\n\n### For the front.\n\n- `cd` to website folder.\n- `npm install`\n\n\u003cbr/\u003e\n\n\n## Running Bast with Docker on your machine\n\nOnce docker is installed on your machine, you just need to do: \n- `docker-compose up`\n- Live at `http://localhost/3333`\n\nAlso you could customize all environment variables from `docker-compose.yml`\n\n\u003cbr/\u003e\n\n## Running the api in development\n\n### For the api.\n\nFirst create a new `.env` file at the root.\nYou should use `.env.sample` to get all required values.\n\nIf you want to watch the project while developping it, install `cargo-watch` first.\n\n- `cargo install cargo-watch`\n- run `cargo watch -i \"website/**/*\" -x run`\n- Live at `http://localhost/3333`.\n\nOtherwise simply run `cargo run`.\n\n### For the front (website).\n\n- `cd` to website folder.\n- `npm run dev`\n- Live at `http://localhost/3000`.\n\n\u003cbr/\u003e\n\n\n## Thanks\n\nI read the [Fathom](https://github.com/usefathom/fathom) codebase, it’s a pretty cool project made in Golang. If you don’t want to spend time on hosting your own web analytics and you would like to pay for a service, you should definitely check their [plans](https://usefathom.com/pricing).\n\nTo identify users without using cookies, I was inspired by [Ackee](https://github.com/electerious/Ackee). So don't hesitate to check this cool project; it's fully made in javascript. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkooparse%2Fbast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkooparse%2Fbast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkooparse%2Fbast/lists"}