Skip to content

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšฝ Football Field Booking App

A mobile football field booking application built with React Native (Expo) and TypeScript.

๐ŸŽฏ Overview

This app allows users to browse and book football fields. It features two user roles:

  • Players: Browse field complexes, view all fields, and manage their profile
  • Owners: Manage their field complexes and bookings (dashboard)

โœจ Features

๐Ÿ‘ค Player Features

  • ๐Ÿข Browse field complexes with ratings and details
  • โšฝ View all available football fields
  • ๐Ÿ” Search fields by name, address, or complex
  • ๐Ÿท๏ธ Filter by field type (5-a-side, 7-a-side, 11-a-side)
  • ๐Ÿ“Š View field availability status
  • ๐Ÿ‘ค Manage personal profile
  • ๐Ÿ“œ View booking history and favorites

๐Ÿข Owner Features

  • ๐Ÿ“Š Dashboard with statistics (total fields, bookings, revenue, customers)
  • ๐ŸŽฏ Quick actions for management
  • ๐Ÿšง Coming soon: Add fields, manage bookings, view reports

๐ŸŽฎ Demo Accounts

The app includes 2 demo accounts for testing:

Player Account:

Email: player@test.com
Password: 123456

Owner Account:

Email: owner@test.com
Password: 123456

๐Ÿ“ Project Structure

football-field-booking/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # Reusable components
โ”‚   โ”‚   โ”œโ”€โ”€ ClusterCard.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ FieldCard.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ SearchBar.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ CategoryFilter.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ CustomInput.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ PrimaryButton.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ SocialLoginButtons.tsx
โ”‚   โ”‚   โ””โ”€โ”€ Typography.tsx
โ”‚   โ”œโ”€โ”€ context/             # React Context
โ”‚   โ”‚   โ””โ”€โ”€ AuthContext.tsx  # Authentication context
โ”‚   โ”œโ”€โ”€ navigation/          # Navigation configuration
โ”‚   โ”‚   โ”œโ”€โ”€ RootNavigator.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ AuthNavigator.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ PlayerNavigator.tsx (Bottom Tabs)
โ”‚   โ”‚   โ””โ”€โ”€ OwnerNavigator.tsx
โ”‚   โ”œโ”€โ”€ screens/            # Application screens
โ”‚   โ”‚   โ”œโ”€โ”€ auth/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LoginScreen.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ RegisterScreen.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ WelcomeScreen.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ player/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ HomeScreen.tsx          # Field complexes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ FieldListScreen.tsx     # All fields
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ FieldDetailScreen.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ BookingScreen.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ProfileScreen.tsx
โ”‚   โ”‚   โ””โ”€โ”€ owner/
โ”‚   โ”‚       โ”œโ”€โ”€ DashboardScreen.tsx
โ”‚   โ”‚       โ”œโ”€โ”€ ManageFieldsScreen.tsx
โ”‚   โ”‚       โ””โ”€โ”€ ManageBookingsScreen.tsx
โ”‚   โ”œโ”€โ”€ services/           # API services (coming soon)
โ”‚   โ”œโ”€โ”€ store/             # State management (coming soon)
โ”‚   โ”œโ”€โ”€ types/             # TypeScript types
โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ””โ”€โ”€ utils/             # Utility functions
โ”œโ”€โ”€ assets/                # Images and static files
โ”œโ”€โ”€ App.tsx               # App entry point
โ”œโ”€โ”€ app.json              # Expo configuration
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json

๐Ÿ›  Tech Stack

  • React Native - Mobile framework
  • Expo - Development platform (SDK 54)
  • TypeScript - Type safety
  • React Navigation v6 - Navigation library
    • Stack Navigator
    • Bottom Tabs Navigator
  • Expo Vector Icons - Icon library
  • React Context API - State management (authentication)

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Expo Go app on your mobile device (from App Store or Google Play)

Installation

  1. Clone the repository:
git clone <repository-url>
cd FBF-FE
  1. Install dependencies:
npm install
  1. Start the development server:
npx expo start

Running the App

Option 1: Expo Go (Recommended for testing)

  1. Install Expo Go on your phone:

  2. Start the dev server:

