Skip to content

Commit

Permalink
feat: mobile app architecture and initial screens (#2144)
Browse files Browse the repository at this point in the history
* feat: initialize mobile app with Expo setup and configuration

* chore: update deps

* feat: update layout and integrate WebView for follow

* chore: update lock

* chore: lint

* chore: lock file

* feat: login with deeplink

* feat: auth

* feat: add Expo development script and refactor mobile app configuration

- Added a new development script for Expo in package.json.
- Refactored the app.config.ts to configure expo-router with a specified root.
- Removed unused files: _layout.tsx, auth.tsx, and index.tsx from the mobile app directory, streamlining the codebase.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: update dependencies and enhance mobile app configuration

- Added new dependencies: nativewind, swiftui-react-native, and tailwindcss to improve styling capabilities.
- Updated react-native-reanimated version to 3.16.5 for better performance.
- Refactored tailwind configuration to use baseTwConfig for consistency across applications.
- Enhanced mobile layout with color scheme toggle functionality and improved button styling.
- Included type definitions for nativewind in shim-env.d.ts.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: streamline color configuration and enhance authentication UI

- Updated tailwind configuration to simplify color definitions, removing unnecessary color mappings and using CSS variables for palette colors.
- Refactored authentication screen to utilize new color scheme and improved styling for better user experience.
- Introduced a function to retrieve current colors based on the system theme, enhancing dynamic styling capabilities.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: add tab

- Refactored app.config.ts to use resolved paths for icon assets, improving path management.
- Enhanced RootLayout component by adding additional Stack.Screen elements for better navigation structure.
- Removed unused authentication and index screens to streamline the codebase and improve maintainability.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: add new icons and update mobile app configuration

- Introduced multiple new icon components for enhanced UI representation in the mobile app.
- Updated package.json and pnpm-lock.yaml to include new dependencies and ensure proper package management.
- Refactored mobile screens (_layout.tsx, home.tsx, auth.tsx) for improved structure and navigation.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: init debug screen

- Added a new Link component in RootLayout for debugging purposes, improving navigation capabilities.
- Adjusted the position of the existing button in RootLayout to enhance UI layout.
- Refactored HeadlessLayout to ensure proper closing of Stack component.
- Updated home screen to include Link and removed unused components for cleaner code.

Signed-off-by: Innei <tukon479@gmail.com>
Signed-off-by: Innei <i@innei.in>

* feat: app route layer

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance mobile app layout and navigation

- Updated RootLayout to include a new Stack.Screen for "Add Subscription" with customized header styles.
- Refactored TabLayout to improve tab bar styling and adjusted icon sizes for better visual consistency.
- Replaced List component with ScrollView in FeedList, adding header actions for editing and navigation to the add screen.
- Introduced accentColor in the theme for consistent color usage across components.

Signed-off-by: Innei <tukon479@gmail.com>

* fix: navigation theme

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: update layout components and streamline navigation

- Removed unused headerTintColor from AppRootLayout for cleaner code.
- Simplified TabLayout by removing unnecessary screenOptions, enhancing readability.
- Updated RootLayout to import navigation themes from local theme file, improving theme management.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: update dependencies and refactor mobile app components

- Added new dependencies: @follow/constants, jotai, and zustand to enhance state management and component functionality.
- Updated package.json and pnpm-lock.yaml to reflect new dependencies and their versions.
- Removed the Logo component to streamline the codebase.
- Refactored FeedList and TabLayout components to improve layout and navigation, including the addition of themed blur views for better UI consistency.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: integrate React Native Bottom Tabs

* refactor: use native bottom tab

* chore: jsx preserve for ts config

* Revert "refactor: use native bottom tab"

This reverts commit e937047.

* feat: enhance tab bar icons in TabLayout

- Updated TabLayout to use different icons based on tab focus state, improving user experience.
- Introduced SafariCuteFi and Setting7CuteFi icons for the "Discover" and "Settings" tabs, respectively.
- Adjusted icon sizes for better visual consistency across the tab bar.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: add withFollowAssets plugin for managing asset resources

* feat: add FollowWebView component

* chore: set base path to current directory in vite config

* refactor: rename withFollowAssets.js to with-follow-assets.js and add error handling for missing assets directory

* feat: debug for webview

Signed-off-by: Innei <tukon479@gmail.com>

* chore(lint): correct tailwind config for mobile

* fix: share cookie with webview

* fix: redirect to home for webview

* fix: bring cookie inject back

* feat: init db

Signed-off-by: Innei <tukon479@gmail.com>

* fix: inject js

* fix: add shared env

* feat: useAuthCookie

* fix: save token

* chore: update icon

* chore: add note

* feat: init auth client

* feat: simple auth flow

* refactor: use cookie-es

* chore: remove unstable_enablePackageExports

* chore: remove auth page

* chore: update dependencies and refactor storage management

- Added '@follow/shared' package to pnpm-lock and package.json.
- Updated 'hono' and 'ofetch' dependencies in package.json.
- Removed 'react-native-mmkv' and its related storage implementation.
- Refactored layout to use 'RootProviders' for better context management.
- Updated API fetch headers to include application name.
- Changed '@electron/node-gyp' resolution method to use git URL.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update dependencies and add subscriptions schema

- Added 'immer' dependency to package.json and pnpm-lock.yaml.
- Updated '@electron/node-gyp' resolution method to use tarball URL.
- Introduced 'subscriptionsTable' schema in the database for managing user subscriptions.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: remove unused config

* chore: remove unused code

* chore: signout for debug

* refactor: use kv as auth storage

* chore: remove expo-secure-store, see better-auth/better-auth#928

* fix: logout from native

* feat: react-hook-form

* feat: simple ui

* chore: auto-fix linting and formatting issues

* feat: sn pro font

* chore: auto-fix linting and formatting issues

* feat: enhance database schema and API error handling; improve feed list functionality

* feat: update ThemedBlurView and enhance feed list with new subscription handling

Signed-off-by: Innei <tukon479@gmail.com>

* chore: remove login url env

* feat: implement navigation handling in FollowWebView

* feat: make social login work

* chore: update

* feat: update environment variables, add dayjs dependency, enhance database schema integration, and improve subscription handling with transaction support

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance tab layout and feed list with improved ThemedBlurView integration and dynamic tab height adjustment

- Updated tab bar background and style in TabLayout for better visual consistency.
- Integrated useBottomTabBarHeight in FeedList to dynamically adjust layout based on tab height.
- Enhanced SubscriptionList header background with ThemedBlurView for improved aesthetics.
- Added styles for tab container to maintain consistent appearance across screens.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: move video URL handling to utils

* feat: integrate utility functions for URL handling in FollowWebView

* chore: update lock

* fix: workaround potential null value in remoteSettings.updated

* feat: enhance FeedList layout with dynamic header and tab height adjustments

- Integrated useHeaderHeight to dynamically adjust the ScrollView's content inset based on the header height.
- Updated scrollIndicatorInsets to improve scrolling experience by accounting for safe area insets.
- Ensured consistent layout adjustments for better visual alignment with the tab bar.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update dependencies and configure babel-plugin-module-resolver

- Added babel-plugin-module-resolver version 5.0.2 to package.json for improved module resolution.
- Configured babel.config.js to use module-resolver with custom alias for es-toolkit.
- Updated pnpm-lock.yaml to reflect new dependencies and their resolutions.
- Refactored import statement in utils.ts to use the updated es-toolkit import path.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance database integration and add SQL support

- Added support for SQL file imports in the mobile app by configuring babel-plugin-inline-import and updating metro.config.js to recognize .sql file extensions.
- Introduced new database migrations for improved data management, including the addition of a new migration file.
- Updated the drizzle migration logic to include the new migration.
- Enhanced the database initialization process to support the new subscription service.
- Refactored the hydrate function to streamline database hydration and improve performance.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance database functionality

- Added expo-clipboard and expo-file-system dependencies to the mobile app for improved file handling and clipboard functionality.
- Implemented a new function to retrieve the SQLite database path using expo-file-system.
- Enhanced the DebugPanel to include options for clearing SQLite data and copying the database file location to the clipboard.
- Updated pnpm-lock.yaml and package.json to reflect the new dependencies and their versions.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: implement session token management and enhance DebugPanel

- Removed unused session token handling from apiFetch.
- Updated cookie management functions to include synchronous storage with kv for session tokens.
- Added functionality to get and set session tokens in the DebugPanel, allowing users to view and save session tokens.
- Improved user interface in DebugPanel for better session token management.

Signed-off-by: Innei <tukon479@gmail.com>

* fix: handle keyboard

* feat: enhance layout and subscription service functionality

- Added BugCuteReIcon to the RootLayout for improved user interface.
- Updated the upsertMany method in SubscriptionService to handle conflicts during database insertions, ensuring data integrity by using SQL's onConflictDoUpdate.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: update FeedList component with improved pressable interactions and remove unused code

- Deleted unused .gitkeep file in mobile modules directory.
- Enhanced SubscriptionItem to use Pressable for better user interaction feedback.
- Removed redundant text displays for subscription IDs and current view in SubscriptionList.
- Added state management for press interactions to visually indicate button presses.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: reduce bundle size

Signed-off-by: Innei <tukon479@gmail.com>

* fix: cookie

* fix: cookie name

* fix: update iOS URI for FollowWebView

* chore: eas link

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update @better-auth/expo

* chore: format

* chore: fix can not click debug button

* chore: add expo-drizzle-studio-plugin

* chore: turn off typechecked rules in eslint

* chore: pan debug button

Signed-off-by: Innei <tukon479@gmail.com>

* fix: dark mode in rn webview

* chore: update

* fix: detect safari in webview

* fix: try fix db init

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: adjust layout and improve tab view in FeedList component

- Reduced bottom view tab height from 45 to 35.
- Updated ScrollView content insets for better layout.
- Replaced static tab view with a horizontally scrollable tab view.
- Enhanced tab item styling for better visual feedback on selection.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: simplify FeedList component by removing unused code and optimizing imports

- Removed unused imports and components to streamline the FeedList.
- Consolidated the tab view logic and improved the overall structure.
- Enhanced readability by eliminating redundant code and simplifying the component's layout.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: enhance subscription sorting in useSubscriptionByView hook

- Updated useSubscriptionByView to accept a sorting parameter, defaulting to "alphabet".
- Implemented sorting logic for subscription IDs based on alphabetical order.
- Introduced a new helper function, sortByAlphabet, to compare subscriptions by title.
- Improved the overall functionality of the subscription list in the FeedList component.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: data schemas and improve feed and subscription handling

- Renamed FeedModel to FeedSchema and SubscriptionModel to SubscriptionSchema for consistency.
- Introduced new InboxSchema and ListSchema to enhance data structure.
- Updated FeedService and SubscriptionService to utilize the new schemas.
- Refactored the FeedList component to support grouped and ungrouped subscriptions.
- Removed unused Morph class and related types to clean up the codebase.
- Enhanced sorting logic for subscriptions in the useSubscriptionByView hook.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* fix: enhance FeedIcon styling for dark mode compatibility

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* feat: enhance FeedList component with animated accordion for grouped subscriptions

- Introduced animated accordion functionality in the CategoryGrouped component to improve user experience when viewing grouped subscriptions.
- Replaced static toggle with AnimatedTouchableOpacity for better visual feedback.
- Updated the layout and styling of the CategoryGrouped component for improved aesthetics.
- Adjusted ScrollView in FeedList to include right scroll indicator insets for better layout.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* refactor: update database schema and migration files

- Removed obsolete SQL migration files for `bitter_bloodstrike` and `ancient_dexter_bennett`.
- Updated migration scripts to reflect new table structures and relationships.
- Enhanced `migrations.js` to import new migration files.
- Adjusted `_journal.json` and snapshot files to align with the new schema.
- Added error handling and logging in migration processes.
- Improved database initialization with logging capabilities.
- Refactored subscription handling in the store to accommodate new schema changes.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* feat: enhance FeedList component with ItemPressable for improved interaction

- Replaced static Pressable components with ItemPressable in CategoryGrouped and SubscriptionItem for better touch handling.
- Updated the layout of CategoryGrouped to include a pressable area for category navigation.
- Added a new utility function, composeEventHandlers, to facilitate event handling in the utils package.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* refactor: restructure FeedIcon and enhance list handling in FeedList component

- Removed the FeedIcon component to streamline icon handling.
- Updated FeedList component to include a new ListList section for displaying lists.
- Introduced ListSubscriptionItem for rendering individual list items with fallback support for missing images.
- Enhanced state management in the list store to utilize a record structure for lists and list IDs.
- Improved subscription handling by adding list subscriptions to the subscription store.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* feat: enhance FeedList and ViewTab components with new features and styling improvements

- Added a new StarItem component to the FeedList for collections navigation.
- Updated ListList and SubscriptionItem components for improved layout and spacing.
- Enhanced ViewTab with increased horizontal padding and a bottom border for better visual separation.
- Adjusted icon sizes in ViewTab for consistency.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* feat: apple sign in, not work yet

* chore: bring type check lint back

* feat: enhance mobile app components and linting configuration

- Added a new ESLint rule for preventing leaked conditional rendering in React.
- Updated the initialization process in main.ts to ensure proper loading of the expo-router.
- Enhanced the FeedList component by integrating the HeaderBlur for improved header styling and added routing functionality in SubscriptionItem for better navigation.
- Modified the Add screen to include a Stack.Screen for improved navigation handling.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: enable no-inline-styles

* chore: update

* chore: auto-fix linting and formatting issues

* feat: enhance feed-list functionality with new components and dependencies

- Added react-native-pager-view for improved navigation between feed views.
- Introduced ViewPageCurrentViewContext for managing the current view state in the feed list.
- Updated SubscriptionList to utilize PagerView for dynamic content rendering.
- Enhanced ListList to use the new context for better state management.
- Refactored imports for consistency and clarity.

This update improves the user experience by allowing seamless transitions between different feed types.

* feat: improve ViewTab component with animated tab indicator and dynamic scrolling

- Added animated indicator for the currently selected tab, enhancing visual feedback.
- Implemented dynamic scrolling to the selected tab using ScrollView reference.
- Introduced state management for tab widths and positions to support the animation.
- Updated tab rendering to capture layout dimensions for improved responsiveness.

This update enhances the user experience by providing a smoother and more interactive tab navigation.

Signed-off-by: Innei <tukon479@gmail.com>

* fix: lockfile

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: video URL transformation

* fix: web dev

* chore: add URL linking functionality to Add screen

* chore: expo update config

* feat: enhance feed-list and configuration with new features and optimizations

- Updated app configuration to support dark mode for splash screen background.
- Refactored feed-list components to utilize Jotai for state management, improving performance and readability.
- Introduced new hooks for managing current view state, enhancing the user experience.
- Implemented animated tab indicators and dynamic scrolling in ViewTab for better navigation feedback.
- Cleaned up imports and improved overall code structure for maintainability.

These changes collectively enhance the functionality and user experience of the feed-list feature in the mobile app.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* feat: integrate gesture handling and state management for feed view

- Added Jotai state management for current feed view, allowing dynamic updates.
- Implemented double-tap gesture to switch to the Articles view, enhancing user interaction.
- Wrapped the main provider in GestureHandlerRootView to support gesture handling.
- Updated tab layout to utilize gesture detection for improved navigation experience.

These changes collectively enhance the functionality and interactivity of the feed-list feature in the mobile app.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update prepare script

* chore: prepare for rn web build

* feat: add inbox management and improve list handling in feed view

- Introduced InboxList and InboxItem components to display inboxes within the Articles view.
- Enhanced state management by implementing useInboxSubscription for fetching inbox data.
- Updated ListService and SubscriptionService to use upsertManyInSession for improved session handling.
- Refactored inbox store to utilize createZustandStore for better state management.
- Added inboxIdByView to SubscriptionState for managing inbox subscriptions by view type.

These changes collectively enhance the feed-list feature by integrating inbox management, improving data handling, and optimizing state management in the mobile app.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: auto-fix linting and formatting issues

* feat: enhance mobile app with new context menu and unread management

- Added `react-native-context-menu-view` version 1.16.0 to support context menus in the mobile app.
- Implemented new `unread` table schema to track unread counts for subscriptions.
- Updated `FeedList` and `ViewTab` components to display unread counts dynamically.
- Refactored inbox management to improve session handling with `upsertManyInSession`.
- Enhanced state management by integrating unread counts into subscription hooks.

These changes collectively improve user experience by providing context menus and better unread message tracking in the mobile application.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: integrate context menu and enhance unread management in feed list

- Added ContextMenu component to ViewTab for marking all items as read.
- Updated FeedList and ViewTab components to utilize context menus for improved user interaction.
- Enhanced unread management by implementing markViewAsRead functionality in UnreadSyncService.
- Refactored subscription getters and hooks to streamline data retrieval by view type.

These changes collectively improve user experience by providing context menus for actions and better management of unread items in the mobile application.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance feed list with swipeable actions and performance improvements

- Integrated swipeable functionality in SubscriptionItem for better user interaction, allowing users to unsubscribe or read items directly.
- Refactored styles for accordion icons to improve layout consistency.
- Optimized animated styles in ViewTab for smoother transitions and reduced performance issues.
- Consolidated spring configuration for animation to enhance maintainability.

These changes collectively improve the user experience by providing intuitive swipe actions and enhancing the performance of the feed list in the mobile application.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: proxy creation to use evalCode for improved reusability

* refactor: update Add screen to use router for navigation and handle deep linking

* feat: implement deep linking support and refactor navigation handling in FollowWebView

* fix: use hash router for rn web

* chore: fill submit info

* chore: autoIncrement version

* fix: remove unnecessary width class to prevent unexpected scrolling

* feat: improve login page ui

* fix: disable state

* refactor: enhance ViewTab layout and header background in FeedList

Signed-off-by: Innei <tukon479@gmail.com>

* feat: integrate react-native-reanimated and enhance feed list functionality

- Added react-native-reanimated plugin to Babel configuration for improved animation support.
- Updated metro configuration to wrap with reanimated settings.
- Refactored AccordionItem to use withTiming for smoother animations.
- Introduced JotaiPersistSyncStorage for persistent state management in feed list atoms.
- Enhanced SubscriptionList to utilize FlashList for better performance and rendering.
- Implemented sorting functionality in feed list with atom hooks for sort method and order.
- Improved ViewTab component to handle tab scrolling more effectively.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance feed list and debug panel functionality

- Added color scheme support in InboxItem for dynamic icon coloring based on theme.
- Updated FlashList padding to improve layout consistency.
- Introduced a new "Reload App" button in the DebugPanel for easier app reloading.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: sort

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance ItemPressable and refactor feed list interaction

Signed-off-by: Innei <tukon479@gmail.com>

* fix: padding safe for webview

* chore: update FollowWebView background style

* fix: enable hoverOnlyWhenSupported for rn web build

* feat: subscription management ctx menu

- Added '@follow/hooks' and 'usehooks-ts' as workspace dependencies in pnpm-lock.yaml and package.json.
- Refactored AccordionItem to use withSpring for improved animation performance.
- Introduced SubscriptionItemContextMenu for better context menu handling in feed list.
- Updated subscription model to handle 'isPrivate' as a boolean.
- Enhanced subscription store with new utility functions for managing subscription IDs and added patch functionality.
- Improved reset functionality in subscription store to clear state by view.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: update API URL handling and enhance subscription management

- Replaced direct usage of process.env.EXPO_PUBLIC_API_URL with a new getApiUrl() function across multiple files for improved maintainability.
- Updated SubscriptionItemContextMenu to SubscriptionFeedItemContextMenu for better clarity in context menu handling.
- Implemented a delete method in SubscriptionService to handle subscription removals and associated cleanup for feeds, lists, and inboxes.
- Enhanced the unsubscribe functionality in SubscriptionSyncService to ensure proper state management during subscription deletions.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: user management features and list and category ctx menu

- Added a new migration script (m0004) for "majestic_thunderbolt_ross" to the SQLite migrations.
- Updated the journal JSON to include the new migration entry.
- Introduced a new users table schema to manage user data, including fields for id, email, handle, name, image, and isMe.
- Refactored context menu actions in feeds to improve clarity and functionality.
- Removed deprecated feed list components and consolidated related logic for better maintainability.
- Updated RootProviders to ensure proper context management across the application.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance Add screen and layout for better user experience

- Updated the AppRootLayout to include modal presentation for the "Add Subscription" screen.
- Refactored the Add screen to improve navigation and user interaction, including a new header with close and search icons.
- Introduced a state for managing the feed URL input, enhancing the user interface with appropriate styles and functionality.
- Added new color handling in the theme to support disabled states and improve accessibility.

Signed-off-by: Innei <tukon479@gmail.com>

* style: update input field styling in Add screen for improved dark mode support

- Modified the className of the URL input field in the Add screen to enhance its appearance in dark mode, ensuring better visibility and user experience.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: update mobile app configuration and enhance subscription list interaction

- Added application category type to the iOS infoPlist for better app classification.
- Increased hitSlop on the AnimatedTouchableOpacity in the subscription list for improved touch responsiveness.
- Un-commented the DebugButton in the layout to ensure it is always visible for debugging purposes.

These changes aim to enhance the user experience and improve app visibility in app stores.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
Signed-off-by: Innei <i@innei.in>
Co-authored-by: lawvs <18554747+lawvs@users.noreply.github.com>
Co-authored-by: Innei <tukon479@gmail.com>
Co-authored-by: Innei <i@innei.in>
Co-authored-by: hyoban <hyoban@users.noreply.github.com>
Co-authored-by: Innei <Innei@users.noreply.github.com>
  • Loading branch information
6 people authored Dec 25, 2024
1 parent 8dbd700 commit 4b6a0fc
Show file tree
Hide file tree
Showing 317 changed files with 18,524 additions and 348 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ VITE_BUILD_TYPE=production
VITE_INBOXES_EMAIL=@follow.re
VITE_OPENPANEL_CLIENT_ID=
VITE_OPENPANEL_API_URL=

EXPO_PUBLIC_API_URL=https://api.follow.is
EXPO_PUBLIC_OPENPANEL_CLIENT_ID=
EXPO_PUBLIC_OPENPANEL_API_URL=
18 changes: 2 additions & 16 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
["[a-zA-Z]+[cC]lass[nN]ame[\"'`]?:\\s*[\"'`]([^\"'`]*)[\"'`]", "([^\"'`]*)"],
["[a-zA-Z]+[cC]lass[nN]ame\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]", "([^\"'`]*)"]
],
"typescript.tsserver.maxTsServerMemory": 8096,
"typescript.tsserver.nodePath": "node",
// If you do not want to autofix some rules on save
// You can put this in your user settings or workspace settings
"eslint.codeActionsOnSave.rules": [
Expand Down Expand Up @@ -54,22 +56,6 @@
{
"rule": "unused-imports/no-unused-imports",
"severity": "off"
},
{
"rule": "@typescript-eslint/require-await",
"severity": "info"
},
{
"rule": "@typescript-eslint/await-thenable",
"severity": "info"
},
{
"rule": "@typescript-eslint/no-floating-promises",
"severity": "info"
},
{
"rule": "@typescript-eslint/no-misused-promises",
"severity": "info"
}
],
"cSpell.words": ["Hydable", "rsshub", "Русский"],
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/.env
50 changes: 50 additions & 0 deletions apps/mobile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Welcome to your Expo app 👋

This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).

## Get started

1. Install dependencies

```bash
npm install
```

2. Start the app

```bash
npx expo start
```

In the output, you'll find options to open the app in a

- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo

You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).

## Get a fresh project

When you're ready, run:

```bash
npm run reset-project
```

This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.

## Learn more

To learn more about developing your project with Expo, look at the following resources:

- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.

## Join the community

Join our community of developers creating universal apps.

- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
97 changes: 97 additions & 0 deletions apps/mobile/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { resolve } from "node:path"

import type { ConfigContext, ExpoConfig } from "expo/config"

// const roundedIconPath = resolve(__dirname, "../../resources/icon.png")
const iconPath = resolve(__dirname, "./assets/icon.png")
const adaptiveIconPath = resolve(__dirname, "./assets/adaptive-icon.png")

export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
extra: {
eas: {
projectId: "a6335b14-fb84-45aa-ba80-6f6ab8926920",
},
},
owner: "follow",
updates: {
url: "https://u.expo.dev/a6335b14-fb84-45aa-ba80-6f6ab8926920",
},
runtimeVersion: {
policy: "appVersion",
},

name: "Follow",
slug: "follow",
version: "1.0.0",
orientation: "portrait",
icon: iconPath,
scheme: "follow",
userInterfaceStyle: "automatic",
newArchEnabled: true,
ios: {
supportsTablet: true,
bundleIdentifier: "is.follow",
usesAppleSignIn: true,
infoPlist: {
LSApplicationCategoryType: "public.app-category.news",
},
},
android: {
package: "is.follow",
adaptiveIcon: {
foregroundImage: adaptiveIconPath,
backgroundColor: "#FF5C00",
},
},
web: {
bundler: "metro",
output: "static",
favicon: iconPath,
},
plugins: [
[
"expo-router",
{
root: "./src/screens",
},
],
[
"expo-splash-screen",
{
backgroundColor: "#ffffff",
dark: {
backgroundColor: "#000000",
},
},
],
[
"expo-font",
{
fonts: [
"./assets/font/sn-pro/SNPro-Black.otf",
"./assets/font/sn-pro/SNPro-BlackItalic.otf",
"./assets/font/sn-pro/SNPro-Bold.otf",
"./assets/font/sn-pro/SNPro-BoldItalic.otf",
"./assets/font/sn-pro/SNPro-Heavy.otf",
"./assets/font/sn-pro/SNPro-HeavyItalic.otf",
"./assets/font/sn-pro/SNPro-Light.otf",
"./assets/font/sn-pro/SNPro-LightItalic.otf",
"./assets/font/sn-pro/SNPro-Medium.otf",
"./assets/font/sn-pro/SNPro-MediumItalic.otf",
"./assets/font/sn-pro/SNPro-Regular.otf",
"./assets/font/sn-pro/SNPro-RegularItalic.otf",
"./assets/font/sn-pro/SNPro-Semibold.otf",
"./assets/font/sn-pro/SNPro-SemiboldItalic.otf",
"./assets/font/sn-pro/SNPro-Thin.otf",
"./assets/font/sn-pro/SNPro-ThinItalic.otf",
],
},
],
"expo-apple-authentication",
[require("./scripts/with-follow-assets.js")],
],
experiments: {
typedRoutes: true,
},
})
Binary file added apps/mobile/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Black.otf
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Bold.otf
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Book.otf
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Heavy.otf
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Light.otf
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Medium.otf
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Regular.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/font/sn-pro/SNPro-Thin.otf
Binary file not shown.
Binary file not shown.
Binary file added apps/mobile/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions apps/mobile/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require("node:path")

module.exports = function (api) {
api.cache(true)
return {
presets: [["babel-preset-expo", { jsxImportSource: "nativewind" }], "nativewind/babel"],
plugins: [
["inline-import", { extensions: [".sql"] }],
[
"module-resolver",
{
alias: {
"es-toolkit": path.resolve(__dirname, "../../node_modules/es-toolkit/dist/index.js"),
},
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
],
"react-native-reanimated/plugin",
],
}
}
8 changes: 8 additions & 0 deletions apps/mobile/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "drizzle-kit"

export default defineConfig({
dialect: "sqlite",
driver: "expo",
schema: "./src/database/schemas/index.ts",
out: "./drizzle",
})
43 changes: 43 additions & 0 deletions apps/mobile/drizzle/0000_harsh_shiva.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
CREATE TABLE `feeds` (
`id` text PRIMARY KEY NOT NULL,
`title` text,
`url` text NOT NULL,
`description` text,
`image` text,
`error_at` text,
`site_url` text,
`owner_user_id` text,
`error_message` text
);
--> statement-breakpoint
CREATE TABLE `inboxes` (
`id` text PRIMARY KEY NOT NULL,
`user_id` text NOT NULL,
`title` text
);
--> statement-breakpoint
CREATE TABLE `lists` (
`id` text PRIMARY KEY NOT NULL,
`user_id` text NOT NULL,
`title` text NOT NULL,
`feed_ids` text,
`description` text,
`view` integer NOT NULL,
`image` text,
`fee` integer,
`owner_user_id` text
);
--> statement-breakpoint
CREATE TABLE `subscriptions` (
`feed_id` text,
`list_id` text,
`inbox_id` text,
`user_id` text NOT NULL,
`view` integer NOT NULL,
`is_private` integer NOT NULL,
`title` text,
`category` text,
`created_at` text,
`type` text NOT NULL,
`id` text PRIMARY KEY NOT NULL
);
1 change: 1 addition & 0 deletions apps/mobile/drizzle/0001_bored_hobgoblin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `inboxes` DROP COLUMN `user_id`;
5 changes: 5 additions & 0 deletions apps/mobile/drizzle/0002_smart_power_man.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE `unread` (
`id` text PRIMARY KEY NOT NULL,
`subscription_id` text NOT NULL,
`count` integer NOT NULL
);
10 changes: 10 additions & 0 deletions apps/mobile/drizzle/0003_known_roland_deschain.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_unread` (
`subscription_id` text PRIMARY KEY NOT NULL,
`count` integer NOT NULL
);
--> statement-breakpoint
INSERT INTO `__new_unread`("subscription_id", "count") SELECT "subscription_id", "count" FROM `unread`;--> statement-breakpoint
DROP TABLE `unread`;--> statement-breakpoint
ALTER TABLE `__new_unread` RENAME TO `unread`;--> statement-breakpoint
PRAGMA foreign_keys=ON;
8 changes: 8 additions & 0 deletions apps/mobile/drizzle/0004_majestic_thunderbolt_ross.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE `users` (
`id` text PRIMARY KEY NOT NULL,
`email` text NOT NULL,
`handle` text,
`name` text,
`image` text,
`is_me` integer NOT NULL
);
Loading

0 comments on commit 4b6a0fc

Please sign in to comment.