Skip to content

Commit

Permalink
quest experience on mobile, website changes ... (#227)
Browse files Browse the repository at this point in the history
* feat: support for daily insights

* fix: date panning logic

* note: bump build

* misc: build ver & subscription notes

* wip: background insights

* feat: api support for cocoa-pad verb fluency tests

* feat: create & view quests

* feat: edit quest & display quest info on mobile

* build: bump packages

* feat: add health data to quest view

* build: bump packages

* feat: quest routes, wip mail sender

* feat: add organizer name

* feat: present health data

* fix: list quest organizer on edit

* feat: fetch quest subscribers

* bump build

* feat: add quest page

* feat: allow people fund via the profile page

* feat: display quest list if already subscribed

* feat: update to the quest details page

* fix: one less click to manual edits

* feat: save quests locally, add health card, new api util

* feat: logic to save quest prompt

* fix: make sure questId is added when saving quest prompt

* fix: switch to using async storage

* feat: redesign home ui

* feat: switch to using async storage

* misc: build updates

* feat: switch to useQuery for quest saves

* misc: build updates

* blog: introducing quests

* fix: image link tag

* blog: update quest post

* blog: update quests article

* blog: update quest overview

* feat: add table & endpoint to store quest datasets

* fix: minor copy details

* feat: display steps in the last week on dashboard

* feat: mobile - push dataset & view quest dashboard

* fix: duplicate interface import

* misc: embarassing error but will do for now

* feat: fit chart width to screen size

* feat: add redirectUrl support

* feat: switch health connect to the top

* nit: add activity loader for events

* feat: setup background sync for active user quests

* feat: save prompts when person joins quest, make prompt option clickable

* fix: map entries to the correct date

* blog: article on tips 2023

* fix: add share modal to quest page

* feat: add share modal component

* build: bump RNScreen to fix build

* buid: fix ios & android build errors

* flush

* add: site content & clarity analytics for usefusion.ai

* add: update packages & get mobile builds running

* add: update faqs

* add: missing upgrade step expo install --fix

* add: update readme

* add: missing requests module

* add: text changes

* build: add launch configs for debugging

* add: copy

* Fix: Improve Quest Experience on Mobile (#230)

* fix: expo upgrade

* fix: quest experience

* feat: fetch quest details from remote

* nit: update build

---------

Co-authored-by: Ore Ogundipe <[email protected]>

* fix: edit prompt entry screen

* Health UI and Quest Updates (#231)

* feat: health UI preview chart

* chore: wip health page

* feat: pass steps & sleep data from apple health

* add: parse apple health sleep data correctly

* add: parse quest config to match new format

* fix: use api service for quest details update

* build: npx expo install --fix and then prebuild

---------

Co-authored-by: Deku || Feranmi <[email protected]>

* add: verify eeg dataset and make attestation to ethereum mainnet

* add: store muse data to local browser storage

* add: support for signing eeg datasets via eas on testnet

* add: ncode blog update

* edit: update older posts

* edit: update blog posts

* fix: use app insights for contact form

* edit: update blog posts

* add: housekeeping

* edit: update posts on research page

* remove: unused routes

* fix: keep flag for auto dataset download

* fix: remove /us route

---------

Co-authored-by: Oluwaferanmi Adedokun <[email protected]>
  • Loading branch information
oreHGA and heisdeku authored Jul 27, 2024
1 parent 00a354c commit fda3586
Show file tree
Hide file tree
Showing 109 changed files with 27,100 additions and 18,192 deletions.
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run Fusion Copilot (iOS)",
"skipFiles": ["<node_internals>/**"],
"cwd": "${workspaceFolder}/mobile",
"runtimeExecutable": "npx",
"runtimeArgs": ["expo", "run:ios"]
},
{
"type": "python",
"request": "launch",
"name": "Run Analysis API",
"program": "${workspaceFolder}/analysis_api/app.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/analysis_api"
}
]
}
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,34 @@ We build tools to accelerate the adoption of neurotechnology and behavior resear
## Roadmap

