commit fa1accd4bb62f449d071debd5713788609b2f997 Author: 230407 <230407@epvc.pt> Date: Wed Apr 15 12:46:50 2026 +0100 primeiro commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..d94d7f7 Binary files /dev/null and b/.DS_Store differ diff --git a/.gradle/9.3.1/checksums/checksums.lock b/.gradle/9.3.1/checksums/checksums.lock new file mode 100644 index 0000000..f14563e Binary files /dev/null and b/.gradle/9.3.1/checksums/checksums.lock differ diff --git a/.gradle/9.3.1/checksums/md5-checksums.bin b/.gradle/9.3.1/checksums/md5-checksums.bin new file mode 100644 index 0000000..8bb2985 Binary files /dev/null and b/.gradle/9.3.1/checksums/md5-checksums.bin differ diff --git a/.gradle/9.3.1/checksums/sha1-checksums.bin b/.gradle/9.3.1/checksums/sha1-checksums.bin new file mode 100644 index 0000000..2c7eec9 Binary files /dev/null and b/.gradle/9.3.1/checksums/sha1-checksums.bin differ diff --git a/.gradle/9.3.1/executionHistory/executionHistory.bin b/.gradle/9.3.1/executionHistory/executionHistory.bin new file mode 100644 index 0000000..91a81d7 Binary files /dev/null and b/.gradle/9.3.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/9.3.1/executionHistory/executionHistory.lock b/.gradle/9.3.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..66b8cc5 Binary files /dev/null and b/.gradle/9.3.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/9.3.1/fileChanges/last-build.bin b/.gradle/9.3.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/9.3.1/fileChanges/last-build.bin differ diff --git a/.gradle/9.3.1/fileHashes/fileHashes.bin b/.gradle/9.3.1/fileHashes/fileHashes.bin new file mode 100644 index 0000000..5df20af Binary files /dev/null and b/.gradle/9.3.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/9.3.1/fileHashes/fileHashes.lock b/.gradle/9.3.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..cbb8ec8 Binary files /dev/null and b/.gradle/9.3.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.3.1/fileHashes/resourceHashesCache.bin b/.gradle/9.3.1/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..fb1f4bd Binary files /dev/null and b/.gradle/9.3.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/9.3.1/gc.properties b/.gradle/9.3.1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..4458c3e Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..6c5c31b --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed Mar 25 11:05:18 WET 2026 +gradle.version=9.3.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..cf55d84 Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/config.properties b/.gradle/config.properties new file mode 100644 index 0000000..e856aab --- /dev/null +++ b/.gradle/config.properties @@ -0,0 +1,2 @@ +#Wed Mar 18 09:24:04 WET 2026 +java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..3276c3c Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..54c8178 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Fluxup \ No newline at end of file diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml new file mode 100644 index 0000000..05e089c --- /dev/null +++ b/.idea/caches/deviceStreaming.xml @@ -0,0 +1,1610 @@ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..ca16a99 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/deviceManager.xml b/.idea/deviceManager.xml new file mode 100644 index 0000000..91f9558 --- /dev/null +++ b/.idea/deviceManager.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..639c779 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/studiobot.xml b/.idea/studiobot.xml new file mode 100644 index 0000000..539e3b8 --- /dev/null +++ b/.idea/studiobot.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c5f3f6b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx new file mode 100644 index 0000000..664591d --- /dev/null +++ b/app/(tabs)/_layout.tsx @@ -0,0 +1,14 @@ +import { Tabs } from 'expo-router'; + +export default function TabLayout() { + return ( + + + + + + ); +} \ No newline at end of file diff --git a/app/(tabs)/esqueciPalavraPasse.tsx b/app/(tabs)/esqueciPalavraPasse.tsx new file mode 100644 index 0000000..319c3e5 --- /dev/null +++ b/app/(tabs)/esqueciPalavraPasse.tsx @@ -0,0 +1,123 @@ +import React, { useState } from 'react'; +import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert, ActivityIndicator, SafeAreaView, KeyboardAvoidingView, Platform } from 'react-native'; +import { useRouter } from 'expo-router'; +import { Colors } from '../../src/components/common/theme'; + +export default function EsqueciPalavraPasse() { + const router = useRouter(); + const [email, setEmail] = useState(''); + const [loading, setLoading] = useState(false); + + const handleReset = () => { + if (!email) { + Alert.alert('Erro', 'Por favor insira o seu email'); + return; + + } + + setLoading(true); + // simulação de envio de instruções + setTimeout(() => { + setLoading(false); + Alert.alert('Sucesso', 'Um email com instruções foi enviado.'); + // o TypeScript não reconhece "/inicio" nas rotas tipadas; forçamos o cast + router.replace('/inicio' as any); + }, 1500); + }; + + return ( + + + Fluxup + Recuperar palavra‑passe + + + + + {loading ? : Enviar} + + + router.back()}> + Voltar + + + + ); +} + +const primary = Colors.light.tint; + +const styles = StyleSheet.create({ + safe: { + flex: 1, + backgroundColor: Colors.light.background, + }, + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + padding: 20, + backgroundColor: Colors.light.background, + }, + title: { + fontSize: 32, + fontWeight: 'bold', + marginBottom: 8, + color: primary, + }, + subtitle: { + fontSize: 16, + color: Colors.light.icon, + marginBottom: 24, + }, + input: { + width: '100%', + height: 50, + borderRadius: 8, + borderWidth: 1, + borderColor: '#ddd', + paddingHorizontal: 15, + marginBottom: 15, + fontSize: 16, + backgroundColor: '#f9f9f9', + }, + button: { + width: '100%', + height: 50, + borderRadius: 8, + backgroundColor: primary, + justifyContent: 'center', + alignItems: 'center', + marginTop: 10, + marginBottom: 20, + }, + buttonDisabled: { + backgroundColor: '#ccc', + }, + buttonText: { + color: '#fff', + fontSize: 18, + fontWeight: 'bold', + }, + linkText: { + color: primary, + fontSize: 14, + marginTop: 10, + }, +}); diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx new file mode 100644 index 0000000..7e23d38 --- /dev/null +++ b/app/(tabs)/index.tsx @@ -0,0 +1,219 @@ +import React, { useState } from 'react'; +import { + View, + Text, + TouchableOpacity, + StyleSheet, + Alert, + ActivityIndicator, + SafeAreaView, + KeyboardAvoidingView, + Platform, +} from 'react-native'; +import { useRouter } from 'expo-router'; +import { usuariosService } from '../../src/lib/supabase'; +import { Colors } from '../../src/components/common/theme'; +import { useColorScheme } from '../../src/hooks/use-color-scheme'; +import { Lock, Mail } from 'lucide-react-native'; +import { Input } from '../../src/components/common/input'; +import { Button } from '../../src/components/common/button'; + +export default function LoginScreen() { + const router = useRouter(); + const [email, setEmail] = useState(''); + const [palavraPasse, setPalavraPasse] = useState(''); + const [idUsuario, setIdUsuario] = useState(''); + const [usuario, setUsuario] = useState(''); + const [loading, setLoading] = useState(false); + + const colorScheme = useColorScheme(); + const theme = colorScheme === 'dark' ? 'dark' : 'light'; + const primary = Colors[theme].primary; + + const handleLogin = async () => { + // Validação dos campos + if (!email || !palavraPasse || !idUsuario || !usuario) { + Alert.alert('Erro', 'Por favor, preencha todos os campos'); + return; + } + + // Validação de email + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (!emailRegex.test(email)) { + Alert.alert('Erro', 'Email inválido'); + return; + } + + setLoading(true); + + try { + // login no Supabase + const { data, error } = await usuariosService.login(email, palavraPasse); + + if (error) { + Alert.alert('Erro', 'Email ou palavra passe incorretos'); + return; + } + + if (data) { + Alert.alert('Sucesso', `Bem-vindo, ${(data as any).usuario || 'usuário'}!`); + // quando o login é bem‑sucedido, vai para a página inicial + router.replace('/inicio'); + } + } catch (err) { + Alert.alert('Erro', 'Erro ao conectar ao servidor'); + console.error(err); + } finally { + setLoading(false); + } + }; + + return ( + + + Fluxup + Entre na sua conta + + {/* Campo de Email */} + + + + + + {/* Campo de Palavra Passe */} + + + + + + {/* Campo de ID Usuário */} + + + {/* Campo de Usuário */} + + + {/* Botão de Login */} +