asList(
37 | new MainReactPackage(),
38 | new RNFusedLocationPackage(),
39 | new RNGestureHandlerPackage(),
40 | new FIRMessagingPackage(),
41 | new RNFirebasePackage(),
42 | new RNFirebaseNotificationsPackage(),
43 | new RNFirebaseMessagingPackage(),
44 | new RNDeviceInfo(),
45 | new ReactVideoPackage(),
46 | new ReactNativeWheelPickerPackage(),
47 | new RNFSPackage(),
48 | new RNCameraPackage(),
49 | new AsyncStoragePackage(),
50 | new ImagePickerPackage()
51 | );
52 | }
53 |
54 | @Override
55 | protected String getJSMainModuleName() {
56 | return "index";
57 | }
58 | };
59 |
60 | @Override
61 | public ReactNativeHost getReactNativeHost() {
62 | return mReactNativeHost;
63 | }
64 |
65 | @Override
66 | public void onCreate() {
67 | super.onCreate();
68 | SoLoader.init(this, /* native exopackage */ false);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/front-react-master/ios/DazzledDate/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/front-react-master/src/Router.js:
--------------------------------------------------------------------------------
1 | import { createStackNavigator } from 'react-navigation';
2 | //FirstScreen
3 | import FirstScreen from './components/FirstScreen';
4 | //Auths
5 | import Login from './components/Auths/Login';
6 | import Signup from './components/Auths/Signup';
7 | import Register1 from './components/Auths/Register1';
8 | import Register2 from './components/Auths/Register2';
9 | import EmailConfirm from './components/Auths/EmailConfirm';
10 | //Main
11 | import Record from './components/Main/Record';
12 | import Browse from './components/Main/Browse';
13 | import Filter from './components/Main/Filter';
14 | import Income from './components/Main/Income';
15 | import IncomeDetail from './components/Main/IncomeDetail';
16 | import Match from './components/Main/Match';
17 | import Chat from './components/Main/Chat';
18 | // import ChatDetail from './components/Main/ChatDetail';
19 | import MyVideo from './components/Main/MyVideo';
20 | import MyVideoDetail from './components/Main/MyVideoDetail';
21 | import Profile from './components/Main/Profile';
22 | import ProfileDetail from './components/Main/ProfileDetail';
23 | import ProfileSetting from './components/Main/ProfileSetting';
24 | import TermsPolicy from './components/Main/TermsPolicy';
25 | import Report from './components/Main/Report';
26 |
27 | import ChatScreen from './components/Main/ChatScreen';
28 |
29 | export default Router = createStackNavigator({
30 | FirstScreen: { screen: FirstScreen },
31 | //Main
32 | Income: { screen: Income },
33 | IncomeDetail: { screen: IncomeDetail },
34 | Match: { screen: Match },
35 | Browse: { screen: Browse },
36 | Record: { screen: Record },
37 | Filter: { screen: Filter },
38 | Chat: { screen: Chat },
39 | // ChatDetail: { screen: ChatDetail },
40 | ChatDetail: { screen: ChatScreen },
41 | MyVideo: { screen: MyVideo },
42 | MyVideoDetail: { screen: MyVideoDetail },
43 | Report: { screen: Report },
44 | Profile: { screen: Profile },
45 | ProfileDetail: { screen: ProfileDetail },
46 | ProfileSetting: { screen: ProfileSetting },
47 | TermsPolicy: { screen: TermsPolicy },
48 | //Auths
49 | Login: { screen: Login },
50 | Signup: { screen: Signup },
51 | Register1: { screen: Register1 },
52 | Register2: { screen: Register2 },
53 | EmailConfirm: { screen: EmailConfirm },
54 | }, {
55 | initialRouteName: 'FirstScreen',
56 | transitionConfig: () => ({
57 | transitionSpec: {
58 | duration: 0,
59 | },
60 | })
61 | }
62 | );
--------------------------------------------------------------------------------
/front-react-master/src/components/Main/ProfileDetail.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Icon,
4 | Content,
5 | } from "native-base";
6 | import { Dimensions, View, StyleSheet, TouchableOpacity, StatusBar } from "react-native";
7 | import Video from 'react-native-video';
8 | import Global from '../Global';
9 |
10 | class ProfileDetail extends Component {
11 | constructor(props) {
12 | super(props);
13 | this.state = {
14 | paused: false,
15 | vUrl: '',
16 | username: '',
17 | userage: '',
18 | userdistance: '',
19 | otherId: -1,
20 | };
21 | }
22 |
23 | static navigationOptions = {
24 | header: null
25 | };
26 |
27 | componentWillMount() {
28 | Global.saveData.nowPage = 'ProfileDetail';
29 | this.setState({
30 | vUrl: this.props.navigation.state.params.url,
31 | otherId: this.props.navigation.state.params.otherId
32 | });
33 | }
34 |
35 | componentDidMount() {
36 | this.props.navigation.addListener('didFocus', (playload) => {
37 | this.setState({ paused: false })
38 | });
39 | }
40 |
41 | onReject() {
42 | this.props.navigation.pop();
43 | }
44 | render() {
45 | return (
46 |
47 |
48 |
49 | {(this.state.vUrl != "") && (
50 |
63 | this.onReject()}>
65 |
66 |
67 |
68 | );
69 | }
70 | }
71 | const DEVICE_WIDTH = Dimensions.get('window').width;
72 | const DEVICE_HEIGHT = Dimensions.get('window').height;
73 | const styles = StyleSheet.create({
74 | contentContainer: {
75 | width: '100%',
76 | height: '100%',
77 | backgroundColor: '#fff',
78 | },
79 | instructions: {
80 | textAlign: 'center',
81 | color: '#3333ff',
82 | marginBottom: 5,
83 | },
84 | });
85 | export default ProfileDetail;
86 |
--------------------------------------------------------------------------------
/front-react-master/ios/DazzledDate/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "ItunesArtwork@2x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
--------------------------------------------------------------------------------
/front-react-master/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/front-react-master/ios/DazzledDate/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | DazzledDate
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSLocationWhenInUseUsageDescription
28 | This app does not require access to Location
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UIViewControllerBasedStatusBarAppearance
42 |
43 | NSAppTransportSecurity
44 |
45 | NSAllowsArbitraryLoads
46 |
47 | NSExceptionDomains
48 |
49 | localhost
50 |
51 | NSExceptionAllowsInsecureHTTPLoads
52 |
53 |
54 |
55 |
56 | NSAppleMusicUsageDescription
57 | Need Playing Audio for AD showing
58 | NSBluetoothPeripheralUsageDescription
59 | This app does not require access to blutooth
60 | NSCalendarsUsageDescription
61 | This app would like to access your calender
62 | NSCameraUsageDescription
63 | Need camera access for uploading Images
64 | NSLocationAlwaysUsageDescription
65 | This app does not require access to this fieild for Location
66 | NSLocationUsageDescription
67 | This app does not require access to Location
68 | NSMicrophoneUsageDescription
69 | Need microphone access for scan QR code
70 | NSMotionUsageDescription
71 | This App motion use
72 | NSPhotoLibraryUsageDescription
73 | Need Library access for uploading Images
74 | NSSpeechRecognitionUsageDescription
75 | No need to recognize the speech
76 | UIAppFonts
77 |
78 | AntDesign.ttf
79 | Entypo.ttf
80 | EvilIcons.ttf
81 | Feather.ttf
82 | FontAwesome.ttf
83 | FontAwesome5_Brands.ttf
84 | FontAwesome5_Regular.ttf
85 | FontAwesome5_Solid.ttf
86 | Foundation.ttf
87 | Ionicons.ttf
88 | MaterialCommunityIcons.ttf
89 | MaterialIcons.ttf
90 | Octicons.ttf
91 | Roboto_medium.ttf
92 | Roboto.ttf
93 | rubicon-icon-font.ttf
94 | SimpleLineIcons.ttf
95 | Zocial.ttf
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/front-react-master/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Main/MyVideoDetail.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Icon,
4 | Text,
5 | Content,
6 | } from "native-base";
7 | import { Dimensions, View, StyleSheet, TouchableOpacity, StatusBar } from "react-native";
8 |
9 | import Video from 'react-native-video';
10 | import Global from '../Global';
11 |
12 | import {SERVER_URL} from '../../config/constants';
13 |
14 | class MyVideoDetail extends Component {
15 | constructor(props) {
16 | super(props);
17 | this.state = {
18 | paused: false,
19 | vid: -1,
20 | vUrl: '',
21 | username: '',
22 | userage: '',
23 | userdistance: '',
24 | otherId: -1,
25 | primary: -1,
26 | };
27 | }
28 |
29 | static navigationOptions = {
30 | header: null
31 | };
32 | componentDidMount() {
33 | Global.saveData.nowPage = 'MyVideoDetail';
34 | this.setState({ username: 'SANDY', userage: 27, userdistance: 302 })
35 | this.props.navigation.addListener('didFocus', (playload) => {
36 | this.setState({ paused: false })
37 | });
38 | }
39 | componentWillMount() {
40 | this.setState({
41 | vUrl: this.props.navigation.state.params.url,
42 | otherId: this.props.navigation.state.params.otherId,
43 | vid: this.props.navigation.state.params.id,
44 | primary: this.props.navigation.state.params.primary
45 | });
46 | }
47 | onBack() {
48 | this.props.navigation.pop()
49 | }
50 | onSetPrimary() {
51 | fetch(`${SERVER_URL}/api/video/setAsPrimary/` + this.state.vid, {
52 | method: 'PUT',
53 | headers: {
54 | 'Content-Type': 'application/json',
55 | 'Authorization': Global.saveData.token
56 | }
57 | }).then((response) => response.json())
58 | .then((responseJson) => {
59 | if (!responseJson.error) {
60 | this.setState({ primary: 1 })
61 | }
62 | })
63 | .catch((error) => {
64 | return
65 | });
66 | }
67 | render() {
68 | return (
69 |
70 |
71 |
72 |
83 | this.onBack()}>
85 |
86 |
87 | {(this.state.primary != 1) && (
88 |
89 | this.onSetPrimary()}>
91 | {"Set As Primary"}
92 |
93 | )}
94 |
95 | );
96 | }
97 | }
98 | const DEVICE_WIDTH = Dimensions.get('window').width;
99 | const DEVICE_HEIGHT = Dimensions.get('window').height;
100 | const styles = StyleSheet.create({
101 | contentContainer: {
102 | width: '100%',
103 | height: '100%',
104 | backgroundColor: '#fff',
105 | },
106 | instructions: {
107 | textAlign: 'center',
108 | color: '#3333ff',
109 | marginBottom: 5,
110 | },
111 | });
112 | export default MyVideoDetail;
113 |
--------------------------------------------------------------------------------
/front-react-master/src/components/FirstScreen.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Text,
4 | } from "native-base"
5 | import {
6 | ImageBackground,
7 | Dimensions,
8 | View,
9 | StyleSheet,
10 | TouchableOpacity,
11 | StatusBar
12 | } from "react-native";
13 | import store from 'react-native-simple-store';
14 | // import logo from '../assets/images/logo.png';
15 | import firstBg from '../assets/images/first_bg.jpg';
16 | import Global from './Global';
17 |
18 | import {SERVER_URL} from '../config/constants';
19 |
20 | class FirstScreen extends Component {
21 | constructor(props) {
22 | super(props);
23 | this.state = {
24 | isLoaded: false,
25 | };
26 | }
27 | static navigationOptions = {
28 | header: null
29 | };
30 |
31 | componentWillMount() {
32 | store.get('email').then((email) => {
33 | if (email) {
34 | store.get('password').then((password) => {
35 | if (password) {
36 | //login
37 | this.props.navigation.navigate("Main");
38 | }
39 | });
40 | }
41 | });
42 | }
43 |
44 | onLogin(email, password) {
45 | var details = {
46 | 'useremail': email,
47 | 'userpassword': password
48 | };
49 |
50 | var formBody = [];
51 | for (var property in details) {
52 | var encodedKey = encodeURIComponent(property);
53 | var encodedValue = encodeURIComponent(details[property]);
54 | formBody.push(encodedKey + "=" + encodedValue);
55 | }
56 | formBody = formBody.join("&");
57 |
58 | fetch(`${SERVER_URL}/api/user/login`, {
59 | method: 'POST',
60 | headers: {
61 | 'Content-Type': 'application/x-www-form-urlencoded'
62 | },
63 | body: formBody,
64 | })
65 | .then((response) => {
66 | return response.json();
67 | })
68 | .then((responseJson) => {
69 | if (!responseJson.error) {
70 | Global.saveData.token = responseJson.data.token;
71 | Global.saveData.u_id = responseJson.data.id;
72 | Global.saveData.u_name = responseJson.data.name;
73 | Global.saveData.u_age = responseJson.data.age;
74 | Global.saveData.u_gender = responseJson.data.gender;
75 | Global.saveData.u_email = responseJson.data.email;
76 | Global.saveData.u_language = responseJson.data.language;
77 | Global.saveData.u_city = responseJson.data.ethnicity;
78 | Global.saveData.u_country = responseJson.data.country;
79 | Global.saveData.newUser = false;
80 | this.props.navigation.replace("Main");
81 | }
82 | })
83 | .catch((error) => {
84 | alert(JSON.stringify(error))
85 | return
86 | });
87 | }
88 | gotoLogin() {
89 | this.props.navigation.replace("Login");
90 | }
91 | gotoSignUp() {
92 | this.props.navigation.navigate("Signup");
93 | }
94 | render() {
95 | return (
96 |
97 |
98 |
99 |
100 | this.gotoLogin()}>
102 | {"Login"}
103 |
104 | this.gotoSignUp()}>
106 | {"REGISTER"}
107 |
108 |
109 |
110 |
111 | );
112 | }
113 | }
114 | const DEVICE_WIDTH = Dimensions.get('window').width;
115 | // const DEVICE_HEIGHT = Dimensions.get('window').height;
116 | const styles = StyleSheet.create({
117 | contentContainer: {
118 | width: '100%',
119 | height: '100%',
120 | backgroundColor: '#ED6164',
121 | alignItems: 'center',
122 | justifyContent: 'center'
123 | },
124 | });
125 | export default FirstScreen;
126 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Main/Report.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Text,
4 | Icon
5 | } from "native-base"
6 | import {
7 | Dimensions,
8 | TextInput,
9 | ScrollView,
10 | View,
11 | StyleSheet,
12 | TouchableOpacity,
13 | StatusBar,
14 | Alert
15 | } from "react-native";
16 |
17 | import {SERVER_URL} from '../../config/constants';
18 |
19 | class Report extends Component {
20 | constructor(props) {
21 | super(props);
22 | this.state = {
23 | id: '',
24 | problem_title: '',
25 | problem_content: '',
26 | };
27 | }
28 |
29 | static navigationOptions = {
30 | header: null
31 | };
32 | componentDidMount() {
33 | Global.saveData.nowPage = 'Report';
34 | this.setState({ id: this.props.navigation.state.params.otherId })
35 | }
36 | onBack() {
37 | this.props.navigation.pop()
38 | }
39 | onReport() {
40 | if (this.state.problem_content == "") {
41 | Alert.alert("Please fill the input field")
42 | return
43 | }
44 | var details = {
45 | 'otherId': this.state.id,
46 | 'reportDescription': this.state.problem_content
47 | };
48 |
49 | var formBody = [];
50 | for (var property in details) {
51 | var encodedKey = encodeURIComponent(property);
52 | var encodedValue = encodeURIComponent(details[property]);
53 | formBody.push(encodedKey + "=" + encodedValue);
54 | }
55 | formBody = formBody.join("&");
56 |
57 | fetch(`${SERVER_URL}/api/chat/reportUser`, {
58 | method: 'POST',
59 | headers: {
60 | 'Content-Type': 'application/x-www-form-urlencoded'
61 | },
62 | body: formBody,
63 | }).then((response) => response.json())
64 | .then((responseJson) => {
65 | // alert(JSON.stringify(responseJson))
66 | if (!responseJson.error) {
67 | Alert.alert("Success report!")
68 | }
69 | else {
70 | Alert.alert(responseJson.message)
71 | }
72 | })
73 | .catch((error) => {
74 | alert(JSON.stringify(error))
75 | return
76 | });
77 | }
78 | render() {
79 | return (
80 |
81 |
82 |
83 | this.onBack()}
85 | >
86 |
87 |
88 |
89 | {"REPORT A PROBLEM"}
90 |
91 |
92 |
93 |
94 | {"Description of Problem"}
95 | this.setState({ problem_content })}
106 | autoCapitalize="none"
107 | underlineColorAndroid="transparent"
108 | />
109 |
110 |
111 | this.onReport()}
113 | >
114 | {"SEND"}
115 |
116 |
117 |
118 |
119 | );
120 | }
121 | }
122 | const DEVICE_WIDTH = Dimensions.get('window').width;
123 | // const DEVICE_HEIGHT = Dimensions.get('window').height;
124 | const styles = StyleSheet.create({
125 | contentContainer: {
126 | width: '100%',
127 | height: '100%',
128 | backgroundColor: '#fff',
129 | },
130 | instructions: {
131 | textAlign: 'center',
132 | color: '#3333ff',
133 | marginBottom: 5,
134 | },
135 | });
136 | export default Report;
137 |
--------------------------------------------------------------------------------
/front-react-master/ios/DazzledDate.xcodeproj/xcshareddata/xcschemes/DazzledDate.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/front-react-master/ios/DazzledDate.xcodeproj/xcshareddata/xcschemes/DazzledDate-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Main/TermsPolicy.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import {
3 | Icon,
4 | Text
5 | } from "native-base";
6 | import {
7 | View,
8 | StyleSheet,
9 | StatusBar,
10 | WebView,
11 | Platform,
12 | Dimensions, TouchableOpacity
13 | } from 'react-native';
14 | import Global from '../Global';
15 |
16 | var BGWASH = 'rgba(255,255,255,0.8)';
17 | var DISABLED_WASH = 'rgba(255,255,255,0.25)';
18 |
19 | var TEXT_INPUT_REF = 'urlInput';
20 | var WEBVIEW_REF = 'webview';
21 |
22 | class TermsPolicy extends Component {
23 | constructor(props) {
24 | super(props);
25 | this.state = {
26 | url: 'http://dazzleddate.com/tos',
27 | status: 'No Page Loaded',
28 | backButtonEnabled: false,
29 | forwardButtonEnabled: false,
30 | loading: true,
31 | scalesPageToFit: true,
32 | inputText: ''
33 | }
34 | }
35 | static navigationOptions = {
36 | header: null,
37 | };
38 |
39 | componentWillMount() {
40 | Global.saveData.nowPage = 'TermsPolicy';
41 | }
42 |
43 | back() {
44 | this.props.navigation.goBack(null)
45 | }
46 | render() {
47 | this.inputText = this.state.url;
48 |
49 | return (
50 |
51 |
52 |
53 | this.back()}>
54 |
55 |
56 |
57 | {"Terms and Conditions/Privacy Policy"}
58 |
59 |
60 |
71 |
72 | );
73 | }
74 |
75 | goBack = () => {
76 | this.refs[WEBVIEW_REF].goBack();
77 | }
78 |
79 | goForward = () => {
80 | this.refs[WEBVIEW_REF].goForward();
81 | }
82 |
83 | reload = () => {
84 | this.refs[WEBVIEW_REF].reload();
85 | }
86 |
87 | onShouldStartLoadWithRequest = (event) => {
88 | // Implement any custom loading logic here, don't forget to return!
89 | return true;
90 | }
91 | onNavigationStateChange = (navState) => {
92 | }
93 |
94 | onSubmitEditing = (event) => {
95 | this.pressGoButton();
96 | }
97 |
98 | pressGoButton = () => {
99 | var url = this.inputText.toLowerCase();
100 | if (url === this.state.url) {
101 | this.reload();
102 | } else {
103 | this.setState({
104 | url: url,
105 | });
106 | }
107 | // dismiss keyoard
108 | this.refs[TEXT_INPUT_REF].blur();
109 | }
110 |
111 | }
112 | const DEVICE_WIDTH = Dimensions.get('window').width;
113 | const DEVICE_HEIGHT = Dimensions.get('window').height;
114 | var styles = StyleSheet.create({
115 | container: {
116 | flex: 1,
117 | backgroundColor: "#fff",
118 | },
119 | addressBarRow: {
120 | flexDirection: 'row',
121 | padding: 8,
122 | },
123 | webView: {
124 | backgroundColor: BGWASH,
125 | },
126 | addressBarTextInput: {
127 | backgroundColor: 'transparent',
128 | borderColor: 'transparent',
129 | borderRadius: 3,
130 | borderWidth: 1,
131 | height: '100%',
132 | paddingLeft: 10,
133 | paddingTop: 3,
134 | textAlign: 'center',
135 | paddingBottom: 3,
136 | flex: 1,
137 | fontSize: 28,
138 | fontWeight: 'bold',
139 | },
140 | navButton: {
141 | width: 20,
142 | padding: 3,
143 | marginRight: 3,
144 | alignItems: 'center',
145 | justifyContent: 'center',
146 | backgroundColor: BGWASH,
147 | borderColor: 'transparent',
148 | borderRadius: 3,
149 | },
150 | disabledButton: {
151 | width: 20,
152 | padding: 3,
153 | marginRight: 3,
154 | alignItems: 'center',
155 | justifyContent: 'center',
156 | backgroundColor: DISABLED_WASH,
157 | borderColor: 'transparent',
158 | borderRadius: 3,
159 | },
160 | goButton: {
161 | height: 24,
162 | padding: 3,
163 | marginLeft: 8,
164 | alignItems: 'center',
165 | backgroundColor: BGWASH,
166 | borderColor: 'transparent',
167 | borderRadius: 3,
168 | alignSelf: 'stretch',
169 | },
170 | statusBar: {
171 | flexDirection: 'row',
172 | alignItems: 'center',
173 | paddingLeft: 5,
174 | height: 22,
175 | },
176 | statusBarText: {
177 | color: 'white',
178 | fontSize: 13,
179 | },
180 | spinner: {
181 | width: 20,
182 | marginRight: 6,
183 | },
184 | menuItem: {
185 | width: '20%',
186 | height: 55,
187 | alignItems: 'center',
188 | backgroundColor: 'rgba(0,0,0,0.1)',
189 | borderWidth: 0.5,
190 | borderColor: 'gray',
191 | },
192 | lmenuItem: {
193 | width: '22%',
194 | marginLeft: '-2%',
195 | height: 55,
196 | alignItems: 'center',
197 | backgroundColor: 'rgba(0,0,0,0.1)',
198 | borderWidth: 0.5,
199 | borderColor: 'gray',
200 | },
201 | rmenuItem: {
202 | width: '22%',
203 | height: 55,
204 | alignItems: 'center',
205 | backgroundColor: 'rgba(0,0,0,0.1)',
206 | borderWidth: 0.5,
207 | borderColor: 'gray',
208 | },
209 | });
210 | export default TermsPolicy;
211 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Main/Profile.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Icon,
4 | Text,
5 | } from "native-base";
6 | import {
7 | ImageBackground,
8 | ScrollView,
9 | Platform,
10 | Dimensions,
11 | View,
12 | StyleSheet,
13 | FlatList,
14 | TouchableOpacity,
15 | StatusBar
16 | } from "react-native";
17 |
18 | import Global from '../Global';
19 |
20 | import {SERVER_URL} from '../../config/constants';
21 |
22 | class Profile extends Component {
23 | constructor(props) {
24 | super(props);
25 | this.state = {
26 | id: '',
27 | name: '',
28 | datas: []
29 | };
30 | }
31 |
32 | static navigationOptions = {
33 | header: null
34 | };
35 | componentDidMount() {
36 | Global.saveData.nowPage = 'Profile';
37 | var otherid = this.props.navigation.state.params.id;
38 | var othername = this.props.navigation.state.params.name;
39 |
40 | this.setState({ id: otherid, name: othername });
41 | this.getVideos(otherid);
42 | }
43 | getVideos(otherid) {
44 | fetch(`${SERVER_URL}/api/video/othervideo/${otherid}`, {
45 | method: 'GET',
46 | headers: {
47 | 'Content-Type': 'application/json',
48 | 'Authorization': Global.saveData.token
49 | }
50 | }).then((response) => response.json())
51 | .then((responseJson) => {
52 | if (!responseJson.error) {
53 | this.getTumbnails(responseJson.data)
54 | }
55 | })
56 | .catch((error) => {
57 | return
58 | });
59 | }
60 | getTumbnails = async (data) => {
61 |
62 | var list_items = [];
63 | for (var i = 0; i < data.length; i++) {
64 | var value = Object.values(data[i]);
65 | var url = `${SERVER_URL}/api/storage/videoLink?fileId=${value[0]}-screenshot`;
66 | var vurl = `${SERVER_URL}/api/storage/videoLink?fileId=${value[0]}`;
67 | await fetch(url, {
68 | method: 'GET',
69 | headers: {
70 | 'Content-Type': 'application/json',
71 | 'Authorization': Global.saveData.token
72 | }
73 | }).then((response) => response.json())
74 | .then((responseJson) => {
75 | list_items.push({
76 | index: i,
77 | otherId: data[i].other_user_id,
78 | imageUrl: responseJson.url,
79 | videoUrl: vurl,
80 | name: 'NAME',
81 | time: 'TIME'
82 | });
83 | }).catch((error) => {
84 | return
85 | });
86 | }
87 | this.setState({
88 | datas: list_items
89 | });
90 | }
91 | showUserVideo(url, otherId) {
92 | fetch(url, {
93 | method: 'GET',
94 | headers: {
95 | 'Content-Type': 'application/json',
96 | 'Authorization': Global.saveData.token
97 | }
98 | }).then((response) => response.json())
99 | .then((responseJson) => {
100 | this.props.navigation.navigate("ProfileDetail", { url: responseJson.url, otherId: otherId })
101 | })
102 | .catch((error) => {
103 | alert("There is error, please try again!");
104 | return
105 | });
106 | }
107 | onBack() {
108 | if (Global.saveData.prevpage == "ChatDetail") {
109 | this.props.navigation.pop();
110 | }
111 | else {
112 | Global.saveData.prePage = "Profile"
113 | this.props.navigation.replace(Global.saveData.prevpage);
114 | }
115 | }
116 |
117 | render() {
118 | return (
119 |
120 |
121 |
122 | this.onBack()} >
124 |
125 |
126 |
127 | {this.state.name}
128 |
129 |
130 |
131 | {(this.state.datas.length != 0) && (
132 | {
139 | return (
140 | this.showUserVideo(rowData.videoUrl, rowData.otherId)}>
141 |
142 |
143 |
144 | );
145 | }}
146 | keyExtractor={(item, index) => index}
147 | />)}
148 |
149 |
150 |
151 | );
152 | }
153 | }
154 | const DEVICE_WIDTH = Dimensions.get('window').width;
155 | // const DEVICE_HEIGHT = Dimensions.get('window').height;
156 | const styles = StyleSheet.create({
157 | contentContainer: {
158 | width: '100%',
159 | height: '100%',
160 | backgroundColor: '#fff',
161 | },
162 | instructions: {
163 | textAlign: 'center',
164 | color: '#3333ff',
165 | marginBottom: 5,
166 | },
167 | });
168 | export default Profile;
169 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Auths/EmailConfirm.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Text, Content,
4 | } from "native-base"
5 | import { Image,
6 | ImageBackground,
7 | Platform,
8 | Dimensions,
9 | TextInput,
10 | View,
11 | StyleSheet,
12 | TouchableOpacity,
13 | StatusBar, Alert } from "react-native";
14 | import logo from '../../assets/images/logo.png';
15 | import slogo from '../../assets/images/second_bg.png';
16 | import Global from '../Global';
17 | import {SERVER_URL} from '../../config/constants';
18 |
19 | class EmailConfirm extends Component {
20 | constructor(props) {
21 | super(props);
22 | this.state = {
23 | email: '',
24 | code: '',
25 | gotCode: '',
26 | };
27 | }
28 |
29 | static navigationOptions = {
30 | header: null
31 | };
32 | componentDidMount() {
33 | this.sendCode()
34 | }
35 | sendCode() {
36 | fetch(`${SERVER_URL}/api/user/sendConfirmEmail`, {
37 | method: 'POST',
38 | headers: {
39 | 'Content-Type': 'application/x-www-form-urlencoded',
40 | 'Authorization': Global.saveData.token
41 | }
42 | }).then((response) => response.json())
43 | .then((responseJson) => {
44 | if (!responseJson.error) {
45 | Alert.alert(
46 | '',
47 | "Email has been sent! Please check your spam folder if you dont see in your inbox.",
48 | [
49 | { text: 'OK', onPress: () => console.log('OK Pressed') },
50 | ],
51 | { cancelable: false },
52 | );
53 | }
54 | else {
55 | Alert.alert(responseJson.message)
56 | }
57 | })
58 | .catch((error) => {
59 | return
60 | }
61 | );
62 | }
63 | onConfirm() {
64 | if (this.state.code !== '') {
65 | var details = {
66 | 'confirmCode': this.state.code
67 | };
68 |
69 | var formBody = [];
70 | for (var property in details) {
71 | var encodedKey = encodeURIComponent(property);
72 | var encodedValue = encodeURIComponent(details[property]);
73 | formBody.push(encodedKey + "=" + encodedValue);
74 | }
75 | formBody = formBody.join("&");
76 |
77 | fetch(`${SERVER_URL}/api/user/emailVerify`, {
78 | method: 'POST',
79 | headers: {
80 | 'Content-Type': 'application/x-www-form-urlencoded'
81 | },
82 | body: formBody,
83 | }).then((response) => response.json())
84 | .then((responseJson) => {
85 | alert(JSON.stringify(responseJson))
86 | if (!responseJson.error) {
87 | this.props.navigation.replace("Main");
88 | } else {
89 | alert(responseJson.message ? responseJson.message : 'Woops! Try again.');
90 | }
91 | })
92 | .catch((error) => {
93 | alert(JSON.stringify(error))
94 | return
95 | });
96 | } else {
97 | alert("Please provide your confirmation code.");
98 | }
99 | }
100 | render() {
101 | return (
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | {"Please enter your confirmation code"}
110 | {"We sent to your email"}
111 |
112 |
113 |
114 | this.setState({ code })}
119 | autoCapitalize="none"
120 | underlineColorAndroid="transparent"
121 | />
122 |
123 |
124 |
125 | this.onConfirm()}>
127 | {"CONFIRM"}
128 |
129 |
130 |
131 |
132 | {"Didn't get an Email?"}
133 | this.sendCode()}>
134 | {"Send email again"}
135 |
136 |
137 |
138 |
139 | );
140 | }
141 | }
142 | const DEVICE_WIDTH = Dimensions.get('window').width;
143 | const DEVICE_HEIGHT = Dimensions.get('window').height;
144 | const styles = StyleSheet.create({
145 | contentContainer: {
146 | width: '100%',
147 | height: '100%',
148 | backgroundColor: '#fff',
149 | },
150 | });
151 | export default EmailConfirm;
152 |
--------------------------------------------------------------------------------
/front-react-master/App.js:
--------------------------------------------------------------------------------
1 | if (__DEV__) {
2 | import('./ReactotronConfig').then(() => console.log('Reactotron Configured'));
3 | }
4 |
5 | import React from 'react';
6 | import { View, AsyncStorage, PermissionsAndroid } from 'react-native';
7 | import * as firebase from 'firebase';
8 | import nativeFirebase from 'react-native-firebase';
9 | import FlashMessage, { showMessage } from 'react-native-flash-message';
10 | import AppView from './AppView';
11 | import Global from './src/components/Global';
12 |
13 | export default class App extends React.Component {
14 | constructor(props) {
15 | super(props);
16 | }
17 |
18 | async componentWillMount() {
19 | console.disableYellowBox = true;
20 | var firebaseConfig = {
21 | apiKey: "AIzaSyBLEM8NoFevrJ0uyvetYKrFUdeDuSVdL1Q",
22 | authDomain: "dz-chat-app.firebaseapp.com",
23 | databaseURL: "https://dz-chat-app.firebaseio.com",
24 | projectId: "dz-chat-app",
25 | storageBucket: "",
26 | messagingSenderId: "289099129817",
27 | appId: "1:289099129817:web:7ffff5d747763479"
28 | };
29 | firebase.initializeApp(firebaseConfig);
30 | this.setState({ loading: false });
31 | }
32 |
33 | componentDidMount() {
34 | this.checkCameraPermission();
35 | this.checkPermission();
36 | this.createNotificationListeners();
37 | }
38 |
39 | componentWillUnmount() {
40 | this.notificationListener();
41 | this.notificationOpenedListener();
42 | }
43 |
44 | async checkCameraPermission() {
45 | try {
46 | var permissions = [];
47 | const isCameraPermission = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.CAMERA);
48 | const isRecordAudioPermission = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);
49 | const isAccessFineLocationPermission = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
50 | if (!isCameraPermission) {
51 | permissions.push(PermissionsAndroid.PERMISSIONS.CAMERA);
52 | }
53 | if (!isRecordAudioPermission) {
54 | permissions.push(PermissionsAndroid.PERMISSIONS.RECORD_AUDIO);
55 | }
56 | if (!isAccessFineLocationPermission) {
57 | permissions.push(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
58 | }
59 | if (permissions.length === 0) {
60 | return;
61 | }
62 | await this.requestPermissions(permissions);
63 | } catch (error) {
64 | // Error retrieving data
65 | console.error(error);
66 | }
67 | }
68 |
69 | async requestPermissions(permissions) {
70 | try {
71 | const granted = await PermissionsAndroid.requestMultiple(
72 | permissions,
73 | {
74 | title: 'Cool App Some Permissions',
75 | message:
76 | 'Cool App needs access to your some permissions.',
77 | buttonNegative: 'Cancel',
78 | buttonPositive: 'OK',
79 | },
80 | );
81 | if (granted['android.permission.CAMERA']
82 | && granted['android.permission.RECORD_AUDIO']
83 | && granted['android.permission.ACCESS_FINE_LOCATION'] === PermissionsAndroid.RESULTS.GRANTED) {
84 | alert('You can use the all');
85 | } else {
86 | alert('all permission denied');
87 | }
88 | } catch (error) {
89 | // Error retrieving data
90 | console.error(error);
91 | }
92 | }
93 |
94 | async checkPermission() {
95 | const enabled = await nativeFirebase.messaging().hasPermission();
96 | if (enabled) {
97 | this.getToken();
98 | } else {
99 | this.requestPermission();
100 | }
101 | }
102 |
103 | async requestPermission() {
104 | try {
105 | await nativeFirebase.messaging().requestPermission();
106 | // User has authorised
107 | this.getToken();
108 | } catch (error) {
109 | // User has rejected permissions
110 | alert('Firebase permission rejected');
111 | }
112 | }
113 |
114 | async getToken() {
115 | let fcmToken = await AsyncStorage.getItem('fcmToken');
116 | if (!fcmToken) {
117 | fcmToken = await nativeFirebase.messaging().getToken();
118 | if (fcmToken) {
119 | // user has a device token
120 | await AsyncStorage.setItem('fcmToken', fcmToken);
121 | }
122 | }
123 | }
124 |
125 | async createNotificationListeners() {
126 | this.notificationListener = nativeFirebase.notifications().onNotification((notification) => {
127 | const { title, body, data } = notification;
128 | if (data) {
129 | const type = data.type;
130 | this.checkNotification(title, body, type);
131 | }
132 | });
133 |
134 | this.notificationOpenedListener = nativeFirebase.notifications().onNotificationOpened((notificationOpen) => {
135 | const { title, body, data } = notificationOpen.notification;
136 | if (data) {
137 | const type = data.type;
138 | this.checkNotification(title, body, type);
139 | }
140 | });
141 |
142 | const notificationOpen = await nativeFirebase.notifications().getInitialNotification();
143 | if (notificationOpen) {
144 | const { title, body, data } = notificationOpen.notification;
145 | if (data) {
146 | const type = data.type;
147 | this.checkNotification(title, body, type);
148 | }
149 | }
150 |
151 | this.messageListener = nativeFirebase.messaging().onMessage((message) => {
152 | //process data message
153 | alert(JSON.stringify(message));
154 | });
155 | }
156 |
157 | checkNotification = (title, body, type) => {
158 | const { nowPage } = Global.saveData;
159 | if (nowPage !== type) {
160 | showMessage({
161 | message: title,
162 | description: body,
163 | type: "default",
164 | icon: 'info'
165 | });
166 | }
167 | }
168 |
169 | render() {
170 | return (
171 |
172 |
173 |
174 |
175 | );
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/back-node-master/app.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | var app = express();
3 | const expressip = require('express-ip');
4 | var bodyParser = require('body-parser');
5 | const async = require('async');
6 | const bcrypt = require('bcrypt');
7 | var jwt = require('jsonwebtoken');
8 | require('dotenv').config();
9 |
10 | app.use(bodyParser.json());
11 | app.use(bodyParser.urlencoded({
12 | extended: true
13 | }));
14 |
15 | app.use(expressip().getIpInfoMiddleware);
16 | app.use((req, res, next) => {
17 | res.header("Access-Control-Allow-Origin", "*");
18 | res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
19 | res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, authorization");
20 | next();
21 | });
22 |
23 | const dbConn = require('./config/dbConfig');
24 | const sendEmail = require('./config/mailConfig').sendEmail;
25 | const fromEmail = process.env.SERVER_EMAIL_ADDRESS;
26 |
27 | // default route
28 | app.get('/', function (req, res) {
29 | return res.send({ error: true, message: 'hello' })
30 | });
31 |
32 | var userApi = require('./routes/userApi');
33 | var videoApi = require('./routes/videoApi');
34 | var matchApi = require('./routes/matchApi').matchApi;
35 | var languageApi = require('./routes/languageApi');
36 | var countryApi = require('./routes/countryApi');
37 | var ethnicityApi = require('./routes/ethnicityApi');
38 | var chatApi = require('./routes/chatApi');
39 |
40 | const storageApi = require('./routes/storageApi');
41 |
42 | //----- * user password reset apis * ------//
43 | //user reset password request api
44 | app.post('/requestResetPassword', function(req, res) {
45 | var toEmail = req.body.email;
46 | if (!toEmail) return res.status(400).send({error: true, message: 'Please provide reset email address'});
47 |
48 | dbConn.query("SELECT id FROM tbl_user WHERE email_address=? ", toEmail, function(error, results, fields) {
49 | if (error) return res.status(400).send({error: true, detail: error.code, message: error.sqlMessage});
50 | if (!results.length) return res.status(403).send({error: true, message: 'Email address does not exist.'});
51 | const token = jwt.sign(
52 | {
53 | email: toEmail
54 | }, process.env.EMAIL_SECRET_KEY,
55 | {
56 | expiresIn: 1000 * 60 * 60 * 10
57 | }
58 | );
59 | const confirmLink = "https://dazzleddate.com/confirm/" + token;
60 | async.parallel(
61 | [
62 | function (callback) {
63 | sendEmail(
64 | callback,
65 | fromEmail,
66 | toEmail,
67 | 'Resetting Password',
68 | 'Do you want to change your passsword?',
69 | "Hello,
Please Click on the link to reset your password.
Click here to reset your password"
70 | );
71 | }
72 | ], function(err, results) {
73 | if (err) return res.status(403).send({error: true, detail: err, message: 'Sending Email Faild'});
74 |
75 | return res.send({
76 | error: false,
77 | message: 'Emails sent'
78 | });
79 | });
80 | });
81 | });
82 |
83 | //reset user password
84 | app.put('/resetPassword/:token', function(req, res) {
85 | try {
86 | const token = req.params.token;
87 | jwt.verify(token, process.env.EMAIL_SECRET_KEY, function(error, decoded) {
88 | if (error) return res.send({error: true, message: 'Reset Session Expired.'});
89 | var decode = decoded;
90 |
91 | if (!decode) return res.send({error: true, message: 'Invalid Token.'});
92 | const resetEmail = decode.email;
93 |
94 | var newPassword = req.body.password;
95 | if (!newPassword) return res.status(403).send({error: true, message: 'please provide password.'});
96 |
97 | var updateData = {
98 | password: bcrypt.hashSync(newPassword, 10, (err, hash) => {
99 | return hash;
100 | }),
101 | updated_date: new Date()
102 | };
103 | dbConn.query('UPDATE tbl_user SET ? WHERE email_address=?', [updateData, resetEmail], function(error1, updateResult, updateFeidls) {
104 | if (error1) return res.status(400).send({error: true, detail:error1.code, message: error1.sqlMessage});
105 | async.parallel(
106 | [
107 | function (callback) {
108 | sendEmail(
109 | callback,
110 | fromEmail,
111 | resetEmail,
112 | 'Resetting Password',
113 | 'Do you want to change your passsword?',
114 | " Dear, Your Password was recently changed
This email confirms that you recently changed the password for your account. No further action is required.
"
115 | );
116 | }
117 | ], function(err, results) {
118 | if (err) return res.send({error: true, message: 'Sending email failed!'});
119 |
120 | return res.send({error: false, message: 'Success! Please try to login again!'});
121 | });
122 | });
123 | });
124 | } catch (error) {
125 | return res.status(401).send({
126 | message: 'Session Expired.'
127 | });
128 | }
129 | });
130 | //----- * user password reset apis end * ------//
131 |
132 | //routers
133 | app.use('/api/user', userApi);
134 | app.use('/api/video', videoApi);
135 | app.use('/api/match', matchApi);
136 | app.use('/api/language', languageApi);
137 | app.use('/api/country', countryApi);
138 | app.use('/api/ethnicity', ethnicityApi);
139 | app.use('/api/chat', chatApi);
140 | app.use('/api/storage', storageApi)
141 |
142 | module.exports = app;
--------------------------------------------------------------------------------
/front-react-master/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin, switch paths to Windows format before running java
129 | if $cygwin ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=$((i+1))
158 | done
159 | case $i in
160 | (0) set -- ;;
161 | (1) set -- "$args0" ;;
162 | (2) set -- "$args0" "$args1" ;;
163 | (3) set -- "$args0" "$args1" "$args2" ;;
164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=$(save "$@")
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 | cd "$(dirname "$0")"
186 | fi
187 |
188 | exec "$JAVACMD" "$@"
189 |
--------------------------------------------------------------------------------
/front-react-master/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
37 | * // for example: to disable dev mode in the staging build type (if configured)
38 | * devDisabledInStaging: true,
39 | * // The configuration property can be in the following formats
40 | * // 'devDisabledIn${productFlavor}${buildType}'
41 | * // 'devDisabledIn${buildType}'
42 | *
43 | * // the root of your project, i.e. where "package.json" lives
44 | * root: "../../",
45 | *
46 | * // where to put the JS bundle asset in debug mode
47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
48 | *
49 | * // where to put the JS bundle asset in release mode
50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
51 | *
52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
53 | * // require('./image.png')), in debug mode
54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
55 | *
56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
57 | * // require('./image.png')), in release mode
58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
59 | *
60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
64 | * // for example, you might want to remove it from here.
65 | * inputExcludes: ["android/**", "ios/**"],
66 | *
67 | * // override which node gets called and with what additional arguments
68 | * nodeExecutableAndArgs: ["node"],
69 | *
70 | * // supply additional arguments to the packager
71 | * extraPackagerArgs: []
72 | * ]
73 | */
74 |
75 | project.ext.react = [
76 | entryFile: "index.js"
77 | ]
78 |
79 | apply from: "../../node_modules/react-native/react.gradle"
80 |
81 | /**
82 | * Set this to true to create two separate APKs instead of one:
83 | * - An APK that only works on ARM devices
84 | * - An APK that only works on x86 devices
85 | * The advantage is the size of the APK is reduced by about 4MB.
86 | * Upload all the APKs to the Play Store and people will download
87 | * the correct one based on the CPU architecture of their device.
88 | */
89 | def enableSeparateBuildPerCPUArchitecture = false
90 |
91 | /**
92 | * Run Proguard to shrink the Java bytecode in release builds.
93 | */
94 | def enableProguardInReleaseBuilds = false
95 |
96 | android {
97 | compileSdkVersion rootProject.ext.compileSdkVersion
98 |
99 | compileOptions {
100 | sourceCompatibility JavaVersion.VERSION_1_8
101 | targetCompatibility JavaVersion.VERSION_1_8
102 | }
103 |
104 | defaultConfig {
105 | applicationId "com.pys.dazzleddate"
106 | minSdkVersion rootProject.ext.minSdkVersion
107 | targetSdkVersion rootProject.ext.targetSdkVersion
108 | multiDexEnabled true
109 | versionCode 1
110 | versionName "1.0"
111 | }
112 | splits {
113 | abi {
114 | reset()
115 | enable enableSeparateBuildPerCPUArchitecture
116 | universalApk false // If true, also generate a universal APK
117 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
118 | }
119 | }
120 | buildTypes {
121 | release {
122 | minifyEnabled enableProguardInReleaseBuilds
123 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
124 | }
125 | }
126 | // applicationVariants are e.g. debug, release
127 | applicationVariants.all { variant ->
128 | variant.outputs.each { output ->
129 | // For each separate APK per architecture, set a unique version code as described here:
130 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
131 | def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
132 | def abi = output.getFilter(OutputFile.ABI)
133 | if (abi != null) { // null for the universal-debug, universal-release variants
134 | output.versionCodeOverride =
135 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
136 | }
137 | }
138 | }
139 | defaultConfig {
140 | missingDimensionStrategy 'react-native-camera', 'general'
141 | }
142 | }
143 |
144 | dependencies {
145 | implementation project(':react-native-firebase')
146 | implementation project(':react-native-geolocation-service')
147 | implementation project(':react-native-gesture-handler')
148 | implementation project(':react-native-fcm')
149 | implementation project(':react-native-device-info')
150 | implementation project(':react-native-video')
151 | implementation project(':react-native-wheel-picker')
152 | implementation project(':react-native-fs')
153 | implementation project(':react-native-camera')
154 | implementation project(':@react-native-community_async-storage')
155 | implementation project(':react-native-image-picker')
156 | implementation fileTree(dir: "libs", include: ["*.jar"])
157 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
158 | implementation "com.facebook.react:react-native:+"
159 | implementation 'com.google.firebase:firebase-core:16.0.3'
160 | implementation 'com.google.firebase:firebase-messaging:17.6.0' // From node_modules
161 | }
162 |
163 | // Run this once to be able to run the application with BUCK
164 | // puts all compile dependencies into folder libs for BUCK to use
165 | task copyDownloadableDepsToLibs(type: Copy) {
166 | from configurations.compile
167 | into 'libs'
168 | }
169 |
170 | apply plugin: 'com.google.gms.google-services'
171 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Auths/Signup.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Text,
4 | Content
5 | } from "native-base"
6 | import {
7 | ImageBackground,
8 | Image,
9 | Platform,
10 | Dimensions,
11 | TextInput,
12 | View, StyleSheet,
13 | TouchableOpacity, StatusBar, Alert } from "react-native";
14 | import logo from '../../assets/images/logo.png';
15 | import slogo from '../../assets/images/second_bg.png';
16 | import emailIcon from '../../assets/images/emailIcon.png';
17 | import passswordIcon from '../../assets/images/passwordIcon.png';
18 | import userIcon from '../../assets/images/userIcon.png';
19 |
20 | class Signup extends Component {
21 | constructor(props) {
22 | super(props);
23 | this.state = {
24 | name: '',
25 | email: '',
26 | password: '',
27 | cpassword: '',
28 | };
29 | }
30 |
31 | static navigationOptions = {
32 | header: null
33 | };
34 | handleSignup() {
35 | if (this.state.name == '') {
36 | Alert.alert("The name is not inputed")
37 | return;
38 | }
39 | if (this.state.email == '') {
40 | Alert.alert("The email is not inputed")
41 | return;
42 | }
43 | if (this.state.password == '') {
44 | Alert.alert("The password is not inputed")
45 | return;
46 | }
47 | if (this.state.password != this.state.cpassword) {
48 | Alert.alert("The confirm password is not correct")
49 | return;
50 | }
51 | this.props.navigation.navigate("Register1", { name: this.state.name, email: this.state.email, password: this.state.password })
52 | }
53 | gotoLogin() {
54 | this.props.navigation.navigate("Login")
55 | }
56 | render() {
57 | return (
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | {"Create Account"}
66 |
67 |
68 |
69 |
70 | {"NAME"}
71 |
72 |
73 | this.setState({ name })}
77 | autoCapitalize="none"
78 | underlineColorAndroid="transparent"
79 | />
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | {"EMAIL ID"}
88 |
89 |
90 | this.setState({ email })}
96 | autoCapitalize="none"
97 | underlineColorAndroid="transparent"
98 | />
99 |
100 |
101 |
102 |
103 |
104 |
105 | {"PASSWORD"}
106 |
107 |
108 | this.setState({ password })}
113 | autoCapitalize="none"
114 | underlineColorAndroid="transparent"
115 | />
116 |
117 |
118 |
119 |
120 |
121 |
122 | {"CONFIRM PASSWORD"}
123 |
124 |
125 | this.setState({ cpassword })}
130 | autoCapitalize="none"
131 | underlineColorAndroid="transparent"
132 | />
133 |
134 |
135 |
136 |
137 | this.handleSignup()}>
139 | {"SIGN UP"}
140 |
141 |
142 |
143 | {"Already have an account?"}
144 | this.gotoLogin()}>
145 | {" Sign In "}
146 |
147 |
148 |
149 |
150 |
151 | );
152 | }
153 | }
154 | const DEVICE_WIDTH = Dimensions.get('window').width;
155 | // const DEVICE_HEIGHT = Dimensions.get('window').height;
156 | const styles = StyleSheet.create({
157 | contentContainer: {
158 | width: '100%',
159 | height: '100%',
160 | backgroundColor: '#fff',
161 | },
162 | });
163 | export default Signup;
164 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Auths/Register1.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Text,
4 | Content
5 | } from "native-base"
6 | import { ImageBackground, Image, Platform, Dimensions, View, StyleSheet, TouchableOpacity, StatusBar } from "react-native";
7 | import Picker from 'react-native-wheel-picker'
8 | import logo from '../../assets/images/logo.png';
9 | import slogo from '../../assets/images/second_bg.png';
10 | import radioIcon from '../../assets/images/radio.png';
11 | import unradioIcon from '../../assets/images/unradio.png';
12 |
13 | var PickerItem = Picker.Item;
14 |
15 | class Register1 extends Component {
16 | constructor(props) {
17 | super(props);
18 | this.state = {
19 | name: '',
20 | email: '',
21 | password: '',
22 | fullname: '',
23 | birthday: new Date(),
24 | isMale: true,
25 | selected_dItem: 6,
26 | selected_yItem: 30,
27 | selected_mItem: 6,
28 | mitemList: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Spe', 'Oct', 'Nov', 'Dec'],
29 | yitemList: ['2019'],
30 | ditemList: ['1'],
31 | };
32 | }
33 |
34 | static navigationOptions = {
35 | header: null
36 | };
37 | componentDidMount() {
38 |
39 | this.setState({
40 | name: this.props.navigation.state.params.name,
41 | email: this.props.navigation.state.params.email,
42 | password: this.props.navigation.state.params.password
43 | });
44 | }
45 | componentWillMount() {
46 | var y_item = []
47 | var d_item = []
48 | for (var i = 1959; i < 2059; i++) {
49 | y_item.push("" + i);
50 | }
51 | for (var i = 1; i < 32; i++) {
52 | d_item.push("" + i)
53 | }
54 | this.setState({ yitemList: y_item, ditemList: d_item })
55 | }
56 |
57 | ondPickerSelect(index) {
58 | this.setState({
59 | selected_dItem: index,
60 | })
61 | }
62 | onmPickerSelect(index) {
63 | this.setState({
64 | selected_mItem: index,
65 | })
66 | }
67 | onyPickerSelect(index) {
68 | this.setState({
69 | selected_yItem: index,
70 | })
71 | }
72 | goNext() {
73 | var y_item = this.state.yitemList;
74 | var m_item = this.state.mitemList;
75 | var d_item = this.state.ditemList;
76 | var mon = "";
77 | var date = "";
78 | if ((this.state.selected_mItem + 1) < 10) {
79 | mon = "0" + (this.state.selected_mItem + 1);
80 | }
81 | else {
82 | mon = "" + (this.state.selected_mItem + 1);
83 | }
84 | if ((this.state.selected_dItem + 1) < 10) {
85 | date = "0" + d_item[this.state.selected_dItem]
86 | }
87 | else {
88 | date = "" + d_item[this.state.selected_dItem]
89 | }
90 | var birthday = y_item[this.state.selected_yItem] + "-" + mon + "-" + date;
91 | var gender = 1;
92 | var fullname = this.state.fullname
93 | if (!this.state.isMale) {
94 | gender = 0
95 | }
96 | this.props.navigation.navigate("Register2", { name: this.state.name, email: this.state.email, password: this.state.password, fullname: fullname, birthday: birthday, gender: gender })
97 | }
98 | render() {
99 |
100 | var { navigate } = this.props.navigation;
101 | return (
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | {"BIRTHDAY"}
110 |
111 |
112 | this.onmPickerSelect(index)}>
116 | {this.state.mitemList.map((value, i) => (
117 |
118 | ))}
119 |
120 |
121 | this.ondPickerSelect(index)}>
125 | {this.state.ditemList.map((value, i) => (
126 |
127 | ))}
128 |
129 |
130 | this.onyPickerSelect(index)}>
134 | {this.state.yitemList.map((value, i) => (
135 |
136 | ))}
137 |
138 |
139 |
140 |
141 | this.setState({ isMale: true })}>
142 | {!this.state.isMale && }
143 | {this.state.isMale && }
144 | {"Male"}
145 |
146 | this.setState({ isMale: false })}>
147 | {!this.state.isMale && }
148 | {this.state.isMale && }
149 | {"Female"}
150 |
151 |
152 |
153 | this.goNext()}
155 | >
156 | {"NEXT"}
157 |
158 |
159 |
160 |
161 | );
162 | }
163 | }
164 | const DEVICE_WIDTH = Dimensions.get('window').width;
165 | const DEVICE_HEIGHT = Dimensions.get('window').height;
166 | const styles = StyleSheet.create({
167 | contentContainer: {
168 | width: '100%',
169 | height: '100%',
170 | backgroundColor: '#fff',
171 | },
172 | instructions: {
173 | textAlign: 'center',
174 | color: '#3333ff',
175 | marginBottom: 5,
176 | },
177 | });
178 | export default Register1;
179 |
--------------------------------------------------------------------------------
/front-react-master/src/components/Auths/Login.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import {
3 | Text, Content,
4 | } from "native-base"
5 | import {
6 | Image,
7 | ImageBackground,
8 | Platform,
9 | Dimensions,
10 | TextInput,
11 | View,
12 | StyleSheet,
13 | TouchableOpacity,
14 | StatusBar,
15 | Alert
16 | } from "react-native";
17 | import nativeFirebase from 'react-native-firebase';
18 | import store from 'react-native-simple-store';
19 | import logo from '../../assets/images/logo.png';
20 | import slogo from '../../assets/images/second_bg.png';
21 | import emailIcon from '../../assets/images/emailIcon.png';
22 | import passswordIcon from '../../assets/images/passwordIcon.png';
23 | import checkIcon from '../../assets/images/check.png';
24 | import uncheckIcon from '../../assets/images/uncheck.png';
25 | import Global from '../Global';
26 |
27 | import {SERVER_URL} from '../../config/constants';
28 |
29 | class Login extends Component {
30 | constructor(props) {
31 | super(props);
32 | this.state = {
33 | email: '',
34 | password: '',
35 | remberCheck: false,
36 | };
37 | }
38 |
39 | static navigationOptions = {
40 | header: null
41 | };
42 | checkRemember() {
43 | this.setState({ remberCheck: !this.state.remberCheck })
44 | }
45 | onLogin() {
46 | if (this.state.email == '') {
47 | Alert.alert("The email is not inputed")
48 | return;
49 | }
50 | if (this.state.password == '') {
51 | Alert.alert("The password is not inputed")
52 | return;
53 | }
54 | if (this.state.remberCheck) {
55 | store.save("email", this.state.email);
56 | store.save("password", this.state.password);
57 | }
58 | nativeFirebase.messaging().getToken().then(fcmToken => {
59 | if (fcmToken) {
60 | var details = {
61 | 'useremail': this.state.email,
62 | 'userpassword': this.state.password,
63 | 'deviceId': fcmToken
64 | };
65 | var formBody = [];
66 | for (var property in details) {
67 | var encodedKey = encodeURIComponent(property);
68 | var encodedValue = encodeURIComponent(details[property]);
69 | formBody.push(encodedKey + "=" + encodedValue);
70 | }
71 | formBody = formBody.join("&");
72 | fetch(`${SERVER_URL}/api/user/login`, {
73 | method: 'POST',
74 | headers: {
75 | 'Content-Type': 'application/x-www-form-urlencoded'
76 | },
77 | body: formBody,
78 | }).then((response) => response.json())
79 | .then((responseJson) => {
80 | if (!responseJson.error) {
81 | Global.saveData.token = responseJson.data.token;
82 | Global.saveData.u_id = responseJson.data.id
83 | Global.saveData.u_name = responseJson.data.name
84 | Global.saveData.u_age = responseJson.data.age
85 | Global.saveData.u_gender = responseJson.data.gender
86 | Global.saveData.u_email = responseJson.data.email
87 | Global.saveData.u_language = responseJson.data.language
88 | Global.saveData.u_city = responseJson.data.ethnicity
89 | Global.saveData.u_country = responseJson.data.country
90 | Global.saveData.newUser = false;
91 | this.props.navigation.replace("Browse");
92 | } else {
93 | Alert.alert("The email or password is invalid,\n please try again");
94 | }
95 | }).catch((error) => {
96 | return
97 | });
98 | }
99 | });
100 |
101 | }
102 | gotoSignup() {
103 | this.props.navigation.navigate("Signup");
104 | }
105 | render() {
106 | return (
107 |
108 |
109 |
118 |
119 |
120 |
121 |
122 | {"Login to Continue"}
123 |
124 |
125 |
126 |
127 | {"EMAIL ID"}
128 |
129 |
130 | this.setState({ email })}
142 | autoCapitalize="none"
143 | underlineColorAndroid="transparent"
144 | />
145 |
146 |
147 |
148 |
149 |
150 |
151 | {"PASSWORD"}
152 |
153 |
154 | this.setState({ password })}
159 | autoCapitalize="none"
160 | underlineColorAndroid="transparent"
161 | />
162 |
163 |
164 |
165 |
166 | this.checkRemember()}>
167 | {this.state.remberCheck && }
168 | {!this.state.remberCheck && }
169 | {"Remember me"}
170 |
171 | this.gotoForgetPassword()}>
172 | {"Forget password"}
173 |
174 |
175 |
176 | this.onLogin()}>
178 | {"LOGIN"}
179 |
180 |
181 |
182 | {"- or -"}
183 |
184 |
185 | {"Don't have an account yet?"}
186 | this.gotoSignup()}>
187 | {" Sign Up "}
188 |
189 |
190 |
191 |
192 | );
193 | }
194 | }
195 | const DEVICE_WIDTH = Dimensions.get('window').width;
196 | // const DEVICE_HEIGHT = Dimensions.get('window').height;
197 | const styles = StyleSheet.create({
198 | contentContainer: {
199 | width: '100%',
200 | height: '100%',
201 | backgroundColor: '#fff',
202 | },
203 | });
204 | export default Login;
205 |
--------------------------------------------------------------------------------