init commit

This commit is contained in:
Juthatip McDevitt 2024-07-16 17:34:30 -05:00
parent 504e6772b1
commit 014ca66466
25 changed files with 20122 additions and 0 deletions

28
todo_app/.gitignore vendored Normal file
View file

@ -0,0 +1,28 @@
node_modules/
.expo/
dist/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
# macOS
.DS_Store
# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli
expo-env.d.ts
api/index.js
.env
README.md
scripts/*
hooks/*
constants/*
components/*

View file

View file

@ -0,0 +1,30 @@
const mongoose = require("mongoose");
const userSchema = new mongoose.Schema({
name:{
type: String,
required: true,
},
email:{
type: String,
required: true,
unique: true,
},
password:{
type: String,
required: true,
},
todos:[
{
type: mongoose.Schema.Types.ObjectId,
ref: "Todo",
}
],
createdAt:{
type: Date,
default: Date.now
}
});
const User = mongoose.model("User", userSchema);
module.exports = User

1388
todo_app/api/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

21
todo_app/api/package.json Normal file
View file

@ -0,0 +1,21 @@
{
"name": "api",
"version": "1.0.0",
"description": "server_side",
"main": "index.js",
"scripts": {
"start": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"express": "^4.19.2",
"jsonwebtoken": "^9.0.2",
"mongodb": "^6.8.0",
"mongoose": "^8.5.1",
"nodemon": "^3.1.4"
}
}

36
todo_app/app.json Normal file
View file

@ -0,0 +1,36 @@
{
"expo": {
"name": "todo_app",
"slug": "todo_app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "todo_app",
"userInterfaceStyle": "automatic",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router"
],
"experiments": {
"typedRoutes": true
}
}
}

View file

@ -0,0 +1,10 @@
import {Stack} from "expo-router";
export default function Layout(){
return(
<Stack>
<Stack.Screen name="login" options={{headerShown: false}}/>
<Stack.Screen name="register" options={{headerShown: false}}/>
</Stack>
)
}

View file

@ -0,0 +1,57 @@
import { StyleSheet, Text, View, SafeAreaView, KeyboardAvoidingView, Image, TextInput, Pressable } from 'react-native'
import React, { useState } from 'react'
import { Fontisto } from '@expo/vector-icons';
import { Entypo } from '@expo/vector-icons';
import { useRouter } from 'expo-router';
const login = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const router = useRouter();
return (
<SafeAreaView style={{flex:1, backgroundColor: "white", alignItems: "center", justifyContent:"center"}}>
<View>
<View style={{alignItems: "center"}}>
<Image
style={{width: 150, height: 150, resizeMode: "containe"}}
source={{
uri:"./assets/images/logo.png",
}}
/>
</View>
<Text style={{fontSize: 24, fontWeight: 600, color: "#222831", marginTop: 20}}>Keep Tracking</Text>
</View>
<KeyboardAvoidingView>
<View style={{alignItems: "center"}}>
<Text style={{fontSize: 16, fontWeight: 600, color: "black", marginTop: 20}}>Welcome back!</Text>
</View>
<View style={{marginTop: 50}}>
<View style={{flexDirection: "row", justifyContent: "center", alignItems: "center", gap:5, backgroundColor: "#EEEEEE", paddingHorizontal:10, borderRadius:5}}>
<Fontisto name="email" size={16} color="#31363F" />
<TextInput value={email} onChangeText={(text) => setEmail(text)} style={{color: "#31363F", width:250, outlineStyle: 'none', marginVertical: 10, fontSize:email ? 14 : 14}} placeholder='Enter your email'/>
</View>
<View style={{flexDirection: "row", justifyContent: "center", alignItems: "center", gap:5, backgroundColor: "#EEEEEE", paddingHorizontal:10, borderRadius:5, marginTop: 10}}>
<Entypo name="key" size={16} color="#31363F" />
<TextInput value={password} onChangeText={(text) => setPassword(text)} secureTextEntry={true} style={{color: "#31363F", width:250, outlineStyle: 'none', marginVertical: 10, fontSize:email ? 14 : 14}} placeholder='Enter your password'/>
</View>
<View style={{flexDirection: "row", alignItems: "center", justifyContent:"space-between", marginTop:10}}>
<Text style={{fontSize: 12}}>Keep me login</Text>
<Text style={{color: "#61677A", fontSize: 12}}>Forgot password?</Text>
</View>
<View style={{marginTop: 50}}/>
<Pressable style={{backgroundColor: "#61677A", padding:10, borderRadius:5, alignItems: "center"}}>
<Text style={{color: "#D8D9DA", fontSize: 16, fontWeight: 600}}>Login</Text>
</Pressable>
<Pressable onPress={() => router.replace("/register")} style={{marginTop: 10}}>
<Text style={{fontSize: 12, textAlign:"center"}}>Don't have an account? <Text style={{fontWeight: 700}}>Register</Text></Text>
</Pressable>
</View>
</KeyboardAvoidingView>
</SafeAreaView>
)
}
export default login
const styles = StyleSheet.create({})

View file

@ -0,0 +1,53 @@
import { StyleSheet, Text, View, SafeAreaView, KeyboardAvoidingView, Image, TextInput, Pressable } from 'react-native'
import React, { useState } from 'react'
import { Fontisto } from '@expo/vector-icons';
import { Entypo } from '@expo/vector-icons';
import { useRouter } from 'expo-router';
const register = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const router = useRouter();
return (
<SafeAreaView style={{flex:1, backgroundColor: "white", alignItems: "center", justifyContent:"center"}}>
<View>
<View style={{alignItems: "center"}}>
<Image
style={{width: 150, height: 150, resizeMode: "containe"}}
source={{
uri:"./assets/images/logo.png",
}}
/>
</View>
<Text style={{fontSize: 24, fontWeight: 600, color: "#222831", marginTop: 20}}>Keep Tracking</Text>
</View>
<KeyboardAvoidingView>
<View style={{alignItems: "center"}}>
<Text style={{fontSize: 16, fontWeight: 600, color: "black", marginTop: 20}}>Register</Text>
</View>
<View style={{marginTop: 50}}>
<View style={{flexDirection: "row", justifyContent: "center", alignItems: "center", gap:5, backgroundColor: "#EEEEEE", paddingHorizontal:10, borderRadius:5}}>
<Fontisto name="email" size={16} color="#31363F" />
<TextInput value={email} onChangeText={(text) => setEmail(text)} style={{color: "#31363F", width:250, outlineStyle: 'none', marginVertical: 10, fontSize:email ? 14 : 14}} placeholder='Enter your email'/>
</View>
<View style={{flexDirection: "row", justifyContent: "center", alignItems: "center", gap:5, backgroundColor: "#EEEEEE", paddingHorizontal:10, borderRadius:5, marginTop: 10}}>
<Entypo name="key" size={16} color="#31363F" />
<TextInput value={password} onChangeText={(text) => setPassword(text)} secureTextEntry={true} style={{color: "#31363F", width:250, outlineStyle: 'none', marginVertical: 10, fontSize:email ? 14 : 14}} placeholder='Enter your password'/>
</View>
<View style={{marginTop: 50}}/>
<Pressable style={{backgroundColor: "#61677A", padding:10, borderRadius:5, alignItems: "center"}}>
<Text style={{color: "#D8D9DA", fontSize: 16, fontWeight: 600}}>Register</Text>
</Pressable>
<Pressable onPress={() => router.replace("/login")} style={{marginTop: 10}}>
<Text style={{fontSize: 12, textAlign:"center"}}>Already have an account? <Text style={{fontWeight: 700}}>Login</Text></Text>
</Pressable>
</View>
</KeyboardAvoidingView>
</SafeAreaView>
)
}
export default register
const styles = StyleSheet.create({})

View file

@ -0,0 +1,53 @@
import {Tabs} from "expo-router";
import { FontAwesome } from '@expo/vector-icons';
import { AntDesign } from '@expo/vector-icons';
import { MaterialCommunityIcons } from '@expo/vector-icons';
export default function Layout(){
return(
<Tabs>
<Tabs.Screen
name="home"
options={{
tabBarLabel:"Home",
tabBarLabelStyle:{color:"black"},
headerShown: false,
tabBarIcon:({focused}) =>
focused? (
<FontAwesome name="tasks" size={24} color="black" />
) : (
<FontAwesome name="tasks" size={24} color="#45474B" />
)
}}
/>
<Tabs.Screen
name="calendar"
options={{
tabBarLabel:"calendar",
tabBarLabelStyle:{color:"black"},
headerShown: false,
tabBarIcon:({focused}) =>
focused? (
<AntDesign name="calendar" size={24} color="black" />
) : (
<AntDesign name="calendar" size={24} color="#45474B" />
)
}}
/>
<Tabs.Screen
name="profile"
options={{
tabBarLabel:"profile",
tabBarLabelStyle:{color:"black"},
headerShown: false,
tabBarIcon:({focused}) =>
focused? (
<MaterialCommunityIcons name="account-details" size={24} color="black" />
) : (
<MaterialCommunityIcons name="account-details" size={24} color="#45474B" />
)
}}
/>
</Tabs>
)
}

View file

@ -0,0 +1,9 @@
import {Stack} from "expo-router";
export default function Layout(){
return(
<Stack screenOptions={{headerShown:false}}>
<Stack.Screen name="index"/>
</Stack>
)
}

View file

@ -0,0 +1,14 @@
import { StyleSheet, Text, View } from 'react-native'
import React from 'react'
const index = () => {
return (
<View>
<Text>index</Text>
</View>
)
}
export default index
const styles = StyleSheet.create({})

View file

@ -0,0 +1,9 @@
import {Stack} from "expo-router";
export default function Layout(){
return(
<Stack screenOptions={{headerShown:false}}>
<Stack.Screen name="index"/>
</Stack>
)
}

View file

@ -0,0 +1,51 @@
import { Image, Pressable, ScrollView, StyleSheet, Text, View } from 'react-native'
import React from 'react'
import { AntDesign } from '@expo/vector-icons';
const index = () => {
const todo = [
];
return (
<>
<View style={{marginHorizontal:20, marginVertical:20, alignItems: "center", flexDirection: "row", gap: 10}}>
<Pressable style={{backgroundColor: "#000000", paddingHorizontal:10, paddingVertical: 5, borderRadius:25, alignItems: "center", justifyContent: "center"}}>
<Text style={{color: "white", textAlign: "center"}}>All</Text>
</Pressable>
<Pressable style={{backgroundColor: "#000000", paddingHorizontal:10, paddingVertical: 5, borderRadius:25, alignItems: "center", justifyContent: "center"}}>
<Text style={{color: "white", textAlign: "center"}}>Work</Text>
</Pressable>
<Pressable style={{backgroundColor: "#000000", paddingHorizontal:10, paddingVertical: 5, borderRadius:25, alignItems: "center", justifyContent: "center", marginRight: "auto"}}>
<Text style={{color: "white", textAlign: "center"}}>Personal</Text>
</Pressable>
<Pressable>
<AntDesign name="plus" size={24} color="black" />
</Pressable>
</View>
<ScrollView style={{flex:1, backgroundColor: "white"}}>
<View style={{padding: 10}}>
{todo?.length > 0 ? (
<View></View>
) : (
<View style={{flex:1, justifyContent:"center", alignItems:"center", marginTop:150, marginLeft:"auto", marginRight:"auto"}}>
<Image
style={{width: 100, height: 100, resizeMode: "containe"}}
source={{
uri:"./assets/images/to-do.png",
}}
/>
<Text style={{fontSize:16, fontWeight:600, marginTop: 20, textAlign:"center"}}>Hooray! No task for today</Text>
<Pressable style={{backgroundColor: "black", marginTop: 20, padding:5, borderRadius: 5}}>
<Text style={{fontSize:16, fontWeight:600, textAlign:"center", color: "white"}}>Add task <AntDesign name="plus" size={16} color="white" /></Text>
</Pressable>
</View>
)}
</View>
</ScrollView>
</>
)
}
export default index
const styles = StyleSheet.create({})

View file

@ -0,0 +1,9 @@
import {Stack} from "expo-router";
export default function Layout(){
return(
<Stack screenOptions={{headerShown:false}}>
<Stack.Screen name="index"/>
</Stack>
)
}

View file

@ -0,0 +1,14 @@
import { StyleSheet, Text, View } from 'react-native'
import React from 'react'
const index = () => {
return (
<View>
<Text>index</Text>
</View>
)
}
export default index
const styles = StyleSheet.create({})

13
todo_app/app/index.js Normal file
View file

@ -0,0 +1,13 @@
import { StyleSheet, Text, View } from "react-native";
import React from 'react';
import { Redirect } from "expo-router";
const index = () => {
return (
<Redirect href="/(authenticate)/login"/>
)
}
export default index
const styles = StyleSheet.create({})

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

6
todo_app/babel.config.js Normal file
View file

@ -0,0 +1,6 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};

18255
todo_app/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

49
todo_app/package.json Normal file
View file

@ -0,0 +1,49 @@
{
"name": "todo_app",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^14.0.2",
"@react-navigation/native": "^6.0.2",
"expo": "~51.0.20",
"expo-constants": "~16.0.2",
"expo-font": "~12.0.8",
"expo-linking": "~6.3.1",
"expo-router": "~3.5.18",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-web-browser": "~13.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.3",
"react-native-gesture-handler": "~2.16.1",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "^18.0.7",
"jest": "^29.2.1",
"jest-expo": "~51.0.3",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3"
},
"private": true
}

17
todo_app/tsconfig.json Normal file
View file

@ -0,0 +1,17 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"**/*.ts",
"**/*.tsx",
".expo/types/**/*.ts",
"expo-env.d.ts"
]
}