Giter VIP home page Giter VIP logo

cynnexis / tide Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 5.94 MB

๐ŸŒŠ Tide is an application that helps reduce panic attacks with a simple breathing exercise.

Home Page: https://cynnexis.github.io/tide/

License: GNU Affero General Public License v3.0

Kotlin 0.05% Swift 0.18% Objective-C 0.02% Dart 75.88% Makefile 3.77% Shell 2.66% Dockerfile 4.51% HTML 1.77% CMake 3.46% C++ 7.38% C 0.32%
calm panic-attacks flutter breathing

tide's Introduction

๐ŸŒŠ Tide - Breathing Exercise to Calm Yourself Down

Tide CI/CD website status Tide Release repo size total release download license

Tide Cover

Tide is an application that helps reduce panic attacks with a simple breathing exercise.

Official website: cynnexis.github.io/tide/

Get it on Google Play
Go to the Webapp

๐ŸŽฏ Goals

Panic attacks can happen anywhere, at anytime. In a world where we have access to a limitless number of digital resources at the tip of our fingers, we can reduce those attacks through different ways (apps, videos, etc.). However, as I experienced multiple times, most of those resources are placed behind advertisements, which can be irritating or even aggravating depending on the content. Those useful resources should always be available for people traversing those delicate moments, and have an ads-free experience.

Hence, I initiated Tide, a very simple app that help the user to calm themselves down by timing the breath in and breath out, and imitating the diaphragm dilatation, while being free with no advertisements. As a result, anyone can have this application and use it with no stress of being disturbed by one of this awful and distressful ad.

๐Ÿ“ฅ Download built releases

You can download the built executables or installers from the release page, or from here to get the latest version:

Android:

iOS:

โš ๏ธ This package has not been signed.

โš ๏ธ The developers behind this project do not have a macOS and an iPhone. This package has been compiled through the CI/CD workflow, with the OSX runner. As a result, it has not been tested, and might not work as expected.

Windows:

Web:

The web release is a compressed archive containing the built HTML, CSS and JavaScript files to serve the application.

๐Ÿ”Œ Getting Started

The following instructions will get you a copy of the source code, and help you execute it.

๐Ÿ“ฆ Requirements

This project requires Flutter, SDK version: minimum 2.3.0.

โš’๏ธ Installation

The first thing to do is to download the project, either by downloading the ZIP file and extract it somewhere in your machine, or by cloning the project with git clone https://github.com/Cynnexis/tide.git tide.

Then, you need to configure the project by creating tide.yaml at the root of the project. You can copy it from tide.sample.yaml to have the structure of the configuration. Then, edit it to configure the Tide project and customize it.

Note that you can rename this file tide.yml (and not .yaml), but you will need to change the asset name in pubspec.yaml.

The following steps will assume that the current directory is the project root.

  1. flutter create --no-overwrite .
  2. flutter pub get
  3. flutter run

The app should be running now.

๐Ÿณ Using Docker

You can build a Docker image to serve the web application of Tide. All Docker files are stored under the docker/ folder, but you can use the Makefile commands to build it.

To build them, enter the following command:

make build-docker

This command will call docker/build.bash, a bash script that uses tide.yaml to build the Dockerfiles. At the end of the process, you should have the Docker image cynnexis/tide:web, that you can use to serve the application:

With the Makefile:

make docker-server

... or with the docker command:

docker run -d \
	--name=tide-web \
	--hostname="tide-web" \
	--publish 80:80 \
	-v "/etc/timezone:/etc/timezone:ro" \
	-v "/etc/localtime:/etc/localtime:ro" \
	-e TZ \
	"cynnexis/tide:web"

And connect to http://localhost:80/

โœ… Tests

Tide has units, widgets and integration tests. This section will help you understand how tests are structured, and how to execute them.

Unit and Widget Tests

Unit and widget test files are stored under the test/ directory. All files that ends with _test.dart are considered test files.

Most widget tests uses golden files to assert that they render as expected. However, according to the Flutter issue #36667, golden images might change from one platform to another. That is why all golden images stored in test/golden-images/ are separated in sub-folders representing the platform. However, not all golden images might have been created, as the platforms might not be accessible by the developer(s). If you notice that the golden files are missing for your platform, please execute the following command at the root of the project:

make update-goldens

... or:

flutter test --update-goldens --dart-define=FLUTTER_TEST=true

This will generate all golden images for your platform. We encourage you to create a pull-request with the new golden images to contribute to the project!

Once the golden files are ready, you can execute the tests with:

make test

... or:

flutter test --dart-define=FLUTTER_TEST=true

You can also execute the test in a Docker container. To do so, first build the cynnexis/tide:sdk Docker image:

./docker/build.bash --only=sdk

Then, execute:

make docker-test

... or:

docker run -it --rm --name=tide-tests cynnexis/tide:sdk test --concurrency=1 --dart-define=FLUTTER_TEST=true

Integration Tests

Only one integration test workflow has been created, and is stored under integration_test/tide_test.dart.

Desktop and mobile devices

To launch it for desktop or mobile devices, use:

make test-integration

... or:

flutter test --dart-define=FLUTTER_TEST=true integration_test/tide_test.dart

Web

To launch it for web, you first need to download the ChromeDriver and launch it:

chromedriver --port=4444

In another terminal, execute the following command at the root of the Tide project:

make test-integration-web

... or:

flutter drive \
  --driver=test_driver/integration_test.dart \
  --target=integration_test/tide_test.dart \
  --dart-define=FLUTTER_TEST=true \
  -d web-server

๐Ÿ—๏ธ Build With

Dart Flutter Android Studio Git GitHub GitHub Actions Docker Apache Inkscape

๐Ÿค Contributing

To contribute to this project, please read our CONTRIBUTING.md file.

We also have a code of conduct to help create a welcoming and friendly environment.

โœ๏ธ Authors

Please see the CONTRIBUTORS.md file.

๐Ÿ“„ License

This project is under the GNU Affero General Public License v3. Please see the LICENSE file for more detail (it's a really fascinating story written in there!).

tide's People

Contributors

cynnexis avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

tide's Issues

๐Ÿ’š Automatic release versionning

Is your feature request related to a problem? Please describe.
The current GitHub Actions workflow of this repository allow to automatically generate a release draft after a pull request has been merged. This is very useful, however the draft doesn't contain any useful information. It would be nice to have the field "Tag" and "Name" filled out by the CI/CD.

Describe the solution you'd like
The program yq can parse the pubspec.yaml file to fetch the current Tide version, and then put it in the Release fields.

Describe alternatives you've considered
To implement this feature, .github/workflows/main.yml must be edited to download yq in the release job, and then use it to fetch the version number by setting an environment variable in GitHub Actions.

Additional context

๐ŸŒ Web support

Is your feature request related to a problem? Please describe.
The app can be exported as a web page, It should be great to have it online, served by GitHub Pages!

Describe the solution you'd like
Make the project web-compatible! See the following website to know how to do it:

https://docs.flutter.dev/get-started/web#add-web-support-to-an-existing-app

Describe alternatives you've considered

Additional context
You will need to adapt the CI/CD to automatically export the Tide website to GitHub page.

โŒš Add a timer for the breathing exercise

Is your feature request related to a problem? Please describe.
The breathing exercise has no time limit... Which is good in some way. But during panic attacks, time seems to flow strangely, and we lose our ability to precisely define when we are.

Describe the solution you'd like
The breathing exercise should have an optional timer that the user can activate or not. To help the user, it should default to 5 minutes, should the user choose to use a timer. A small button can be placed beneath the breathing bubble, and if the user taps on it, a dialog appear to select the desired time.

Describe alternatives you've considered
The alternative could be to set a pre-defined timer in the settings option. This is not incompatible with the first solution: the user can decide to always put a timer or let it decide when using the app.

Additional context

๐Ÿ› Documentation tile shows error

Describe the bug
The documentation tile in the about dialog reports an error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://cynnexis.github.io/tide/#/
  2. Click on the Tide logo.
  3. You will see an error at the place of the documentation URL.
  4. Click on the error tile to open the error dialog box.
  5. See error

Expected behavior
The about dialog should load the tide.yaml configuration file and display the documentation URL.

Screenshots
If applicable, add screenshots to help explain your problem.

Screenshot of the error dialog box, not showing the stacktrace (because in release mode) and only printing an obfuscated variable name

Smartphone

  • Device: Xiaomi note 10
  • OS: Android 10
  • Browser: Firefox
  • Version: 99.1.1

Additional context

:fire: Remove splash screen

Describe the bug
The splash screen support is deprecated. Please remove it.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command flutter run --release in a terminal at the root of the project.
  2. See following error:
    W/FlutterActivityAndFragmentDelegate(27459): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
    

Expected behavior
No warning in the console when running the app.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version: 99.0.1

Additional context
See https://docs.flutter.dev/development/ui/advanced/splash-screen#migrating-from-manifest--activity-defined-custom-splash-screens for more info

:desktop_computer: Full screen

Is your feature request related to a problem? Please describe.
Enter in full-screen when beginning the exercise on mobile.

Describe the solution you'd like
Enter in full-screen when beginning the exercise on mobile automatically. In the webapp, add a button or a tip for the user to enter in full screen mode.

Describe alternatives you've considered

Additional context

โ†ฉ๏ธ Reset settings to default value

Is your feature request related to a problem? Please describe.
Add a button for each setting tile in the Settings page to reset it to the initial value.

Describe the solution you'd like
Add a button, at the tail of the tile if possible, to the setting tile, to reset the value. Reseting it should update the slider too.

Describe alternatives you've considered

  • Add the reset button below each tile.
  • Add a menu entry in the Settings page to reset all settings.

Additional context
Here are the settings that should have a reset button:

Breathing and holding duration sliders

๐ŸŒฌ๏ธ Breathing sound

Is your feature request related to a problem? Please describe.
During the breathing exercise, it would be nice to have a sound cue for inhaling and exhaling.

Describe the solution you'd like
A breathing-in and breathing-out sound can be used at the beginning of each animation.

Describe alternatives you've considered
Other sounds can be used, as long as they are different to tell the breathing-in and breathing-out animations apart.

Additional context
The sound should be copyleft and royalty-free.

๐Ÿ› Cannot exit exercise in web view

Describe the bug
A clear and concise description of what the bug is.

image

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://cynnexis.github.io/tide/#/
  2. Open the developer console (F12 or Ctrl+Shift+C)
  3. Click on the "Start" button (its content might change from one language to another)
  4. Go back by clinking on the back button in the top-left corner.
  5. There's only a blank page. See error in the console.

Expected behavior
It is expected to go back to the home page, without error.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version: 99.0 (64-bits)

Smartphone (please complete the following information):

  • Device: Xiaomi Note 10
  • OS: Android 10
  • Browser: Firefox
  • Version: 99.1.1

Additional context

Stacktrace
Uncaught Error: NoSuchMethodError: method not found: 'webkitExitFullscreen' (document.webkitExitFullscreen is not a function)
    Wz https://cynnexis.github.io/tide/main.dart.js:21971
    s https://cynnexis.github.io/tide/main.dart.js:5142
    $2 https://cynnexis.github.io/tide/main.dart.js:34212
    X https://cynnexis.github.io/tide/main.dart.js:5128
    Wz https://cynnexis.github.io/tide/main.dart.js:21973
    lC https://cynnexis.github.io/tide/main.dart.js:69705
    s https://cynnexis.github.io/tide/main.dart.js:5142
    $2 https://cynnexis.github.io/tide/main.dart.js:34212
    $1 https://cynnexis.github.io/tide/main.dart.js:34206
    lK https://cynnexis.github.io/tide/main.dart.js:35115
    $0 https://cynnexis.github.io/tide/main.dart.js:34600
    u3 https://cynnexis.github.io/tide/main.dart.js:5266
    kS https://cynnexis.github.io/tide/main.dart.js:34523
    $0 https://cynnexis.github.io/tide/main.dart.js:34567
    aJ1 https://cynnexis.github.io/tide/main.dart.js:5298
    aJx https://cynnexis.github.io/tide/main.dart.js:5300
    $1 https://cynnexis.github.io/tide/main.dart.js:34156
    aLf https://cynnexis.github.io/tide/main.dart.js:4043
    s https://cynnexis.github.io/tide/main.dart.js:4051
    aGq https://cynnexis.github.io/tide/main.dart.js:5111
    <anonymous> https://cynnexis.github.io/tide/main.dart.js:78221
    c https://cynnexis.github.io/tide/main.dart.js:37
    avf https://cynnexis.github.io/tide/main.dart.js:5305
    akH https://cynnexis.github.io/tide/main.dart.js:5396
    ex https://cynnexis.github.io/tide/main.dart.js:5317
    aMn https://cynnexis.github.io/tide/main.dart.js:7560
    alt https://cynnexis.github.io/tide/main.dart.js:22028
    s https://cynnexis.github.io/tide/main.dart.js:5142
    $2 https://cynnexis.github.io/tide/main.dart.js:34212
    X https://cynnexis.github.io/tide/main.dart.js:5128
    alt https://cynnexis.github.io/tide/main.dart.js:22031
    <anonymous> https://cynnexis.github.io/tide/main.dart.js:78447
    <anonymous> https://cynnexis.github.io/tide/main.dart.js:78441
    dartProgram https://cynnexis.github.io/tide/main.dart.js:78444
    <anonymous> https://cynnexis.github.io/tide/main.dart.js:78447
main.dart.js:3962:3

It appears to be a problem due to the fullscreen mode.

๐Ÿ Desktop support

Is your feature request related to a problem? Please describe.
The app can be exported as a Windows application.

Describe the solution you'd like
Make the project Desktop-compatible! See the following website to know how to do it:

https://docs.flutter.dev/desktop

Describe alternatives you've considered

Additional context
You will need to adapt the CI/CD to automatically build new releases.

๐Ÿšจ Custom lint rules

Is your feature request related to a problem? Please describe.
The package flutter_lints adds multiple rules to the recommended rules for analysis. But you can customize them as well.

Describe the solution you'd like
Here is an example of the rules that you can add in the analysis_options.yaml:

include: package:flutter_lints/flutter.yaml

analyzer:
  exclude: [lib/generated_plugin_registrant.dart]
  enable-experiment:
    - extension-methods

linter:
  # List of available lints: https://dart-lang.github.io/linter/lints/
  rules:
    always_declare_return_types: true
    always_specify_types: true
    always_use_package_imports: true
    avoid_classes_with_only_static_members: true
    avoid_double_and_int_checks: true
    avoid_field_initializers_in_const_classes: true
    avoid_implementing_value_types: true
    avoid_js_rounded_ints: true # Web only
    avoid_positional_boolean_parameters: true
    avoid_returning_null_for_future: true
    avoid_returning_this: true
    avoid_slow_async_io: true
    avoid_type_to_string: true
    avoid_void_async: true
    cancel_subscriptions: true
    cast_nullable_to_non_nullable: true
    close_sinks: true
    deprecated_consistency: true
    #diagnostic_describe_all_properties: true
    directives_ordering: true
    flutter_style_todos: true
    #invariant_booleans: true
    literal_only_boolean_expressions: true
    no_adjacent_strings_in_list: true
    noop_primitive_operations: true
    null_closures: false
    prefer_void_to_null: true
    test_types_in_equals: true
    unnecessary_statements: true
    unsafe_html: true
    #use_build_context_synchronously: true
    void_checks: true

๐Ÿ’ซ Warn the user if animations are disabled.

Is your feature request related to a problem? Please describe.
Animations can be disabled by the system. However, the very purpose of this application depends of them. You must warn the user if their phone disables animations.

Describe the solution you'd like
In the home page, a text should explain to the user that animations are disabled, with a link to the settings to solve the problem.

Describe alternatives you've considered
You need to make sure that it is cross-platform (see MediaQueryData).

Additional context

:arrow_forward: Google Play Console report IllegalStateException

Describe the bug
When creating a release for Tide v1.0.0, the Google Play Console reports the following error:

FATAL EXCEPTION: main
Process: jp.co.sharp.android.iwnnime.ml, PID: 7472
java.lang.RuntimeException: Unable to start receiver jp.co.sharp.android.iwnnime.ml.DecoEmojiListener: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=jp.co.omronsoft.android.decoemojimanager_docomo/.DecoEmojiManager }: app is in background uid null
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:3521)
	at android.app.ActivityThread.access$1400(ActivityThread.java:209)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1753)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6846)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=jp.co.omronsoft.android.decoemojimanager_docomo/.DecoEmojiManager }: app is in background uid null
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1577)
	at android.app.ContextImpl.startService(ContextImpl.java:1532)
	at android.content.ContextWrapper.startService(ContextWrapper.java:664)
	at android.content.ContextWrapper.startService(ContextWrapper.java:664)
	at jp.co.sharp.android.iwnnime.ml.DecoEmojiListener.updateConfirm(DecoEmojiListener.java:211)
	at jp.co.sharp.android.iwnnime.ml.DecoEmojiListener.onReceive(DecoEmojiListener.java:184)
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:3508)
	... 8 more

Expected behavior
No error in the Google Play Console.

Smartphone (please complete the following information):

  • Model name: AQUOS sense2 SH-01L
  • Manufacturer: Sharp
  • Android version: Android 9 (SDK 28)
  • Locale: en_US
  • Screen size: 1080 x 2160
  • Screen density (DPI): 480
  • RAM (total memory): 3,072 MB
  • OpenGL ES version: 3.2
  • ABI: ARM64_V8
  • CPU: Qualcomm SDM450

Screenshots

Screenshot of the Google Play Page. All texts were already described in this issue.

Additional context
Here is a video of the testing that caused the error:

video

๐ŸŽต Relaxing song

Is your feature request related to a problem? Please describe.
A relaxing song in the background can help the user.

Describe the solution you'd like
Add a song in the background when the breathing exercise begins, and add a button so the user can enable/disable it.

Describe alternatives you've considered
The user might be able to choose custom songs from local files.

Additional context
The songs should be royalty-free. Also, this issue should consider #8.

:link: Link to documentation

Is your feature request related to a problem? Please describe.
In the webapps, the link to the documentation should be added because it is on the same website (GitHub Pages).

Describe the solution you'd like
Add a link in the "About Tide" to the documentation.

Describe alternatives you've considered

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.