Skip to content

Commit

Permalink
Updates project structure and adds news page (neuland-ingolstadt#57)
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp Opheys <[email protected]>
  • Loading branch information
Robert27 and BuildmodeOne committed Nov 15, 2023
1 parent 416fb31 commit b377201
Show file tree
Hide file tree
Showing 99 changed files with 784 additions and 402 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![CI](https://github.com/neuland-ingolstadt/neuland.app-native/actions/workflows/lint.yml/badge.svg)](https://github.com/neuland-ingolstadt/neuland.app-native/actions/workflows/lint.yml)
[![update](https://github.com/neuland-ingolstadt/neuland.app-native/actions/workflows/update.yml/badge.svg)](https://github.com/neuland-ingolstadt/neuland.app-native/actions/workflows/update.yml)

# neuland.app - native
# Neuland Next - native version of neuland.app

An open source, mobile app developed using React Native and Expo, serving as a replacement for the official Technische Hochschule Ingolstadt (THI) app.
It features a modern user interface and utilizes the Expo framework for easy development and deployment.
Expand Down
2 changes: 1 addition & 1 deletion app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
android: {
package: 'app.neuland',
userInterfaceStyle: 'automatic',
versionCode: 45,
versionCode: 46,
},
extra: {
eas: {
Expand Down
1 change: 0 additions & 1 deletion app/javascript/locales.json

This file was deleted.

199 changes: 100 additions & 99 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,101 +1,102 @@
{
"version": "0.4.2",
"name": "neuland",
"main": "expo-router/entry",
"homepage": "https://github.com/neuland-ingolstadt/neuland.app-native",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"start": "expo start -c",
"tunnel": "expo start -c --tunnel",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"build:android": "eas build --platform android --local",
"build:ios": "expo prebuild --platform ios && xcodebuild archive -workspace ios/NeulandNext.xcworkspace -scheme NeulandNext",
"build:all": "yarn build:ios && yarn build:android",
"format": "prettier --write .",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"postinstall": "husky install"
},
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-native-community/datetimepicker": "7.2.0",
"@react-navigation/native-stack": "6.9.13",
"@types/color": "^3.0.5",
"color": "^4.2.3",
"expo": "^49.0.16",
"expo-blur": "~12.4.1",
"expo-clipboard": "~4.3.0",
"expo-constants": "~14.4.2",
"expo-haptics": "~12.4.0",
"expo-linear-gradient": "~12.3.0",
"expo-linking": "~5.0.2",
"expo-local-authentication": "~13.4.1",
"expo-localization": "~14.3.0",
"expo-router": "^3.1.2",
"expo-secure-store": "~12.3.1",
"expo-sharing": "11.7.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "^1.6.0",
"i18next": "^23.6.0",
"moment": "^2.29.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "^13.3.1",
"react-native": "0.72.6",
"react-native-big-calendar": "^4.7.0",
"react-native-collapsible": "^1.6.1",
"react-native-draggable-flatlist": "^4.0.1",
"react-native-gesture-handler": "~2.12.0",
"react-native-maps": "1.7.1",
"react-native-onboarding-swiper": "https://github.com/neuland-ingolstadt/react-native-onboarding-swiper.git",
"react-native-reanimated": "3.3.0",
"react-native-root-toast": "^3.4.1",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-select-dropdown": "^3.3.4",
"react-native-shimmer-placeholder": "^2.0.9",
"react-native-svg": "^13.14.0",
"react-native-view-shot": "^3.8.0",
"react-native-webview": "13.2.2",
"sanitize-html": "^2.11.0"
},
"devDependencies": {
"@babel/core": "^7.0.0-0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0-0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0-0",
"@babel/plugin-transform-arrow-functions": "^7.0.0-0",
"@babel/plugin-transform-shorthand-properties": "^7.0.0-0",
"@babel/plugin-transform-template-literals": "^7.0.0-0",
"@expo/ngrok": "^4.1.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.1",
"@types/react": "~18.2.14",
"@types/sanitize-html": "^2",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.10.0",
"babel-plugin-formatjs": "^10.5.7",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard-with-typescript": "^39.1.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.3.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "latest",
"eslint-plugin-react-native": "^4.1.0",
"husky": "^8.0.3",
"lint-staged": ">=15",
"prettier": "3.0.3",
"typescript": "^5.2.2"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,json,yml}": [
"npx prettier --write"
],
"*.{js,jsx,ts,tsx}": [
"npx eslint --fix"
]
}
"version": "0.4.3",
"name": "neuland",
"main": "expo-router/entry",
"homepage": "https://github.com/neuland-ingolstadt/neuland.app-native",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"start": "expo start -c",
"tunnel": "expo start -c --tunnel",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"build:android": "eas build --platform android --local",
"build:ios": "expo prebuild --platform ios && xcodebuild archive -workspace ios/NeulandNext.xcworkspace -scheme NeulandNext",
"build:all": "yarn build:ios && yarn build:android",
"format": "prettier --write .",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"postinstall": "husky install"
},
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-native-community/datetimepicker": "7.2.0",
"@react-navigation/native-stack": "6.9.13",
"@types/color": "^3.0.5",
"color": "^4.2.3",
"expo": "^49.0.16",
"expo-blur": "~12.4.1",
"expo-clipboard": "~4.3.0",
"expo-constants": "~14.4.2",
"expo-haptics": "~12.4.0",
"expo-linear-gradient": "~12.3.0",
"expo-linking": "~5.0.2",
"expo-local-authentication": "~13.4.1",
"expo-localization": "~14.3.0",
"expo-router": "^3.1.2",
"expo-secure-store": "~12.3.1",
"expo-sharing": "11.7.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "^1.6.0",
"expo-updates": "~0.18.17",
"i18next": "^23.6.0",
"moment": "^2.29.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "^13.3.1",
"react-native": "0.72.6",
"react-native-big-calendar": "^4.7.0",
"react-native-collapsible": "^1.6.1",
"react-native-draggable-flatlist": "^4.0.1",
"react-native-gesture-handler": "~2.12.0",
"react-native-maps": "1.7.1",
"react-native-onboarding-swiper": "https://github.com/neuland-ingolstadt/react-native-onboarding-swiper.git",
"react-native-reanimated": "3.3.0",
"react-native-root-toast": "^3.4.1",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-select-dropdown": "^3.3.4",
"react-native-shimmer-placeholder": "^2.0.9",
"react-native-svg": "^13.14.0",
"react-native-view-shot": "^3.8.0",
"react-native-webview": "13.2.2",
"sanitize-html": "^2.11.0"
},
"devDependencies": {
"@babel/core": "^7.0.0-0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0-0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0-0",
"@babel/plugin-transform-arrow-functions": "^7.0.0-0",
"@babel/plugin-transform-shorthand-properties": "^7.0.0-0",
"@babel/plugin-transform-template-literals": "^7.0.0-0",
"@expo/ngrok": "^4.1.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.1",
"@types/react": "~18.2.14",
"@types/sanitize-html": "^2",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.10.0",
"babel-plugin-formatjs": "^10.5.7",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard-with-typescript": "^39.1.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.3.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "latest",
"eslint-plugin-react-native": "^4.1.0",
"husky": "^8.0.3",
"lint-staged": ">=15",
"prettier": "3.0.3",
"typescript": "^5.2.2"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,json,yml}": [
"npx prettier --write"
],
"*.{js,jsx,ts,tsx}": [
"npx eslint --fix"
]
}
}
2 changes: 1 addition & 1 deletion src/api/asset-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LocalStorageCache from '@/api/cache'
import { type RoomDistances, type SpoWeights } from '@customTypes/asset-api'
import { type RoomDistances, type SpoWeights } from '@/types/asset-api'

import packageInfo from '../../package.json'

Expand Down
11 changes: 6 additions & 5 deletions src/api/authenticated-api.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import courseShortNames from '@/data/course-short-names.json'
import { type CourseShortNames } from '@/stores/types/data'
import { type CourseShortNames } from '@/types/data'
import {
type Exams,
type Grade,
type Lecturers,
type PersData,
type Rooms,
type ThiNews,
type TimetableResponse,
} from '@/stores/types/thi-api'
} from '@/types/thi-api'

import { APIError, AnonymousAPIClient } from './anonymous-api'
import { callWithSession } from './thi-session-handler'
Expand Down Expand Up @@ -425,16 +426,16 @@ export class AuthenticatedAPIClient extends AnonymousAPIClient {

/**
* Fetches the latest thi news
* @returns {Promise<object[]>} Promise that resolves with the news
* @returns {Promise<ThiNews[]>} Promise that resolves with the news
*/
async getThiNews(): Promise<object[]> {
async getThiNews(): Promise<ThiNews[]> {
const res = await this.requestAuthenticated({
service: 'thiapp',
method: 'thinews',
format: 'json',
})

return res[1]
return res
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/(flow)/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import EverythingSVG from '@/components/Elements/Flow/svgs/everything'
import LogoSVG from '@/components/Elements/Flow/svgs/logo'
import SecureSVG from '@/components/Elements/Flow/svgs/secure'
import LoginForm from '@/components/Elements/Universal/LoginForm'
import { type Colors } from '@/stores/colors'
import { type Colors } from '@/components/colors'
import { useTheme } from '@react-navigation/native'
import React, { useRef } from 'react'
import { useTranslation } from 'react-i18next'
Expand Down
6 changes: 3 additions & 3 deletions src/app/(flow)/whatsnew.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import WhatsNewBox from '@/components/Elements/Flow/WhatsnewBox'
import { type Colors } from '@/components/colors'
import { FlowContext } from '@/components/provider'
import changelogData from '@/data/changelog.json'
import { type LanguageKey } from '@/localization/i18n'
import { type Colors } from '@/stores/colors'
import { FlowContext } from '@/stores/provider'
import { type Changelog } from '@/types/data'
import { convertToMajorMinorPatch } from '@/utils/app-utils'
import { getContrastColor, getStatusBarStyle } from '@/utils/ui-utils'
import { type Changelog } from '@customTypes/data'
import { useTheme } from '@react-navigation/native'
import { router } from 'expo-router'
import { StatusBar } from 'expo-status-bar'
Expand Down
13 changes: 7 additions & 6 deletions src/app/(food)/details.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import FormList from '@/components/Elements/Universal/FormList'
import ShareButton from '@/components/Elements/Universal/ShareButton'
import { type Colors } from '@/components/colors'
import { FoodFilterContext, UserKindContext } from '@/components/provider'
import allergenMap from '@/data/allergens.json'
import flagMap from '@/data/mensa-flags.json'
import { type UserKindContextType } from '@/hooks/userKind'
import { type LanguageKey } from '@/localization/i18n'
import { type Colors } from '@/stores/colors'
import { type UserKindContextType } from '@/stores/hooks/userKind'
import { FoodFilterContext, UserKindContext } from '@/stores/provider'
import { type FormListSections } from '@/stores/types/components'
import { type Meal } from '@/stores/types/neuland-api'
import { type FormListSections } from '@/types/components'
import { type Meal } from '@/types/neuland-api'
import { formatPrice, mealName } from '@/utils/food-utils'
import { PAGE_PADDING } from '@/utils/style-utils'
import { getStatusBarStyle } from '@/utils/ui-utils'
import { useTheme } from '@react-navigation/native'
import { useLocalSearchParams } from 'expo-router'
Expand Down Expand Up @@ -257,7 +258,7 @@ const styles = StyleSheet.create({
marginVertical: 16,
width: '100%',
alignSelf: 'center',
paddingHorizontal: 16,
paddingHorizontal: PAGE_PADDING,
},
titleContainer: {
alignSelf: 'center',
Expand Down
9 changes: 5 additions & 4 deletions src/app/(food)/preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import FormList from '@/components/Elements/Universal/FormList'
import MultiSectionPicker from '@/components/Elements/Universal/MultiSectionPicker'
import SectionView from '@/components/Elements/Universal/SectionsView'
import SingleSectionPicker from '@/components/Elements/Universal/SingleSectionPicker'
import { type Colors } from '@/stores/colors'
import { FoodFilterContext } from '@/stores/provider'
import { type FormListSections } from '@customTypes/components'
import { type Colors } from '@/components/colors'
import { FoodFilterContext } from '@/components/provider'
import { type FormListSections } from '@/types/components'
import { PAGE_PADDING } from '@/utils/style-utils'
import { useTheme } from '@react-navigation/native'
import { useRouter } from 'expo-router'
import React, { useContext } from 'react'
Expand Down Expand Up @@ -122,7 +123,7 @@ const styles = StyleSheet.create({
marginBottom: 4,
},
sectionContainer: {
paddingHorizontal: 16,
paddingHorizontal: PAGE_PADDING,
width: '100%',
alignSelf: 'center',
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/(map)/advanced.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Divider from '@/components/Elements/Universal/Divider'
import Dropdown, {
DropdownButton,
} from '@/components/Elements/Universal/Dropdown'
import { type Colors } from '@/stores/colors'
import { type Colors } from '@/components/colors'
import { type AvailableRoom } from '@/types/utils'
import { formatISODate, formatISOTime } from '@/utils/date-utils'
import {
BUILDINGS,
Expand All @@ -16,7 +17,6 @@ import {
filterRooms,
getNextValidDate,
} from '@/utils/room-utils'
import { type AvailableRoom } from '@customTypes/utils'
import DateTimePicker from '@react-native-community/datetimepicker'
import { useTheme } from '@react-navigation/native'
import { useRouter } from 'expo-router'
Expand Down
Loading

0 comments on commit b377201

Please sign in to comment.