Skip to content

Commit

Permalink
beta-redis-deployed-syncfusion
Browse files Browse the repository at this point in the history
  • Loading branch information
ARYPROGRAMMER committed Oct 7, 2024
1 parent 3fe381f commit d44ec11
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 66 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ jobs:
with:
channel: 'stable'

# Cache Flutter dependencies
- name: Cache Flutter packages
uses: actions/cache@v3
with:
path: |
~/.pub-cache
key: flutter-packages-${{ runner.os }}-${{ hashFiles('pubspec.yaml') }}
restore-keys: |
flutter-packages-${{ runner.os }}-
# Cache Gradle dependencies
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Setup Keystore
run: |
echo "${{ secrets.KEYSTORE }}" | base64 --decode >android/app/mykey.jks
Expand All @@ -39,15 +60,16 @@ jobs:
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/apk/release/*"
tag: v2.0.9
tag: v2.0.9.1
token: ${{ secrets.TOKEN }}
name: "beta-v2.0.9"
name: "beta-v2.0.9.1"
body: |
## What's New in v2.0.9
## What's New in v2.0.9.1
- **Redis Cloud Implementation and Fetching in Beta Phase**
- **Structure of Redis added to Clean Architecture
- **Added Redis-base to support syncfusion**
- **Fixed Performance and Responsiveness Issues by Improvised BLoC Structure.
- **New Feature**: Implemented Syncfusion and Redis for low latency.
### Known Issues are Resolved - Looking for vulnerabilities before Redis Full-Integration.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://github.com/ARYPROGRAMMER/Mindful-App/actions">
<img src="https://github.com/travisjeffery/timecop/workflows/CI/badge.svg" alt="Build Status"/>
</a>
<img src="https://img.shields.io/badge/version-2.0.9-red" alt="Version"/>
<img src="https://img.shields.io/badge/version-2.0.9.1-green" alt="Version"/>
</p>

<p align="center">
Expand All @@ -17,8 +17,9 @@

**APP STATUS** : ALL CORE FUNCTIONALITIES WORKING (Deployed NodeJs & Postgresql on Render)

## What's New in v2.0.9
## What's New in v2.0.9.1 (Beta Trial Phase for Redis)

- **Redis Cloud Implementation and Fetching in Beta Phase**
- **Structure of Redis added to Clean Architecture
- **Added Redis-base to support syncfusion**
- **Fixed Performance and Responsiveness Issues by Improvised BLoC Structure.
Expand Down
15 changes: 7 additions & 8 deletions lib/features/meditation/data/model/mood_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ class MoodDataModel extends MoodData {
focus: focus
);

factory MoodDataModel.fromJson(json) {
final data = jsonDecode(json);
factory MoodDataModel.fromJson(Map<String, dynamic> json) {
return MoodDataModel(
happy: data['happy'],
sad: data['sad'],
neutral: data['neutral'],
calm: data['calm'],
relax: data['relax'],
focus: data['focus'],
happy: json['happy'].toString(),
sad: json['sad'].toString(),
neutral: json['neutral'].toString(),
calm: json['calm'].toString(),
relax: json['relax'].toString(),
focus: json['focus'].toString()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MeditationRemoteDataSourceImpl implements MeditaionRemoteDataSource {
@override
Future<MoodDataModel> getmoodData(String username)async{
final response = await client.get(Uri.parse(
'http://192.168.29.6:6000/user/$username'
'https://mindful-app-47s6.onrender.com/user/$username'
));

if (response.statusCode==200){
Expand Down
111 changes: 62 additions & 49 deletions lib/features/meditation/presentation/pages/meditation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'package:mental_health/features/auth/domain/entities/auth/googleapisignin
import 'package:mental_health/features/meditation/presentation/bloc/dailyQuote/daily_quote_bloc.dart';
import 'package:mental_health/features/meditation/presentation/bloc/dailyQuote/daily_quote_event.dart';
import 'package:mental_health/features/meditation/presentation/bloc/dailyQuote/daily_quote_state.dart';
import 'package:mental_health/features/meditation/presentation/bloc/mood_data/mood_data_bloc.dart';
import 'package:mental_health/features/meditation/presentation/bloc/mood_data/mood_data_state.dart';
import 'package:mental_health/features/meditation/presentation/bloc/mood_message/mood_message_bloc.dart';
import 'package:mental_health/features/meditation/presentation/bloc/mood_message/mood_message_event.dart';
import 'package:mental_health/features/meditation/presentation/bloc/mood_message/mood_message_state.dart';
Expand Down Expand Up @@ -42,54 +44,6 @@ class _MeditationPageState extends State<MeditationPage> {
TooltipBehavior(enable: true, format: 'point.x : point.y%');
__tooltipBehavior = _tooltipBehavior;

__chartData = <ChartSampleData>[
ChartSampleData(
x: 'Mon', y: 16, secondSeriesYValue: 8, thirdSeriesYValue: 13),
ChartSampleData(
x: 'Tue', y: 8, secondSeriesYValue: 10, thirdSeriesYValue: 7),
ChartSampleData(
x: 'Wed', y: 12, secondSeriesYValue: 10, thirdSeriesYValue: 5),
ChartSampleData(
x: 'Thurs', y: 4, secondSeriesYValue: 8, thirdSeriesYValue: 14),
ChartSampleData(
x: 'Fri', y: 8, secondSeriesYValue: 5, thirdSeriesYValue: 4),
ChartSampleData(
x: 'Sat', y: 3, secondSeriesYValue: 3, thirdSeriesYValue: 6),
];

dataSources = <ChartSampleData>[
ChartSampleData(
x: 'Happy',
y: 62.70,
text: '10%',
pointColor: const Color.fromRGBO(69, 186, 161, 1.0)),
ChartSampleData(
x: 'Neutral',
y: 29.20,
text: '10%',
pointColor: const Color.fromRGBO(230, 135, 111, 1.0)),
ChartSampleData(
x: 'Sad',
y: 85.20,
text: '100%',
pointColor: const Color.fromRGBO(145, 132, 202, 1.0)),
ChartSampleData(
x: 'Calm',
y: 85.20,
text: '100%',
pointColor: const Color.fromRGBO(145, 132, 202, 1.0)),
ChartSampleData(
x: 'Relax',
y: 85.20,
text: '100%',
pointColor: const Color.fromRGBO(145, 132, 202, 1.0)),
ChartSampleData(
x: 'Focus',
y: 45.70,
text: '100%',
pointColor: const Color.fromRGBO(235, 96, 143, 1.0))
];

_annotationSources = <CircularChartAnnotation>[
CircularChartAnnotation(
widget: ClipRRect(
Expand Down Expand Up @@ -800,7 +754,65 @@ class _MeditationPageState extends State<MeditationPage> {
textAlign: TextAlign.center,
),
//graph
_buildColumnChart()
BlocBuilder<MoodDataBloc,MoodDataState>(builder: (context,state){
if (state is MoodDataLoaded){
__chartData = <ChartSampleData>[
ChartSampleData(x: 'Mon', y: num.parse(state.moodDatainfo.happy), secondSeriesYValue: num.parse(state.moodDatainfo.neutral), thirdSeriesYValue: num.parse(state.moodDatainfo.calm)),
ChartSampleData(x: 'Tue', y: num.parse(state.moodDatainfo.happy), secondSeriesYValue: num.parse(state.moodDatainfo.neutral), thirdSeriesYValue: num.parse(state.moodDatainfo.calm)),
ChartSampleData(x: 'Wed', y: num.parse(state.moodDatainfo.happy), secondSeriesYValue: num.parse(state.moodDatainfo.neutral), thirdSeriesYValue: num.parse(state.moodDatainfo.calm)),
ChartSampleData(x: 'Thurs', y: num.parse(state.moodDatainfo.happy), secondSeriesYValue: num.parse(state.moodDatainfo.neutral), thirdSeriesYValue: num.parse(state.moodDatainfo.calm)),
ChartSampleData(x: 'Fri', y: num.parse(state.moodDatainfo.happy), secondSeriesYValue: num.parse(state.moodDatainfo.neutral), thirdSeriesYValue: num.parse(state.moodDatainfo.calm)),
ChartSampleData(x: 'Sat', y: num.parse(state.moodDatainfo.happy), secondSeriesYValue: num.parse(state.moodDatainfo.neutral), thirdSeriesYValue: num.parse(state.moodDatainfo.calm)),
ChartSampleData(x: 'Sun', y: num.parse(state.moodDatainfo.happy), secondSeriesYValue: num.parse(state.moodDatainfo.neutral), thirdSeriesYValue: num.parse(state.moodDatainfo.calm)),

];

num total = num.parse(state.moodDatainfo.happy)+num.parse(state.moodDatainfo.neutral)+num.parse(state.moodDatainfo.sad)+num.parse(state.moodDatainfo.calm)+num.parse(state.moodDatainfo.relax)+num.parse(state.moodDatainfo.focus);
dataSources = <ChartSampleData>[
ChartSampleData(
x: 'Happy',
y: num.parse(state.moodDatainfo.happy)/total,
text: '10%',
pointColor: const Color.fromRGBO(69, 186, 161, 1.0)),
ChartSampleData(
x: 'Neutral',
y: num.parse(state.moodDatainfo.neutral)/total,
text: '10%',
pointColor: const Color.fromRGBO(230, 135, 111, 1.0)),
ChartSampleData(
x: 'Sad',
y:num.parse(state.moodDatainfo.sad)/total,
text: '100%',
pointColor: const Color.fromRGBO(145, 132, 202, 1.0)),
ChartSampleData(
x: 'Calm',
y: num.parse(state.moodDatainfo.calm)/total,
text: '100%',
pointColor: const Color.fromRGBO(145, 132, 202, 1.0)),
ChartSampleData(
x: 'Relax',
y: num.parse(state.moodDatainfo.relax)/total,
text: '100%',
pointColor: const Color.fromRGBO(145, 132, 202, 1.0)),
ChartSampleData(
x: 'Focus',
y: num.parse(state.moodDatainfo.focus)/total,
text: '100%',
pointColor: const Color.fromRGBO(235, 96, 143, 1.0))
];
return _buildColumnChart();
}
if (state is MoodDataLoading){
return const Text("loading");
}

if (state is MoodDataError){
return Text(state.message);
}
return Container();

})

],
),
),
Expand Down Expand Up @@ -852,6 +864,7 @@ class _MeditationPageState extends State<MeditationPage> {
return Container();
},
),

],
),
),
Expand Down
11 changes: 9 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,27 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
final mybox = Hive.box('lastlogin');
final idval;
bool google = mybox.get('google').toString() == 'true';
if (google) {
idval = "${GoogleSignInApi.details()?.email}-google";
}else{
idval = FirebaseAuth.instance.currentUser?.email.toString();
}
return MultiBlocProvider(
providers: [
BlocProvider(create: (_) => NavBloc()),
BlocProvider(create: (context) => di.sl<SongBloc>()..add(FetchSongs())),
BlocProvider(create: (context) => di.sl<DailyQuoteBloc>()..add(FetchDailyQuote())),
BlocProvider(create: (context) => di.sl<MoodMessageBloc>()),
BlocProvider(create: (context) => di.sl<MoodDataBloc>()..add(FetchMoodData("[email protected]"))),
BlocProvider(create: (context) => di.sl<MoodDataBloc>()..add(FetchMoodData(idval))),
],
child: MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Mental Health',
theme: AppTheme.lightTheme,
home: (FirebaseAuth.instance.currentUser == null)
? mybox.get('google').toString() == 'true'
? google
? const inPage()
: const Onboarding()
: HomePage(),
Expand Down

0 comments on commit d44ec11

Please sign in to comment.