npm start
  1. Scan the QR code:

    • Android: Open Expo Go app โ†’ Scan QR code
    • iOS: Open Camera app โ†’ Scan QR code โ†’ Tap notification
  2. The app will load and you can login with demo accounts!

Option 2: Web Browser

npm run web
# or press 'w' in the terminal

Option 3: Android Emulator (requires Android Studio)

# Start emulator first, then:
npm run android

๐Ÿ“ฑ Navigation Structure

Auth Flow (Not Logged In)

AuthNavigator (Stack)
โ”œโ”€โ”€ Welcome
โ”œโ”€โ”€ Login
โ””โ”€โ”€ Register

Player Flow (Logged In)

PlayerNavigator (Bottom Tabs)
โ”œโ”€โ”€ Home (Complexes)        # Browse field complexes
โ”œโ”€โ”€ FieldList (All Fields)  # Browse all fields
โ””โ”€โ”€ Profile                 # User profile & settings

Owner Flow (Logged In)

OwnerNavigator (Stack)
โ””โ”€โ”€ Dashboard               # Owner dashboard

๐ŸŽจ Components Library

Reusable Components

  • ClusterCard - Display field complex with image, rating, location
  • FieldCard - Display individual field with details, price, availability
  • SearchBar - Search input with filter button
  • CategoryFilter - Horizontal scrollable category chips
  • CustomInput - Styled input with icon support
  • PrimaryButton - Primary action button
  • Typography - Text component with variants (h1, h2, subtitle, body)

๐Ÿ” Authentication

The app uses React Context API for authentication management:

  • AuthContext provides:
    • user - Current user object
    • isAuthenticated - Boolean auth status
    • login(email, password) - Login function
    • logout() - Logout function

Authentication state automatically switches between Auth and Main navigators.

๐Ÿ“ Mock Data

Currently, the app uses mock data for:

  • Field complexes
  • Football fields
  • User profiles
  • Statistics

In production, these will be replaced with actual API calls.

๐ŸŽฏ Current Status

โœ… Completed

  • Project structure and navigation
  • Authentication flow with Context API
  • Login screen with demo accounts
  • Player screens (Home, FieldList, Profile)
  • Owner dashboard
  • Reusable components
  • Bottom tab navigation
  • Search and filter functionality
  • Mock data and UI

๐Ÿšง Coming Soon

  • Backend API integration
  • Real booking functionality
  • Field detail screen
  • Booking history
  • Payment integration
  • Owner field management
  • Push notifications
  • Map integration

๐Ÿงช Testing

  1. Start the app with npm start
  2. Login with demo accounts (see above)
  3. Test player features:
    • Browse complexes
    • View all fields
    • Search and filter
    • View profile
    • Logout
  4. Test owner dashboard:
    • View statistics
    • Check quick actions
    • Logout

๐Ÿ“ฆ Available Scripts

npm start          # Start Expo dev server
npm run android    # Run on Android (requires emulator/device)
npm run ios        # Run on iOS (macOS only)
npm run web        # Run on web browser

๐ŸŒ Environment

  • Development: Using Expo Go
  • Build: Can create standalone builds with EAS Build
  • No native build required for development

๐Ÿ“„ Additional Documentation

  • See ACCOUNTS.md for detailed demo account information
  • See ASSET_INSTRUCTIONS.md for asset management guidelines

๐Ÿค Contributing

This is a private project. For collaboration:

  1. Create a new branch for features
  2. Follow TypeScript and ESLint rules
  3. Test on both Android and iOS
  4. Create pull requests for review

๐Ÿ“ Notes

  • All UI text is in English
  • Currency displayed as USD ($)
  • Mock data uses HCMC (Ho Chi Minh City) locations
  • App follows Material Design principles
  • Color scheme: Emerald green (#10B981) as primary

๐Ÿ”ฎ Future Enhancements

  1. Backend Integration

    • REST API or GraphQL
    • Real-time booking updates
    • User authentication with JWT
  2. Advanced Features

    • Google Maps integration
    • Real-time availability
    • Online payment (Stripe/PayPal)
    • Review and rating system
    • Push notifications
  3. Owner Dashboard

    • Full field management
    • Booking calendar
    • Revenue reports
    • Customer management

๐Ÿ“ง Contact

For questions or support, please contact the development team.


Built with โค๏ธ using React Native & Expo

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages