📱 SHELFIE_APP (ChatGPT)
The main project folder for your React Native + Expo Router app.
└── .expo/ ← Expo configuration, build cache, environment files
└── app/ ← Expo Router reads this for navigation routes
├── (auth)/ ← Route group for authentication (not visible in URL)
│ ├── _layout.jsx ← Stack layout for auth screens
│ ├── login.jsx ← /login
│ └── register.jsx ← /register
│
└── (dashboard)/ ← Route group for logged-in users
├── _layout.jsx ← Tabs/Drawer/Stack for dashboard navigation
├── index.jsx ← /dashboard (default landing page)
├── books.jsx ← /dashboard/books
├── create.jsx ← /dashboard/create
└── profile.jsx ← /dashboard/profile
Other project folders:
- assets/ ← Images, fonts, icons
- components/ ← Reusable UI components (buttons, headers, etc.)
- constants/ ← Centralized constants (colors, API URLs)
- contexts/ ← React Context providers for state management
• BooksContext.jsx ← Stores book-related state (list, CRUD actions)
• UserContext.jsx ← Stores user session/authentication state
- hooks/ ← Custom React hooks (e.g., useAuth, useBooks)
────────────────────────────────────────────
🔹 Navigation Flow
────────────────────────────────────────────
1. When the app starts → it checks UserContext (logged in or not).
- If **not logged in** → `(auth)/_layout.jsx` handles navigation between `login` and `register`.
- If **logged in** → `(dashboard)/_layout.jsx` loads, showing the main app screens.
2. Inside **Dashboard**:
- Default route → `index.jsx`.
- User can switch to `books`, `create`, or `profile`.
────────────────────────────────────────────
🔹 Effective Structure
────────────────────────────────────────────
- **Auth stack** → Login / Register
- **Dashboard stack/tabs** → Home (index), Books, Create, Profile
────────────────────────────────────────────
📚 References
────────────────────────────────────────────
- Expo Router Docs: https://docs.expo.dev/router/introduction/
- React Context: https://react.dev/reference/react/useContext
SHELFIE_APP/ (DeepSeek)
expo/ ← Expo-specific configuration
app/ ← Main application directory (Expo Router)
(auth)/ ← Authentication group route
layout.jsx ← Shared layout for auth pages
login.jsx ← Login page component
register.jsx ← Registration page component
(dashboard)/ ← Protected dashboard routes
layout.jsx ← Dashboard layout component
books.jsx ← Books listing page
create.jsx ← Create new book page
profile.jsx ← User profile page
layout.jsx ← Root layout for the entire app
index.jsx ← Home page component
assets/ ← Static assets (images, fonts, icons)
components/ ← Reusable React components
constants/ ← App constants and configuration
contexts/ ← React Context providers
BooksContext.jsx ← Manages books state across app
UserContext.jsx ← Manages user authentication state
hooks/ ← Custom React hooks for reusable logic
Key Features:
- Authentication Flow with separate auth and protected routes
- State Management using React Context API
- Modular Components for reusable UI elements
- File-based Routing with Expo Router
- Scalable Architecture with organized separation of concerns
This structure follows Expo's recommended practices for a medium-sized React Native app with authentication and data management.
Comments
Post a Comment