Skip to content

Commit cd1b694

Browse files
committed
mix phx.new atm #23
1 parent 842418d commit cd1b694

File tree

921 files changed

+5258
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

921 files changed

+5258
-14
lines changed

.formatter.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
import_deps: [:ecto, :ecto_sql, :phoenix],
3+
subdirectories: ["priv/*/migrations"],
4+
plugins: [Phoenix.LiveView.HTMLFormatter],
5+
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"]
6+
]

README.md

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<img src="https://github.com/dwyl/atm/assets/194400/1d71bfb3-1c55-46f0-8c0e-b72b725937bd" height="300">
3-
<h1>**A**ctionable **T**imely **M**etrics.</h1>
3+
<h1><b>A</b>ctionable <b>T</b>imely <b>M</b>etrics.</h1>
44

55

66

@@ -19,10 +19,8 @@ in Web Application/Site Development,
1919
with more than 100 project teams and organizations
2020
we've noted one alarming fact:
2121

22-
**_Most_ Product Owners don't _check_ Google Analytics**
23-
and use the **insights** to **_drive_ decisions**.
24-
25-
22+
> **_Most_ Product Owners don't _check_ Google Analytics**
23+
or use the **insights** to **_drive_ decisions**.
2624

2725
If the **_leaders_ aren't data driven**,
2826
_nobody_ `else` in the team will be.
@@ -39,20 +37,60 @@ More detail in: https://github.com/dwyl/atm/issues/16
3937

4038
## Name? 🏧
4139

