forked from open-nomie/nomie5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4c42c7d
Showing
116 changed files
with
22,998 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
public/bundle.* | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Open Nomie - Private & Encrypted Mood & Life Tracker | ||
|
||
 | ||
|
||
I started [building Nomie in 2014](https://nomie.app/blog/original-nomie-blog-post) and over the next handful of years I release 3 major versions in 3 different JS technologies (VanilaJS -> Ionic -> ReactNative). The Nomie user base grew to ~100,000 users spread over multiple versions and multiple platforms. | ||
|
||
In March 2019 I decided to remove the apps from Google Play and the App Store and step away from the "native app world" has it's too exhausting. | ||
|
||
While the native apps will continue to run for those who installed it before, I wanted to take the best parts of Nomie 1, 2 and 3 and release it as an open source solution that could be run in the browser. This project is that result. | ||
|
||
## [Svelte](https://svlete.dev) | ||
|
||
This rewrite/port uses SvelteJS https://svlete.dev - a great tool for building fast / reactive single page apps (like Vue, React) without the framework. | ||
|
||
## [Blockstack](https://blockstack.org) | ||
|
||
Since this version runs in the browser, it's using Blockstack for auth and storage. Blockstack is all about decentralized apps, and giving users full control over their data and keeps everything (trackers, boards, every single log) encrypted, only to be decrypted with your blockstack profile. | ||
|
||
## Running it Locally | ||
|
||
``` | ||
git clone [email protected]:nomie-app/nomie.git | ||
cd nomie | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
## Structure Overview | ||
|
||
- **/src** | ||
- **/src/components** - simple single ui components to build the user interfact | ||
- **/src/containers** - complicated components | ||
- **/src/modules** - models and commonly used functions | ||
- **/src/routes** - nomie app's primary routes | ||
- **/src/scss** - global SCSS styling, variables, bootstrap | ||
- **/src/store** - application state management | ||
- **/src/utils** - common utility functions | ||
|
||
## Meet the Nouns | ||
|
||
- **Tracker** - primarily represented by a button on the "track board". Trackers are represented by their hashtag in notes - for example: #sleep(160000). | ||
- **Board** - a board is specific group of trackers. | ||
- **Board Tabs** - how you switch boards on the track tab | ||
- **Log** - a record event. A lot contains a note, a note can contain unlimited numbers of tags; e.g: #mood(4) #pizza #beer(12). Logs can contain a lat and long. Tracker Objects and their values are parsed out of the logs in real time. | ||
|
||
## Data Storage | ||
|
||
Blockstack.org is a "Decentralized computing network and app ecosystem" - basically, it offers a means to auth a user, and get/put files that are encrypted. This means Nomie works with flat files that require a network lookup. I've decided to create a "log book" for each month. Even heavy users will have a monthly book less than 100k, so that seemed reasonable. Plus doing it every day would require way too many network lookups when generating stats, and each year would be too big for and risky. | ||
|
||
/v01/data/books/2019-01 | ||
|
||
- v01 - a way to make upgrading easier without affecting users existing data stores | ||
- data - generic | ||
- books - holder of books | ||
- 2019-01 - json array of logs | ||
|
||
/v01/data/trackers.json - trackers | ||
/v01/data/boards.json - users board configuration | ||
|
||
# Coding Rules | ||
|
||
- **Keep it readable** - focus on writing code that new people can easily understand and follow. If the code can't do it, then do it with comments. There's no such thing as too much commenting. | ||
- **Keep it under 300 lines** - the goal is to keep files under 300 lines of code. Note: Sometimes that's not feasible. | ||
- **Keep it flexible** - think in components. If you're doing something more than once, it most likely should be a component. | ||
- **Keep cleaning, organizing and testing** - this project didn't start very clean, or ready for unit testing, this should be an on going objective. | ||
- **Use what's there** - Twitter bootstrap ([and all it's classes](https://getbootstrap.com/)) are available, reuse what already exists before writing new - especially css. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Todo | ||
|
||
- [] - come up with some way to pull in content | ||
- [] - TESTING! | ||
- [] - add goals | ||
- [] - make logs FULLY editable | ||
- [x] - do onboarding slides | ||
- [x] - make export work with events | ||
- [x] - make /public/global.css pull from scss | ||
- [x] - complete tracker editor | ||
- [x] - start stats | ||
- [x] - get search working | ||
- [x] - Make location lookup work | ||
- [x] - timer input | ||
- [] - Edit / Create boards | ||
- [x] - keypad input | ||
- [x] - slider input | ||
- [x] - board support | ||
- [-] - Tracker Editor | ||
- [x] - Get date picker for desktop | ||
- [x] - Setup starter packs - make them easy for others to contirbute | ||
- [x] - think about adding page view data to a store - to maintain the state as a users clicks around |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const fs = require('fs'); | ||
// Read Public and Package file | ||
let public = fs.readFileSync('./public/index.html', 'UTF-8'); | ||
let packageJSON = JSON.parse(fs.readFileSync('./package.json', 'UTF-8')); | ||
// Replace app version with app version | ||
public = public.replace(/APP_VERSION/g, packageJSON.version.substr(0, 10)); // substr to limit any fuckery | ||
|
||
fs.writeFileSync('./public/index.html', public, 'UTF-8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let packageJson = require('../package.json'); | ||
let semver = require('semver'); | ||
let fs = require('fs'); | ||
packageJson.version = semver.inc(packageJson.version, 'patch'); | ||
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2), 'UTF-8'); | ||
|
||
console.log(`Nomie Version is now set to: ${packageJson.version}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[build] | ||
command = "npm run build" | ||
publish = "public" | ||
[[redirects]] | ||
from = "/*" | ||
to = "/index.html" | ||
status = 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"name": "nomie-dap", | ||
"version": "4.0.51", | ||
"scripts": { | ||
"build": "node build-tools/bust-cache.js && rollup -c", | ||
"autobuild": "rollup -c -w", | ||
"scss": "node-sass ./src/scss/main.scss --output=./public --watch=./src/scss/**/*.scss --include-path", | ||
"watch:scss": "nodemon -e scss -x \"npm run scss\"", | ||
"dev": "concurrently \"run-p start:dev autobuild\" \"npm run scss\"", | ||
"dev-original": "run-p start:dev autobuild", | ||
"start": "sirv public --single", | ||
"start:dev": "sirv public --cors --single --dev", | ||
"patch": "node build-tools/patch-version.js", | ||
"test:unit": "jest src/**/*.spec.js" | ||
}, | ||
"devDependencies": { | ||
"@kazzkiq/svelte-preprocess-scss": "^0.1.3", | ||
"@sveltejs/gestures": "0.0.1", | ||
"bootstrap": "^4.3.1", | ||
"concurrently": "^4.1.1", | ||
"jest": "^24.8.0", | ||
"mini-css-extract-plugin": "^0.7.0", | ||
"node-sass": "^4.12.0", | ||
"nomie-uom": "^1.0.2", | ||
"npm-run-all": "^4.1.5", | ||
"pre-commit": "^1.2.2", | ||
"rollup": "^1.10.1", | ||
"rollup-plugin-commonjs": "^9.3.4", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-livereload": "^1.0.0", | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
"rollup-plugin-node-resolve": "^4.2.3", | ||
"rollup-plugin-replace": "^2.2.0", | ||
"rollup-plugin-svelte": "^5.0.3", | ||
"rollup-plugin-terser": "^4.0.4", | ||
"sass-loader": "^7.1.0", | ||
"semver": "^6.2.0", | ||
"sirv-cli": "^0.4.4", | ||
"style-loader": "^0.23.1", | ||
"svelte": "^3.0.0", | ||
"svelte-preprocess-css-global": "0.0.1", | ||
"svelte-routing": "^1.2.0" | ||
}, | ||
"dependencies": { | ||
"d3-scale": "^3.0.0", | ||
"dayjs": "^1.8.14", | ||
"md5": "^2.2.1", | ||
"svelte-awesome": "^1.4.1", | ||
"svelte-loader": "^2.13.4", | ||
"svelte-spinner": "^2.0.1" | ||
}, | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* | ||
Access-Control-Allow-Origin: https://browser.blockstack.org |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
body { | ||
color: #333; | ||
margin: 0; | ||
padding: 8px; | ||
box-sizing: border-box; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; | ||
} | ||
a { | ||
color: rgb(0,100,200); | ||
text-decoration: none; | ||
} | ||
a:hover { | ||
text-decoration: underline; | ||
} | ||
a:visited { | ||
color: rgb(0,80,160); | ||
} | ||
label { | ||
display: block; | ||
} | ||
input, button, select, textarea { | ||
font-family: inherit; | ||
font-size: inherit; | ||
padding: 0.4em; | ||
margin: 0 0 0.5em 0; | ||
box-sizing: border-box; | ||
border: 1px solid #ccc; | ||
border-radius: 2px; | ||
} | ||
input:disabled { | ||
color: #ccc; | ||
} | ||
input[type="range"] { | ||
height: 0; | ||
} | ||
button { | ||
color: #333; | ||
background-color: #f4f4f4; | ||
outline: none; | ||
} | ||
button:active { | ||
background-color: #ddd; | ||
} | ||
button:focus { | ||
border-color: #666; | ||
} */ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf8" /> | ||
<title>Nomie Dap</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=contain" /> | ||
|
||
<meta name="apple-mobile-web-app-title" content="Nomie 4" /> | ||
<meta name="apple-mobile-web-app-capable" content="yes" /> | ||
<link rel="apple-touch-startup-image" href="/images/nomie-splash.png" /> | ||
<link rel="apple-touch-icon" href="/images/icon.png" /> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="default" /> | ||
<link rel="icon" type="image/png" href="/favicon.png" /> | ||
<link rel="icon" sizes="192x192" href="/images/icon.png" /> | ||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" /> | ||
<!-- Browserstack for decentralied / encrypted storage --> | ||
<script | ||
src="https://unpkg.com/[email protected]/dist/blockstack.js" | ||
integrity="sha384-+qYCYoUGzsMLAzHm80c4DyhbWgHBBb2N0RFqsg7Lws5ljtBtj/IwpgxZkiR7j7lp" | ||
crossorigin="anonymous" | ||
></script> | ||
<!-- Leaflet for Map --> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/dist/leaflet.css" | ||
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" | ||
crossorigin="" | ||
/> | ||
<script | ||
src="https://unpkg.com/[email protected]/dist/leaflet.js" | ||
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" | ||
crossorigin="" | ||
></script> | ||
<!-- GeoCoding --> | ||
|
||
<!-- Load Esri Leaflet from CDN --> | ||
<script | ||
src="https://unpkg.com/[email protected]/dist/esri-leaflet.js" | ||
integrity="sha512-tyPum7h2h36X52O2gz+Pe8z/3l+Y9S1yEUscbVs5r5aEY5dFmP1WWRY/WLLElnFHa+k1JBQZSCDGwEAnm2IxAQ==" | ||
crossorigin="" | ||
></script> | ||
|
||
<!-- Load Esri Leaflet Geocoder from CDN --> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/dist/esri-leaflet-geocoder.css" | ||
integrity="sha512-v5YmWLm8KqAAmg5808pETiccEohtt8rPVMGQ1jA6jqkWVydV5Cuz3nJ9fQ7ittSxvuqsvI9RSGfVoKPaAJZ/AQ==" | ||
crossorigin="" | ||
/> | ||
<script | ||
src="https://unpkg.com/[email protected]/dist/esri-leaflet-geocoder.js" | ||
integrity="sha512-uK5jVwR81KVTGe8KpJa1QIN4n60TsSV8+DPbL5wWlYQvb0/nYNgSOg9dZG6ViQhwx/gaMszuWllTemL+K+IXjg==" | ||
crossorigin="" | ||
></script> | ||
|
||
<!-- ZMDI for icons --> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css" | ||
/> | ||
<!-- main is from scss/main.scss --> | ||
<link rel="stylesheet" href="/main.css?v=APP_VERSION" /> | ||
<!-- bundle is all the styles from the app and components--> | ||
<link rel="stylesheet" href="/bundle.css?v=APP_VERSION" /> | ||
</head> | ||
|
||
<body> | ||
<script src="/bundle.js?v=APP_VERSION"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.