Skip to content

Latest commit

 

History

History
179 lines (127 loc) · 5.03 KB

File metadata and controls

179 lines (127 loc) · 5.03 KB

🎯 Crowd-sourced Fitness Challenge App

This app enables users to create and participate in community-driven fitness challenges. Users can engage in challenges, chat with others, earn badges, and track progress all within a cross-platform mobile app.

Contributors

This project is the result of the collaborative efforts of the following contributors:

Note: While GitHub may display an additional user as a contributor, no one else has made contributions to this project or holds permission to do so.

Features

Key Objectives:

  • 🔐 User Accounts: Secure login and registration for users.
  • 🏋️‍♂️ Challenge Creation: Create fitness challenges with goals, descriptions, tags, and badges.
  • 🔎 Challenge Participation: Search challenges by tags, view favorites, and complete goals.
  • 🏅 Badges and Wall of Fame: Earn badges and be featured on the Wall of Fame for completing challenges.

🛠️ Technologies

  • Frontend: React Native with Expo, TypeScript, Redux
  • Backend: Google Cloud Functions
  • Database: Supabase PostgreSQL for handling structured relational data storage with real-time features.
  • Authentication: Supabase Authentication
  • Real-time Chat: Firebase Firestore
  • Testing: Jest
  • Project Management: Trello, GitHub
  • Communication: Discord

🚀 Backend Setup

Steps to Set Up the Backend Locally:

  1. Clone the repository:

    git clone https://github.com/paolacernada/Crowd-sourced-Fitness-Challenge-App.git
    cd Crowd-sourced-Fitness-Challenge-App
  2. Create a .env.server file at the root of the test_backend folder and add the SUPABASE_URL and SUPABASE_ANON_KEY.

  3. In a new terminal window, navigate to the test_backend folder:

    cd test_backend
  4. Install dependencies and run the backend:

    npm install
    npm start
    • This installs the dependencies and runs the backend.
    • Keep this terminal open to continue running the backend.

📱 Frontend Setup

Steps to Set Up the Frontend Locally:

  1. Install Expo CLI globally:

    npm install -g expo-cli
  2. Create a .env.frontend file at the root of the react_native_frontend folder and add the SUPABASE_URL and SUPABASE_ANON_KEY.

  3. In a new terminal window, navigate to the react_native_frontend folder:

    cd react_native_frontend
  4. Install dependencies and run the frontend:

    npx expo install
    npx expo start

    If your device is having network issues, try adding the --tunnel flag.

  5. Install Expo Go on your mobile device:

  6. Scan the QR code generated by Expo with your device to preview the app.


🔄 Branch Protection and Pull Requests

  1. Create a new branch:

    git checkout -b <branch-name>
  2. Fix linting issues:

    npm run lint:fix
    
  3. Push the branch:

    git push origin <branch-name>
  4. Open a pull request on GitHub. GitHub Actions will automatically check for linting errors before merging.

  5. Upon review, the pull request will be approved and merged to the main branch, or revisions will be requested.


⚡ Supabase Edge Functions

Installation

  1. Install Supabase CLI, following instructions to add it to your PATH:

    brew install supabase/tap/supabase
  2. Upgrade Supabase CLI (if needed):

    brew upgrade supabase
  3. Log into Supabase. If you see an error (WSL may cause one), try adding the --no-browser flag:

    supabase login
  4. Initialize the Supabase project in the root folder:

    supabase init
  5. Start the Supabase service:

    supabase start

🧪 Testing

  1. Run the function locally for testing:

    supabase functions serve exampleFunction
  2. Deploy the function to Supabase:

    supabase functions deploy functionName
    • Deployment URL can be found in the terminal output after deployment.
  3. Update the frontend to use the deployed Edge Function URL instead of local routes.

📦 Exporting React Native App

  1. In the frontend root folder, run

    npx expo export
  2. If there is trouble running the linter after exporting a build, run:

    npx eslint --debug --no-cache .

📚 Explore the Docs