- [x] Record EEG while performing various activities using [Neurosity Crown](https://neurosity.co) and [Muse](https://choosemuse.com)
Supported activities:

Supported activities on https://usefusion.ai/playground:

- [x] Open Ended Brain Recording
- [x] Resting state (Eyes Closed/Eyes Open)
- [x] Stroop Task
- [x] Auditory Oddball
- [x] Flappy Bird game (Detecting intent & frustration)

- [ ] Analysis of collect data
- [ ] Analysis of collected data https://usefusion.ai/analysis

- [ ] Chart of steady state frequency power across recordings
- [x] Chart of steady state frequency power across recordings
- [ ] Periodic vs. aperiodic frequency evaluation using [fooof package](https://fooof-tools.github.io/fooof/)
- [ ] If applicable event related potential analysis
- [ ] Periodic vs. aperiodic frequecny evaluation using [fooof package](https://fooof-tools.github.io/fooof/)

- [ ] Connect your screentime events & productivity metrics using [ActivityWatch](https://activitywatch.net)
- [ ] Connect screentime events & productivity metrics from [Magicflow](https://magicflow.com)
- [ ] Running Distributed Studies with people (Quests) https://usefusion.ai/blog/quests

- [x] A set of prompts people respond to at intervals on a topic related to you
- [x] Connecting Apple Health - steps, sleep, heart-rate
- [ ] Support for cognitive experiments
- [ ] Quest Dashboard - view submissions, analyze and publish results

- [ ] Deploy quests to people devices - a quest is a protocol person is to follow for data collection.
- [ ] It can involve prompts, recording, brain activity
- [ ] Query your data with natural language
- [ ] Design and upload custom EEG experiment protocols to participants' devices

- [ ] Connecting Other Sources
- [ ] Connect your screentime events & productivity metrics using [ActivityWatch](https://activitywatch.net)
- [ ] Connect screentime events & productivity metrics from [Magicflow](https://magicflow.com)

## Tech Stack

- [Frontend](https://github.com/NEUROFUSIONInc/fusion/tree/master/frontend): React, Next.js
Expand All @@ -40,7 +46,7 @@ We build tools to accelerate the adoption of neurotechnology and behavior resear

## How to contribute

See the [issues](https://github.com/NEUROFUSIONInc/fusion/issues) for features we're actively developing.
We welcome all contributions! See the [issues](https://github.com/NEUROFUSIONInc/fusion/issues) for features we're actively developing.

- [Join the Fusion Community](https://discord.gg/3wCNJ6X4RF)

Expand Down
36 changes: 36 additions & 0 deletions analysis_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,42 @@ def process_eeg():

# TODO: endpoint for ERP analysis

@app.route('/api/v1/process_eeg_fooof', methods=['POST'])
def process_eeg_fooof():
try:
# Check if the POST request contains a file with the key 'file'
if 'file' not in request.files:
return jsonify({'error': 'No file part'}), 400

if 'fileTimestamp' not in request.form:
return jsonify({'error': 'No file timestamp'}), 400

file = request.files['file']

fileTimestamp = request.form['fileTimestamp']

# Check if the file has a filename
if file.filename == '':
return jsonify({'error': 'No selected file'}), 400

# Check if the file is a ZIP file
if file.filename.endswith('.zip'):
# Create a temporary directory to store the unzipped files
temp_dir = 'temp_unzip' # +`` "_" + str(int(time.time()))
os.makedirs(temp_dir, exist_ok=True)

# Save the ZIP file to the temporary directory
zip_file_path = os.path.join(temp_dir, file.filename)
file.save(zip_file_path)

# Unzip the file
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
zip_ref.extractall(temp_dir + "/raw_files")

print("file directory", temp_dir)
except Exception as e:
print("error", e)
return jsonify({'error': str(e)}), 500

# Endpoint for CoCoA-PAD analysis
@app.route('/api/v1/verbal_fluency', methods=['POST'])
Expand Down
2 changes: 1 addition & 1 deletion frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ NEXT_PUBLIC_NEUROFUSION_BACKEND_URL=
NEXT_PUBLIC_FUSION_NOSTR_PUBLIC_KEY=
NEXT_PUBLIC_ANALYSIS_SERVER_URL=
NEXTAUTH_URL=
NEXT_PUBLIC_APP_INSIGHTS_KEY=
NEXT_PUBLIC_APP_INSIGHTS_KEY=
Loading

0 comments on commit fda3586

Please sign in to comment.