Merge branch 'experimentation'

This commit is contained in:
Jakob Stornig 2023-11-30 20:11:42 +01:00
commit f5dc3be4df
20 changed files with 4694 additions and 1164 deletions

33
.gitignore vendored
View file

@ -1,14 +1,41 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
# dependencies
node_modules/
# Expo
.expo/
dist/
npm-debug.*
web-build/
# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
# Metro
.metro-health-check*
# debug
npm-debug.*
yarn-debug.*
yarn-error.*
# macOS
.DS_Store
*.pem
# local env files
.env*.local
# typescript
*.tsbuildinfo
# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli
expo-env.d.ts
# @end expo-cli

View file

@ -1,14 +1,69 @@
# Interaktive Systeme
# Interaktive Systeme - Finanzfuchs App
Für dieses Projekt verwenden wir React Native. Da wir dafür auch Node js brauchen, muss das bitte installiert werden.
clont das Projekt und gebt in der Kommandozeile
## Integrate with your tools
```
npm start
```
- [ ] [Set up project integrations](https://git-ainf.aau.at/thschleicher/interaktive-systeme/-/settings/integrations)
ein. Hoffentlich werden dann dependencies installiert.
## Collaborate with your team
Da wir ziemlich schnell fertig werden wollen, und eh keine Zeit haben, verwenden wir Expo.
Das ist sowas wie create-react-app für normales React. Also ein Wrapper der sich um alles kümmert. Expo is halt für react-native.
- [x] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

View file

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

56
app/_layout.tsx Normal file
View file

@ -0,0 +1,56 @@
import { Tabs } from "expo-router/tabs";
import {StyleSheet, View} from "react-native"
import { FontAwesome } from "@expo/vector-icons";
import {useThemeColor} from "../hooks/hooks";
import {color} from "ansi-fragments";
export default function Layout() {
const selectedColor: string = useThemeColor( "tabIconSelected");
const defaultColor: string = useThemeColor("tabIconDefault");
const backgroundColor: string = useThemeColor("backgroundColor");
const styles = StyleSheet.create({
sceneContainer: {
backgroundColor: backgroundColor,
position: "absolute",
},
view: {
backgroundColor: "red",
}
});
const screenOptions = {
tabBarActiveTintColor: selectedColor,
tabBarInactiveTintColor: defaultColor,
headerShown: false,
}
return (
<Tabs sceneContainerStyle={styles.sceneContainer} initialRouteName={"index"} screenOptions={{tabBarBackground: () => {
return <View style={styles.view}/>;
}}}>
<Tabs.Screen name="budget" options={
{
tabBarLabel: "Budget",
tabBarIcon: ({size, color}) => (
<FontAwesome name="money" size={size} color={color}/>),
}
}/>
<Tabs.Screen name="index" options={
{
tabBarLabel: "Home",
tabBarIcon: ({size, color}) => (
<FontAwesome name="home" size={size} color={color}/>),
}
}/>
<Tabs.Screen name="stats" options={
{
tabBarLabel: "Stats",
tabBarIcon: ({size, color}) => (
<FontAwesome name="bar-chart" size={size} color={color}/>),
}
}/>
</Tabs>
);
}

5
app/budget.tsx Normal file
View file

@ -0,0 +1,5 @@
import { Text } from 'react-native';
export default function Page() {
return <Text>Budget Page</Text>;
}

21
app/index.tsx Normal file
View file

@ -0,0 +1,21 @@
import { StyleSheet, View, Text } from 'react-native';
export default function Page() {
return (
<View style={styles.container}>
<Text style={styles.text}>Home</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
text: {
fontSize: 70,
fontWeight: "bold"
}
});

5
app/stats.tsx Normal file
View file

@ -0,0 +1,5 @@
import { Text } from 'react-native';
export default function Page() {
return <Text>Stats Page</Text>;
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/images/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/images/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
assets/images/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

View file

@ -1,11 +1,9 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
presets: ['babel-preset-expo'],
plugins: [
"@babel/plugin-proposal-export-namespace-from",
"react-native-reanimated/plugin",
require.resolve("expo-router/babel"),
'expo-router/babel',
],
};
};

20
constants/colors.ts Normal file
View file

@ -0,0 +1,20 @@
export default {
light: {
tabIconDefault: "gray",
tabIconSelected: "orange",
color: "orange",
contrastColor: "",
accentColor: "",
backgroundColor: "#ffffff",
tabBarColor: "gray",
},
dark: {
tabIconDefault: "gray",
tabIconSelected: "orange",
color: "#1B9AAA",
contrastColor: "",
accentColor: "",
backgroundColor: "lightgray",
tabBarColor: "gray",
}
}

7
hooks/hooks.ts Normal file
View file

@ -0,0 +1,7 @@
import { useColorScheme } from "react-native";
import colors from "../constants/colors"
export function useThemeColor(colorName: keyof typeof colors.light & keyof typeof colors.dark): string {
const theme = useColorScheme() ?? "light";
return colors[theme][colorName];
}

10
metro.config.js Normal file
View file

@ -0,0 +1,10 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname, {
// [Web-only]: Enables CSS support in Metro.
isCSSEnabled: true,
});
module.exports = config;

5528
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,42 +1,54 @@
{
"name": "interaktive-systeme",
"main": "expo-router/entry",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
"web": "expo start --web",
"test": "jest --watchAll",
"start tunnel": "expo start --tunnel",
"android tunnel": "expo start --android --tunnel",
"ios tunnel": "expo start --ios --tunnel",
"web tunnel": "expo start --web --tunnel",
"test tunnel": "jest --watchAll --tunnel"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^49.0.3",
"expo-constants": "~14.4.2",
"@expo/vector-icons": "^13.0.0",
"@react-navigation/native": "^6.0.2",
"expo": "~49.0.15",
"expo-font": "~11.4.0",
"expo-linking": "~5.0.2",
"expo-router": "2.0.0",
"expo-splash-screen": "~0.20.4",
"expo-router": "^2.0.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"expo-system-ui": "~2.4.0",
"expo-web-browser": "~12.3.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-vector-icons": "^10.0.2",
"react-native-web": "~0.19.6",
"save": "^2.9.0"
"react-native-web": "~0.19.6"
},
"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9"
},
"resolutions": {
"metro": "^0.73.7",
"metro-resolver": "^0.73.7"
"@babel/core": "^7.20.0",
"@types/react": "~18.2.14",
"jest": "^29.2.1",
"jest-expo": "~49.0.0",
"react-test-renderer": "18.2.0",
"typescript": "^5.1.3"
},
"overrides": {
"metro": "^0.73.7",
"metro-resolver": "^0.73.7"
"react-refresh": "~0.14.0"
},
"resolutions": {
"react-refresh": "~0.14.0"
},
"private": true
}

12
tsconfig.json Normal file
View file

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