Skip to content

Commit

Permalink
feat: shop mobile flutter : cloning ionic version to flutter version (#…
Browse files Browse the repository at this point in the history
…1481)

* Initialization ever flutter shop mobile

* Update AuthService.ts

* Reverted License file and readme file updated and also moved all file to root folder

* Added localization for flutter shop mobile order

* Restructured the project, fixing duplicates

* Restructured the project, updated README FILE

* Imported language pack from existing ionic and added french package for the Ever Demand Flutter version

* Adding the navbar

* Adjusted login design

* Updated design

* Fixed translation bug in arb files

* Fixed arb files

* Updated login screen

* Added ever logo and ever motto

* Added a thank your for signing layout

* updated signup files

* updated and added layouts

* Changed the logo display on phone

* Added circular progress

* Adding products and navigation drawer

* moved menu.dart to menu folder

* feat: project architecture

* feat: screens ui

* Update README.md

Co-authored-by: Ruslan Konviser <evereq@gmail.com>
Co-authored-by: Aaron-Laxis Dizele <aldizele@gmail.com>
  • Loading branch information
3 people committed Jun 10, 2022
1 parent e486dd9 commit b4ab085
Show file tree
Hide file tree
Showing 174 changed files with 7,131 additions and 1,528 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@
"typeorm",
"Whitespaces"
],
"deepscan.enable": true
"deepscan.enable": true,
"angular.enable-strict-mode-prompt": false
}
2,484 changes: 1,242 additions & 1,242 deletions packages/core/res/templates/terms_of_use/ru-RU.hbs

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/core/src/@pyro/db-server/db-service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import mongoose from 'mongoose';
import * as _ from 'lodash';
import Logger from 'bunyan';
import { Observable, Subject } from 'rxjs';
import { Observable, Subject, from, of } from 'rxjs';
import { injectable } from 'inversify';
import { ExistenceEvent, ExistenceEventType } from './existence';
import { from, of } from 'rxjs';
import { concat, exhaustMap, filter, map, share, tap } from 'rxjs/operators';
import { v1 as uuid } from 'uuid';
import { IDbService } from '@pyro/db-server/i-db-service';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const connectionSettings: TypeOrmModuleOptions = {
// poolSize: poolSize,
connectTimeoutMS: connectTimeoutMS,
logging: true,
logger: 'file', //Removes console logging, instead logs all queries in a file ormlogs.log
logger: 'file', // Removes console logging, instead logs all queries in a file ormlogs.log
useUnifiedTopology: true,
};

