Skip to content

Commit

Permalink
redis-phase2-success
Browse files Browse the repository at this point in the history
  • Loading branch information
ARYPROGRAMMER committed Oct 9, 2024
1 parent 5854f9a commit 49c2867
Show file tree
Hide file tree
Showing 13 changed files with 226 additions and 153 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ jobs:
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/apk/release/*"
tag: v2.0.9.4
tag: v2.1.0
token: ${{ secrets.TOKEN }}
name: "beta-v2.0.9.4"
name: "beta-v2.1.0"
body: |
## What's New in v2.0.9.4
## What's New in v2.1.0
- Base Bug Fixes for Beta.
- **Redis connection fixes and data privacy improvised**
- **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.
### Known Issues are Resolved - Redis Full-Integration Phase 2
8 changes: 4 additions & 4 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.4-green" alt="Version"/>
<img src="https://img.shields.io/badge/version-2.1.0-green" alt="Version"/>
</p>

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

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

## What's New in v2.0.9.4 (Beta Trial Phase for Redis) (Use Stable Version for Best Experience)
## What's New in v2.1.0 (Beta Phase for Redis) (Use Stable Version for Best Experience)

- Base Bug Fixes for Beta.
- **Redis connection fixes and data privacy improvised**
- **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.
### Known Issues are Resolved - Redis Full-Integration Phase 2.

[DEMO LINK OF WORKING](https://vimeo.com/1016496824?share=copy)

Expand Down
2 changes: 1 addition & 1 deletion lib/features/auth/presentation/auth/pages/signup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Signup extends StatelessWidget {
final mm = Hive.box('lastlogin');
final first = Hive.box('firstime');
mm.put("google", "false");
first.put('firsttime','true');
first.put('firsttime', 'true');
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
Expand Down
26 changes: 12 additions & 14 deletions lib/features/meditation/data/model/mood_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@ class MoodDataModel extends MoodData {
required String relax,
required String focus,
}) : super(
happy: happy,
neutral: neutral,
sad: sad,
calm: calm,
relax: relax,
focus: focus
);
happy: happy,
neutral: neutral,
sad: sad,
calm: calm,
relax: relax,
focus: focus);

factory MoodDataModel.fromJson(Map<String, dynamic> json) {
return MoodDataModel(
happy: json['happy'].toString(),
sad: json['sad'].toString(),
neutral: json['neutral'].toString(),
calm: json['calm'].toString(),
relax: json['relax'].toString(),
focus: json['focus'].toString()
);
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 @@ -18,6 +18,7 @@ class MeditationRepoImpl implements MeditationRepository {
Future<MoodMessage> getMoodMessage(String mood) async {
return await remoteDataSource.getMoodMessage(mood);
}

@override
Future<MoodData> getmoodData(String username) async {
return await remoteDataSource.getmoodData(username);
Expand Down
24 changes: 9 additions & 15 deletions lib/features/meditation/data/sources/meditation_remote_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ class MeditationRemoteDataSourceImpl implements MeditaionRemoteDataSource {

@override
Future<DailyQuoteModel> getDailyQuote() async {
final response = await client
.get(Uri.parse(
'https://mindful-app-47s6.onrender.com/meditation/dailyQuotes'));
final response = await client.get(Uri.parse(
'https://mindful-app-47s6.onrender.com/meditation/dailyQuotes'));

if (response.statusCode == 200) {
final jsonResponse = json.decode(response.body);
Expand All @@ -31,9 +30,8 @@ class MeditationRemoteDataSourceImpl implements MeditaionRemoteDataSource {

@override
Future<MoodMessageModel> getMoodMessage(String mood) async {
final response = await client
.get(Uri.parse(
'https://mindful-app-47s6.onrender.com/meditation/myMood/$mood'));
final response = await client.get(Uri.parse(
'https://mindful-app-47s6.onrender.com/meditation/myMood/$mood'));
if (response.statusCode == 200) {
final jsonResponse = json.decode(response.body);

Expand All @@ -44,19 +42,15 @@ class MeditationRemoteDataSourceImpl implements MeditaionRemoteDataSource {
}

@override
Future<MoodDataModel> getmoodData(String username)async{
final response = await client.get(Uri.parse(
'https://mindful-app-47s6.onrender.com/user/$username'
));
Future<MoodDataModel> getmoodData(String username) async {
final response = await client
.get(Uri.parse('https://mindful-app-47s6.onrender.com/user/$username'));

if (response.statusCode==200){
if (response.statusCode == 200) {
final jsonResponse = json.decode(response.body);
return MoodDataModel.fromJson(jsonResponse);

}
else {
} else {
throw Exception("Failed to get data");

}
}
}
10 changes: 7 additions & 3 deletions lib/features/meditation/domain/entities/mood_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ class MoodData {
final String relax;
final String focus;

MoodData({required this.happy, required this.neutral, required this.sad, required this.calm, required this.relax, required this.focus});


MoodData(
{required this.happy,
required this.neutral,
required this.sad,
required this.calm,
required this.relax,
required this.focus});
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import 'package:mental_health/features/meditation/presentation/bloc/mood_data/mo
class MoodDataBloc extends Bloc<MoodDataEvent, MoodDataState> {
final GetMoodData getmoodData;

MoodDataBloc({required this.getmoodData})
: super(MoodDataInitial()) {
MoodDataBloc({required this.getmoodData}) : super(MoodDataInitial()) {
on<FetchMoodData>((event, emit) async {
emit(MoodDataLoading());
try {
Expand All @@ -17,6 +16,5 @@ class MoodDataBloc extends Bloc<MoodDataEvent, MoodDataState> {
emit(MoodDataError(message: e.toString()));
}
});

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ class FetchMoodData extends MoodDataEvent {

FetchMoodData(this.username);
}

Loading

0 comments on commit 49c2867

Please sign in to comment.