-
Notifications
You must be signed in to change notification settings - Fork 1
Scaffold ObjectStack Mobile runtime with Expo Router, NativeWind v4, and shadcn-style UI #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files | ||
|
|
||
| # dependencies | ||
| node_modules/ | ||
|
|
||
| # Expo | ||
| .expo/ | ||
| dist/ | ||
| web-build/ | ||
| expo-env.d.ts | ||
|
|
||
| # Native | ||
| .kotlin/ | ||
| *.orig.* | ||
| *.jks | ||
| *.p8 | ||
| *.p12 | ||
| *.key | ||
| *.mobileprovision | ||
|
|
||
| # Metro | ||
| .metro-health-check* | ||
|
|
||
| # debug | ||
| npm-debug.* | ||
| yarn-debug.* | ||
| yarn-error.* | ||
|
|
||
| # macOS | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # local env files | ||
| .env*.local | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
|
|
||
| # generated native folders | ||
| /ios | ||
| /android |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,50 @@ | ||
| # mobile | ||
| mobile app | ||
| # ObjectStack Mobile | ||
|
|
||
| Enterprise low-code platform mobile runtime built with Expo, React Native, and TypeScript. | ||
|
|
||
| ## Tech Stack | ||
|
|
||
| - **Framework:** Expo SDK 54 (Managed Workflow) | ||
| - **Navigation:** Expo Router (file-based routing) | ||
| - **Language:** TypeScript (strict mode) | ||
| - **Styling:** NativeWind v4 (Tailwind CSS for React Native) | ||
| - **UI Components:** shadcn/ui pattern (`components/ui/`) | ||
| - **Icons:** lucide-react-native | ||
| - **State Management:** Zustand | ||
| - **Data Fetching:** TanStack Query (React Query) | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| ├── app/ # Expo Router pages | ||
| │ ├── _layout.tsx # Root layout (providers) | ||
| │ └── (tabs)/ # Bottom tab navigation | ||
| │ ├── _layout.tsx # Tab bar configuration | ||
| │ ├── index.tsx # Home / Dashboard | ||
| │ ├── apps.tsx # Apps listing | ||
| │ ├── notifications.tsx | ||
| │ └── profile.tsx | ||
| ├── components/ | ||
| │ └── ui/ # Reusable UI components (shadcn pattern) | ||
| │ ├── Button.tsx | ||
| │ ├── Card.tsx | ||
| │ └── Input.tsx | ||
| ├── lib/ | ||
| │ └── utils.ts # cn() utility (clsx + tailwind-merge) | ||
| ├── global.css # Tailwind base + CSS variables (light/dark) | ||
| ├── tailwind.config.js # Tailwind configuration | ||
| ├── babel.config.js # Babel + NativeWind preset | ||
| ├── metro.config.js # Metro + NativeWind integration | ||
| └── nativewind-env.d.ts # NativeWind TypeScript types | ||
| ``` | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ```bash | ||
| npm install | ||
| npx expo start | ||
| ``` | ||
|
|
||
| ## Design System | ||
|
|
||
| The app uses a CSS-variable-based design token system with light and dark mode support. Color tokens are defined in `global.css` and consumed via Tailwind classes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "expo": { | ||
| "name": "ObjectStack Mobile", | ||
| "slug": "objectstack-mobile", | ||
| "version": "1.0.0", | ||
| "orientation": "portrait", | ||
| "icon": "./assets/icon.png", | ||
| "scheme": "objectstack", | ||
| "userInterfaceStyle": "automatic", | ||
| "newArchEnabled": true, | ||
| "splash": { | ||
| "image": "./assets/splash-icon.png", | ||
| "resizeMode": "contain", | ||
| "backgroundColor": "#ffffff" | ||
| }, | ||
| "ios": { | ||
| "supportsTablet": true | ||
| }, | ||
| "android": { | ||
| "adaptiveIcon": { | ||
| "foregroundImage": "./assets/adaptive-icon.png", | ||
| "backgroundColor": "#ffffff" | ||
| }, | ||
| "edgeToEdgeEnabled": true | ||
| }, | ||
| "web": { | ||
| "favicon": "./assets/favicon.png", | ||
| "bundler": "metro" | ||
| }, | ||
| "plugins": ["expo-router"] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import { Tabs } from "expo-router"; | ||
| import { | ||
| Home, | ||
| LayoutGrid, | ||
| Bell, | ||
| UserCircle, | ||
| } from "lucide-react-native"; | ||
|
|
||
| export default function TabLayout() { | ||
| return ( | ||
| <Tabs | ||
| screenOptions={{ | ||
| headerShown: true, | ||
| headerStyle: { backgroundColor: "#ffffff" }, | ||
| headerTitleStyle: { fontWeight: "700", fontSize: 17 }, | ||
| headerShadowVisible: false, | ||
| tabBarActiveTintColor: "#1e40af", | ||
| tabBarInactiveTintColor: "#94a3b8", | ||
| tabBarStyle: { | ||
| borderTopColor: "#e2e8f0", | ||
| backgroundColor: "#ffffff", | ||
| }, | ||
| tabBarLabelStyle: { | ||
| fontSize: 11, | ||
| fontWeight: "600", | ||
| }, | ||
| }} | ||
| > | ||
| <Tabs.Screen | ||
| name="index" | ||
| options={{ | ||
| title: "Home", | ||
| tabBarIcon: ({ color, size }) => <Home size={size} color={color} />, | ||
| }} | ||
| /> | ||
| <Tabs.Screen | ||
| name="apps" | ||
| options={{ | ||
| title: "Apps", | ||
| tabBarIcon: ({ color, size }) => ( | ||
| <LayoutGrid size={size} color={color} /> | ||
| ), | ||
| }} | ||
| /> | ||
| <Tabs.Screen | ||
| name="notifications" | ||
| options={{ | ||
| title: "Notifications", | ||
| tabBarIcon: ({ color, size }) => <Bell size={size} color={color} />, | ||
| }} | ||
| /> | ||
| <Tabs.Screen | ||
| name="profile" | ||
| options={{ | ||
| title: "Profile", | ||
| tabBarIcon: ({ color, size }) => ( | ||
| <UserCircle size={size} color={color} /> | ||
| ), | ||
| }} | ||
| /> | ||
| </Tabs> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { View, Text, ScrollView } from "react-native"; | ||
| import { SafeAreaView } from "react-native-safe-area-context"; | ||
| import { LayoutGrid } from "lucide-react-native"; | ||
|
|
||
| export default function AppsScreen() { | ||
| return ( | ||
| <SafeAreaView className="flex-1 bg-background" edges={["left", "right"]}> | ||
| <ScrollView | ||
| className="flex-1" | ||
| contentContainerClassName="px-5 pb-8 pt-4" | ||
| > | ||
| <View className="flex-1 items-center justify-center pt-20"> | ||
| <View className="rounded-2xl bg-muted p-6"> | ||
| <LayoutGrid size={40} color="#94a3b8" /> | ||
| </View> | ||
| <Text className="mt-5 text-lg font-semibold text-foreground"> | ||
| Apps | ||
| </Text> | ||
| <Text className="mt-2 text-center text-sm text-muted-foreground"> | ||
| Your enterprise applications will appear here. | ||
| </Text> | ||
| </View> | ||
| </ScrollView> | ||
| </SafeAreaView> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,106 @@ | ||||||||||||||||||
| import { View, Text, ScrollView } from "react-native"; | ||||||||||||||||||
| import { SafeAreaView } from "react-native-safe-area-context"; | ||||||||||||||||||
| import { TrendingUp, TrendingDown, Users, ShoppingCart, DollarSign, Activity } from "lucide-react-native"; | ||||||||||||||||||
| import { Card, CardHeader, CardTitle, CardContent } from "~/components/ui/Card"; | ||||||||||||||||||
|
|
||||||||||||||||||
| interface DashboardCardMeta { | ||||||||||||||||||
| type: "card"; | ||||||||||||||||||
| title: string; | ||||||||||||||||||
| value: string; | ||||||||||||||||||
| trend: string; | ||||||||||||||||||
| icon: string; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| const dashboardMetadata: DashboardCardMeta[] = [ | ||||||||||||||||||
| { type: "card", title: "Monthly Sales", value: "$120,000", trend: "+12%", icon: "dollar-sign" }, | ||||||||||||||||||
| { type: "card", title: "Active Users", value: "8,420", trend: "+5.2%", icon: "users" }, | ||||||||||||||||||
| { type: "card", title: "Orders", value: "1,340", trend: "-2.1%", icon: "shopping-cart" }, | ||||||||||||||||||
| { type: "card", title: "Revenue Growth", value: "23.5%", trend: "+8.7%", icon: "activity" }, | ||||||||||||||||||
| ]; | ||||||||||||||||||
|
|
||||||||||||||||||
| const iconMap: Record<string, React.ComponentType<{ size: number; color: string }>> = { | ||||||||||||||||||
| "dollar-sign": DollarSign, | ||||||||||||||||||
| users: Users, | ||||||||||||||||||
| "shopping-cart": ShoppingCart, | ||||||||||||||||||
| activity: Activity, | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| function TrendBadge({ trend }: { trend: string }) { | ||||||||||||||||||
| const isPositive = trend.startsWith("+"); | ||||||||||||||||||
| const TrendIcon = isPositive ? TrendingUp : TrendingDown; | ||||||||||||||||||
| return ( | ||||||||||||||||||
| <View | ||||||||||||||||||
| className={`flex-row items-center rounded-full px-2.5 py-1 ${ | ||||||||||||||||||
| isPositive ? "bg-emerald-50" : "bg-red-50" | ||||||||||||||||||
| }`} | ||||||||||||||||||
| > | ||||||||||||||||||
| <TrendIcon size={12} color={isPositive ? "#059669" : "#dc2626"} /> | ||||||||||||||||||
| <Text | ||||||||||||||||||
| className={`ml-1 text-xs font-semibold ${ | ||||||||||||||||||
| isPositive ? "text-emerald-700" : "text-red-600" | ||||||||||||||||||
| }`} | ||||||||||||||||||
| > | ||||||||||||||||||
| {trend} | ||||||||||||||||||
| </Text> | ||||||||||||||||||
| </View> | ||||||||||||||||||
| ); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| function MetadataCardRenderer({ meta }: { meta: DashboardCardMeta }) { | ||||||||||||||||||
| const IconComponent = iconMap[meta.icon] ?? Activity; | ||||||||||||||||||
|
|
||||||||||||||||||
| return ( | ||||||||||||||||||
| <Card className="mb-3"> | ||||||||||||||||||
| <CardHeader className="flex-row items-center justify-between pb-2"> | ||||||||||||||||||
| <CardTitle className="text-sm font-medium text-muted-foreground"> | ||||||||||||||||||
| {meta.title} | ||||||||||||||||||
| </CardTitle> | ||||||||||||||||||
| <View className="rounded-lg bg-primary/10 p-2"> | ||||||||||||||||||
| <IconComponent size={18} color="#1e40af" /> | ||||||||||||||||||
| </View> | ||||||||||||||||||
| </CardHeader> | ||||||||||||||||||
| <CardContent> | ||||||||||||||||||
| <Text className="text-2xl font-bold text-card-foreground"> | ||||||||||||||||||
| {meta.value} | ||||||||||||||||||
| </Text> | ||||||||||||||||||
| <View className="mt-2"> | ||||||||||||||||||
| <TrendBadge trend={meta.trend} /> | ||||||||||||||||||
| </View> | ||||||||||||||||||
| </CardContent> | ||||||||||||||||||
| </Card> | ||||||||||||||||||
| ); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| function renderFromMetadata(metadata: DashboardCardMeta[]) { | ||||||||||||||||||
| return metadata.map((item, index) => { | ||||||||||||||||||
| switch (item.type) { | ||||||||||||||||||
| case "card": | ||||||||||||||||||
| return <MetadataCardRenderer key={index} meta={item} />; | ||||||||||||||||||
|
Comment on lines
+75
to
+78
|
||||||||||||||||||
| return metadata.map((item, index) => { | |
| switch (item.type) { | |
| case "card": | |
| return <MetadataCardRenderer key={index} meta={item} />; | |
| return metadata.map((item) => { | |
| switch (item.type) { | |
| case "card": | |
| return <MetadataCardRenderer key={item.title} meta={item} />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { View, Text, ScrollView } from "react-native"; | ||
| import { SafeAreaView } from "react-native-safe-area-context"; | ||
| import { Bell } from "lucide-react-native"; | ||
|
|
||
| export default function NotificationsScreen() { | ||
| return ( | ||
| <SafeAreaView className="flex-1 bg-background" edges={["left", "right"]}> | ||
| <ScrollView | ||
| className="flex-1" | ||
| contentContainerClassName="px-5 pb-8 pt-4" | ||
| > | ||
| <View className="flex-1 items-center justify-center pt-20"> | ||
| <View className="rounded-2xl bg-muted p-6"> | ||
| <Bell size={40} color="#94a3b8" /> | ||
| </View> | ||
| <Text className="mt-5 text-lg font-semibold text-foreground"> | ||
| No Notifications | ||
| </Text> | ||
| <Text className="mt-2 text-center text-sm text-muted-foreground"> | ||
| You're all caught up. New notifications will appear here. | ||
| </Text> | ||
| </View> | ||
| </ScrollView> | ||
| </SafeAreaView> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { View, Text, ScrollView } from "react-native"; | ||
| import { SafeAreaView } from "react-native-safe-area-context"; | ||
| import { UserCircle } from "lucide-react-native"; | ||
| import { Button } from "~/components/ui/Button"; | ||
|
|
||
| export default function ProfileScreen() { | ||
| return ( | ||
| <SafeAreaView className="flex-1 bg-background" edges={["left", "right"]}> | ||
| <ScrollView | ||
| className="flex-1" | ||
| contentContainerClassName="px-5 pb-8 pt-4" | ||
| > | ||
| <View className="items-center pt-10"> | ||
| <View className="rounded-full bg-muted p-5"> | ||
| <UserCircle size={56} color="#94a3b8" /> | ||
| </View> | ||
| <Text className="mt-4 text-xl font-bold text-foreground"> | ||
| John Doe | ||
| </Text> | ||
| <Text className="mt-1 text-sm text-muted-foreground"> | ||
| john.doe@company.com | ||
| </Text> | ||
| </View> | ||
|
|
||
| <View className="mt-8 gap-3"> | ||
| <Button variant="outline">Edit Profile</Button> | ||
| <Button variant="outline">Settings</Button> | ||
| <Button variant="ghost">Help & Support</Button> | ||
| <Button variant="destructive">Sign Out</Button> | ||
| </View> | ||
| </ScrollView> | ||
| </SafeAreaView> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tab/header colors are hard-coded hex values (
#ffffff,#1e40af,#94a3b8,#e2e8f0). This bypasses the CSS-variable design tokens and will look wrong once dark mode is enabled. Consider sourcing these from the theme (e.g., via token-backed colors or a color-scheme switch) so the navigation chrome stays in sync withglobal.csstokens.