Expand Down Expand Up @@ -159,6 +159,7 @@ const connectionSettings: TypeOrmModuleOptions = {
context: ({ req, res }) => ({
req,
}),

}),
InvitesModule,
DevicesModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class GeoLocationOrdersResolver {
options: GeoLocationOrdersOptions;
searchObj?: {
isCancelled?: boolean;
byRegex?: Array<{ key: string; value: string }>;
byRegex?: { key: string; value: string }[];
};
}
) {
Expand All @@ -48,7 +48,7 @@ export class GeoLocationOrdersResolver {
geoLocation: IGeoLocation;
skippedOrderIds: string[];
options: GeoLocationOrdersOptions;
searchObj?: { byRegex: Array<{ key: string; value: string }> };
searchObj?: { byRegex: { key: string; value: string }[] };
}
) {
const orders = await this.geoLocationsOrdersService.getOrdersForWork(
Expand All @@ -71,7 +71,7 @@ export class GeoLocationOrdersResolver {
}: {
geoLocation: IGeoLocation;
skippedOrderIds: string[];
searchObj?: { byRegex: Array<{ key: string; value: string }> };
searchObj?: { byRegex: { key: string; value: string }[] };
}
) {
return this.geoLocationsOrdersService.getCountOfOrdersForWork(
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/services/auth/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { WrongPasswordError } from '@modules/server.common/errors/WrongPasswordE
import bcrypt from 'bcrypt';
import { injectable, interfaces } from 'inversify';
import { RawObject } from '@pyro/db/db-raw-object';

// have to combine the two imports
import jwt from 'jsonwebtoken';
import { JsonWebTokenError } from 'jsonwebtoken';
import jwt, { JsonWebTokenError } from 'jsonwebtoken';

interface IAuthableCreateObject extends DBCreateObject {
hash?: string;
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/services/services.app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export class ServicesApp {
}

// This is special connection we create during "bootstrap" of the system that is needed for our Repositories to use
// We also using another "default" connection defined in app.module.ts using `TypeOrmModule.forRoot(connectionSettings)` which will be used in other places.
// We also using another "default" connection defined in app.module.ts
// using `TypeOrmModule.forRoot(connectionSettings)` which will be used in other places.
const connectionSettings: ConnectionOptions =
{
// Note: do not change this connection name
Expand All @@ -161,7 +162,7 @@ export class ServicesApp {
// poolSize: ServicesApp._poolSize,
connectTimeoutMS: ServicesApp._connectTimeoutMS,
logging: true,
logger: 'file', //Removes console logging, instead logs all queries in a file ormlogs.log
logger: 'file', // Removes console logging, instead logs all queries in a file ormlogs.log
useUnifiedTopology: true,
};

Expand Down
7 changes: 3 additions & 4 deletions packages/core/src/services/warehouses/WarehousesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { createEverLogger } from '../../helpers/Log';
import Warehouse from '@modules/server.common/entities/Warehouse';
import { default as IWarehouse } from '@modules/server.common/interfaces/IWarehouse';
import { IGeoLocationCreateObject } from '@modules/server.common/interfaces/IGeoLocation';
import { Observable } from 'rxjs';
import { Observable, of } from 'rxjs';
import IWarehouseRouter, {
IWarehouseRegistrationInput,
IWarehouseLoginResponse,
} from '@modules/server.common/routers/IWarehouseRouter';
import {
asyncListener,
Expand All @@ -18,9 +19,7 @@ import {
} from '@pyro/io';
import IService from '../IService';
import { concat, exhaustMap, tap, first, map, switchMap } from 'rxjs/operators';
import { of } from 'rxjs';
import { DBService } from '@pyro/db-server';
import { IWarehouseLoginResponse } from '@modules/server.common/routers/IWarehouseRouter';
import { env } from '../../env';
import { AuthService, AuthServiceFactory } from '../auth';
import { v1 as uuid } from 'uuid';
Expand Down Expand Up @@ -172,7 +171,7 @@ export class WarehousesService extends DBService<Warehouse>
hash: await this.authService.getPasswordHash(
input.password
),
}
}
: {}),
});
return warehouse;
Expand Down
46 changes: 46 additions & 0 deletions packages/shop-mobile-flutter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
10 changes: 10 additions & 0 deletions packages/shop-mobile-flutter/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 4cc385b4b84ac2f816d939a49ea1f328c4e0b48e
channel: stable

project_type: app
44 changes: 43 additions & 1 deletion packages/shop-mobile-flutter/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# Ever Shop Mobile App (Flutter version)
# Ever Shop Mobile App (Flutter version)

## Setting up Your Development Environment

Find instructions for setting up your development machine with the Flutter framework on Flutter’s Get started page. The specific steps vary by platform, but they follow this basic format:

1. Download the installation bundle for your development machine’s operating system to get the latest stable release of the Flutter SDK.
2. Extract the installation bundle in the desired location.
3. Add the flutter tool to your path.
4. Run the flutter doctor command, which alerts you to any problems with the Flutter installation.
5. Install missing dependencies.
6. Set up your IDE with a Flutter plugin/extension.
7. Test drive an app.

The instructions provided on the Flutter website are very well done and allow you to easily set up a development environment on your platform of choice. The remainder of this tutorial assumes you’ve set up VS Code for Flutter development and that you’ve addressed any issues flutter doctor found. You can also use Android Studio to follow along.

To run your project as a mobile app, you’ll need to use one of the following options:

- Run either iOS Simulator or an Android emulator.
- Have an iOS or Android device set up for development.
- Run your code as a web app.
- Finally, you can run your code as a desktop app.

Even if your final target is mobile, using a web or desktop app during development gives you the advantage of being able to resize the app and observe how it would look with various screen sizes. If you have an older computer, the web or desktop version will also load faster than the Android emulator or iOS Simulator.

NOTE: TO BUILD AND TEST ON IOS SIMULATOR OR AN IOS DEVICE, YOU’LL NEED TO USE MACOS WITH XCODE. ALSO, EVEN IF YOU’RE PLANNING TO USE VS CODE AS YOUR MAIN IDE, THE EASIEST WAY TO GET THE ANDROID SDK AND ANDROID EMULATOR IS TO INSTALL ANDROID STUDIO AS WELL.

Clone or download the latest version of the project on https://github.com/ever-co/ever-demand
Open the project in either VS Code or Android Studio.

Open it in VS Code by opening the root folder. You’ll need to fetch packages before running the project.
Do so by pressing Command-Shift-P on MacOS or Control-Shift-P on Windows or Linux to open the command palette and running the Flutter: Get Packages command.

To open the project in Android Studio, choose Open an existing project from the Welcome to Android Studio screen and navigate to choose the root folder of the final project. Then choose Get dependencies on the 'Pub get' has not been run line in Android Studio.

## Project Structure

-> assets : here we have fonts, i18n, colors and images
-> lib : here are all the codes
-> models
-> screens
-> middlewares,...
-> test: will contain all our tests
29 changes: 29 additions & 0 deletions packages/shop-mobile-flutter/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
13 changes: 13 additions & 0 deletions packages/shop-mobile-flutter/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
68 changes: 68 additions & 0 deletions packages/shop-mobile-flutter/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.shop_flutter_mobile"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.shop_flutter_mobile">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.shop_flutter_mobile">
<application
android:label="Ever"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.shop_flutter_mobile

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
Loading

0 comments on commit b4ab085

Please sign in to comment.