42-
"ATM" stands for "Actionable Timely Metrics" (_this is a ["backronym"](https://en.wikipedia.org/wiki/Backronym)). We **really** wanted to give this project a name that is both short, _memorable_ and helps stakeholders _understand_ the importance of analytics data to the organisation!
43-
40+
"ATM" stands for "**A**ctionable **T**imely **M**etrics"
41+
(_this
42+
["**backronym**"](https://en.wikipedia.org/wiki/Backronym)
43+
is not accidental_).
44+
We _really_ wanted to give this project a name
45+
that is both short, _memorable_
46+
and helps stakeholders _understand_
47+
the importance of metrics to the organization!
4448

4549
![free-cash-withdrawals](https://github.com/dwyl/atm/assets/194400/78fda825-5f71-4eed-8738-aef033829d7c)
4650

47-
# Who?
51+
We want `people` to understand that being data-driven
52+
is like having a "**_free_**" **cash machine**.
4853

49-
This project aims to both _simplify_ the language/vocabulary around analytics/metrics and create a simple way of tracking _any_ event in _any_ web app.
5054

51-
If it's not _immediately obvious_ **Why** this project is valuable and **How** it works,
52-
we have failed. So if you are scratching your head wondering: "_Is this for **me**?_" ...
53-
**please _help_ us** by describing your situation so we can **_help_ you** realise the _value_ of the data you are sending to Google Analytics and then _ignoring_...
55+
56+
# Who?
57+
58+
This project if for the `people`
59+
that _get_ it
60+
and want an easy way for others
61+
in their team/organization to do the same.
62+
63+
We aim to both
64+
_simplify_ the language/vocabulary around analytics/metrics
65+
and create a _simple_ way
66+
of tracking _any_ event in _any_ web/mobile app.
67+
68+
If it's not _immediately obvious_ **Why** this project
69+
is valuable and **How** it works, we have failed.
70+
So if you are scratching your head wondering:
71+
"_Is this for **me**?_" ...
72+
**please _help_ us** by describing your situation
73+
so we can **_help_ you** realize the _value_
74+
of the data you are sending
75+
to Google Analytics
76+
and then _ignoring_...
5477

5578
# How?
5679

57-
+ [ ] Define the basic schema for an Events (Analytics) Table!
58-
+ [ ] Implement it!
80+
If you haven't already,
81+
please try the demo:
82+
83+
84+
85+
## Run on `localhost`
86+
87+
Run
88+
`mix setup`
89+
to install and setup dependencies.
90+
91+
Now visit
92+
[`localhost:4000`](http://localhost:4000)
93+
in your web browser.
94+
95+
## Contributing?
96+

assets/css/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import "tailwindcss/base";
2+
@import "tailwindcss/components";
3+
@import "tailwindcss/utilities";
4+
5+
/* This file is for your main application CSS */

assets/js/app.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// If you want to use Phoenix channels, run `mix help phx.gen.channel`
2+
// to get started and then uncomment the line below.
3+
// import "./user_socket.js"
4+
5+
// You can include dependencies in two ways.
6+
//
7+
// The simplest option is to put them in assets/vendor and
8+
// import them using relative paths:
9+
//
10+
// import "../vendor/some-package.js"
11+
//
12+
// Alternatively, you can `npm install some-package --prefix assets` and import
13+
// them using a path starting with the package name:
14+
//
15+
// import "some-package"
16+
//
17+
18+
// Include phoenix_html to handle method=PUT/DELETE in forms and buttons.
19+
import "phoenix_html"
20+
// Establish Phoenix Socket and LiveView configuration.
21+
import {Socket} from "phoenix"
22+
import {LiveSocket} from "phoenix_live_view"
23+
import topbar from "../vendor/topbar"
24+
25+
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
26+
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
27+
28+
// Show progress bar on live navigation and form submits
29+
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
30+
window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
31+
window.addEventListener("phx:page-loading-stop", _info => topbar.hide())
32+
33+
// connect if there are any LiveViews on the page
34+
liveSocket.connect()
35+
36+
// expose liveSocket on window for web console debug logs and latency simulation:
37+
// >> liveSocket.enableDebug()
38+
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
39+
// >> liveSocket.disableLatencySim()
40+
window.liveSocket = liveSocket
41+

assets/tailwind.config.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// See the Tailwind configuration guide for advanced usage
2+
// https://tailwindcss.com/docs/configuration
3+
4+
const plugin = require("tailwindcss/plugin")
5+
const fs = require("fs")
6+
const path = require("path")
7+
8+
module.exports = {
9+
content: [
10+
"./js/**/*.js",
11+
"../lib/*_web.ex",
12+
"../lib/*_web/**/*.*ex"
13+
],
14+
theme: {
15+
extend: {
16+
colors: {
17+
brand: "#FD4F00",
18+
}
19+
},
20+
},
21+
plugins: [
22+
require("@tailwindcss/forms"),
23+
// Allows prefixing tailwind classes with LiveView classes to add rules
24+
// only when LiveView classes are applied, for example:
25+
//
26+
// <div class="phx-click-loading:animate-ping">
27+
//
28+
plugin(({addVariant}) => addVariant("phx-no-feedback", [".phx-no-feedback&", ".phx-no-feedback &"])),
29+
plugin(({addVariant}) => addVariant("phx-click-loading", [".phx-click-loading&", ".phx-click-loading &"])),
30+
plugin(({addVariant}) => addVariant("phx-submit-loading", [".phx-submit-loading&", ".phx-submit-loading &"])),
31+
plugin(({addVariant}) => addVariant("phx-change-loading", [".phx-change-loading&", ".phx-change-loading &"])),
32+
33+
// Embeds Heroicons (https://heroicons.com) into your app.css bundle
34+
// See your `CoreComponents.icon/1` for more information.
35+
//
36+
plugin(function({matchComponents, theme}) {
37+
let iconsDir = path.join(__dirname, "./vendor/heroicons/optimized")
38+
let values = {}
39+
let icons = [
40+
["", "/24/outline"],
41+
["-solid", "/24/solid"],
42+
["-mini", "/20/solid"]
43+
]
44+
icons.forEach(([suffix, dir]) => {
45+
fs.readdirSync(path.join(iconsDir, dir)).map(file => {
46+
let name = path.basename(file, ".svg") + suffix
47+
values[name] = {name, fullPath: path.join(iconsDir, dir, file)}
48+
})
49+
})
50+
matchComponents({
51+
"hero": ({name, fullPath}) => {
52+
let content = fs.readFileSync(fullPath).toString().replace(/\r?\n|\r/g, "")
53+
return {
54+
[`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`,
55+
"-webkit-mask": `var(--hero-${name})`,
56+
"mask": `var(--hero-${name})`,
57+
"mask-repeat": "no-repeat",
58+
"background-color": "currentColor",
59+
"vertical-align": "middle",
60+
"display": "inline-block",
61+
"width": theme("spacing.5"),
62+
"height": theme("spacing.5")
63+
}
64+
}
65+
}, {values})
66+
})
67+
]
68+
}

assets/vendor/heroicons/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Refactoring UI Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

assets/vendor/heroicons/UPGRADE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
You are running heroicons v2.0.16. To upgrade in place, you can run the following command,
2+
where your `HERO_VSN` export is your desired version:
3+
4+
export HERO_VSN="2.0.16" ; \
5+
curl -L "https://github.com/tailwindlabs/heroicons/archive/refs/tags/v${HERO_VSN}.tar.gz" | \
6+
tar -xvz --strip-components=1 heroicons-${HERO_VSN}/optimized
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)