first commit

This commit is contained in:
Ravi Gulhane 2026-06-03 13:50:59 +05:30
commit 56b4dd7861
81 changed files with 18882 additions and 0 deletions

16
App.tsx Normal file
View File

@ -0,0 +1,16 @@
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { AuthProvider } from './src/context/AuthContext';
import { RootNavigator } from './src/navigation/RootNavigator';
function App() {
return (
<SafeAreaProvider>
<AuthProvider>
<RootNavigator />
</AuthProvider>
</SafeAreaProvider>
);
}
export default App;

17
Gemfile Normal file
View File

@ -0,0 +1,17 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
gem 'nkf'

114
Gemfile.lock Normal file
View File

@ -0,0 +1,114 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.9)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.9.0)
public_suffix (>= 2.0.2, < 8.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
benchmark (0.5.0)
bigdecimal (4.1.2)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.3)
escape (0.0.4)
ethon (0.18.0)
ffi (>= 1.15.0)
logger
ffi (1.17.4)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.9.0)
mutex_m
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.7.6)
logger (1.7.0)
minitest (5.25.4)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.4.4)
ruby-macho (2.5.1)
typhoeus (1.6.0)
ethon (>= 0.18.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.6, < 4.0)
zeitwerk (2.6.18)
PLATFORMS
ruby
DEPENDENCIES
activesupport (>= 6.1.7.5, != 7.1.0)
benchmark
bigdecimal
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
concurrent-ruby (< 1.3.4)
logger
mutex_m
nkf
xcodeproj (< 1.26.0)
RUBY VERSION
ruby 2.6.10p210
BUNDLED WITH
1.17.2

147
README.md Normal file
View File

@ -0,0 +1,147 @@
# EventBuzz Checkins (mobile)
Bare React Native app for staff to check in event participants via search or badge QR scan. Uses the EventBuzz Dashboard API (`/api/auth/login`, `/api/checkins/events`, attendance endpoints).
## Important: Metro (port 8081) is not the app UI
Opening **http://localhost:8081** in a browser shows React Native’s default Metro landing page (“Welcome to React Native”). That is only the JavaScript bundler status page.
To use **EventBuzz Checkins**, run the app on a **simulator or physical device**:
```sh
source ~/.bashrc
cd eventbuzz-checkins
# Terminal 1 — keep running
npm start
# Terminal 2 — Android emulator or USB device
npm run android
# OR iOS Simulator (after pod install in ios/)
npm run ios
```
You should see the **email login** screen, not the Metro welcome page.
If the simulator still shows the old welcome screen, press **`r`** in the Metro terminal to reload, or run `npm run android` again from `eventbuzz-checkins`.
## Android build note (AsyncStorage 3.x)
If Gradle reports `Could not find org.asyncstorage.shared_storage:storage-android:1.0.0`, the project’s `android/build.gradle` already adds the package’s `local_repo` Maven path. After `npm install`, run `npm run android` again.
## Configuration
Copy `.env.example` to `.env` and set `API_BASE_URL`:
- **Android Emulator:** `http://10.0.2.2:3001/api` — `localhost` in `.env` causes **Network request failed**
- **iOS Simulator:** `http://localhost:3001/api`
- **Physical device:** your Mac’s LAN IP, e.g. `http://192.168.1.10:3001/api`, and set `HOST=0.0.0.0` in `backend/.env`
Start the API: `cd backend && npm run dev` (port **3001**).
After changing `.env`, rebuild the app: `npm run android` (react-native-config embeds `.env` at build time).
## QR format
Badge QRs encode `eventbuzz:participant:{participantId}` (same as dashboard badge PDFs).
---
This is a [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
# Getting Started
> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.
## Step 1: Start Metro
First, you will need to run **Metro**, the JavaScript build tool for React Native.
To start the Metro dev server, run the following command from the root of your React Native project:
```sh
# Using npm
npm start
# OR using Yarn
yarn start
```
## Step 2: Build and run your app
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
### Android
```sh
# Using npm
npm run android
# OR using Yarn
yarn android
```
### iOS
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
```sh
bundle install
```
Then, and every time you update your native dependencies, run:
```sh
bundle exec pod install
```
For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
```sh
# Using npm
npm run ios
# OR using Yarn
yarn ios
```
If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
## Step 3: Modify your app
Now that you have successfully run the app, let's make changes!
Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
- **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).
- **iOS**: Press <kbd>R</kbd> in iOS Simulator.
## Congratulations! :tada:
You've successfully run and modified your React Native App. :partying_face:
### Now what?
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).
# Troubleshooting
If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
# Learn More
To learn more about React Native, take a look at the following resources:
- [React Native Website](https://reactnative.dev) - learn more about React Native.
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

13
__tests__/App.test.tsx Normal file
View File

@ -0,0 +1,13 @@
/**
* @format
*/
import React from 'react';
import ReactTestRenderer from 'react-test-renderer';
import App from '../App';
test('renders correctly', async () => {
await ReactTestRenderer.act(() => {
ReactTestRenderer.create(<App />);
});
});

123
android/app/build.gradle Normal file
View File

@ -0,0 +1,123 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. Default is "debug", "debugOptimized".
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "liteDebugOptimized", "prodDebug", "prodDebugOptimized"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
/* Autolinking */
autolinkLibrariesWithApp()
}
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.eventbuzzcheckins"
defaultConfig {
applicationId "com.eventbuzzcheckins"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
manifestPlaceholders = [usesCleartextTraffic: "true"]
resValue "string", "build_config_package", "com.eventbuzzcheckins"
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}

BIN
android/app/debug.keystore Normal file

Binary file not shown.

10
android/app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,10 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:

View File

@ -0,0 +1,28 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="${usesCleartextTraffic}"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,22 @@
package com.eventbuzzcheckins
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
class MainActivity : ReactActivity() {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "EventBuzzCheckins"
/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}

View File

@ -0,0 +1,27 @@
package com.eventbuzzcheckins
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
class MainApplication : Application(), ReactApplication {
override val reactHost: ReactHost by lazy {
getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
},
)
}
override fun onCreate() {
super.onCreate()
loadReactNative(this)
}
}

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
>
<selector>
<!--
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
-->
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
</selector>
</inset>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,3 @@
<resources>
<string name="app_name">EventBuzzCheckins</string>
</resources>

View File

@ -0,0 +1,9 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
</style>
</resources>

30
android/build.gradle Normal file
View File

@ -0,0 +1,30 @@
buildscript {
ext {
buildToolsVersion = "36.0.0"
minSdkVersion = 24
compileSdkVersion = 36
targetSdkVersion = 36
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}
apply plugin: "com.facebook.react.rootproject"
// AsyncStorage 3.x ships storage-android in a bundled local Maven repo (not on Maven Central).
allprojects {
repositories {
maven {
url = uri("${rootDir}/../node_modules/@react-native-async-storage/async-storage/android/local_repo")
}
}
}

47
android/gradle.properties Normal file
View File

@ -0,0 +1,47 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=true
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
# Use this property to enable edge-to-edge display support.
# This allows your app to draw behind system bars for an immersive UI.
# Note: Only works with ReactActivity and should not be used with custom Activity.
edgeToEdgeEnabled=false
# Required for QR scanning (useCodeScanner) on Android
VisionCamera_enableCodeScanner=true

Binary file not shown.

View File

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

248
android/gradlew vendored Executable file
View File

@ -0,0 +1,248 @@
#!/bin/sh
#
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

98
android/gradlew.bat vendored Normal file
View File

@ -0,0 +1,98 @@
@REM Copyright (c) Meta Platforms, Inc. and affiliates.
@REM
@REM This source code is licensed under the MIT license found in the
@REM LICENSE file in the root directory of this source tree.
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

6
android/settings.gradle Normal file
View File

@ -0,0 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'EventBuzzCheckins'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')

4
app.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "EventBuzzCheckins",
"displayName": "EventBuzzCheckins"
}

3
babel.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
};

110
dev-server/metro-index.html Normal file
View File

@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>EventBuzz Checkins — Metro</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
Arial, sans-serif;
margin: 0;
padding: 2rem;
background: #0f172a;
color: #e2e8f0;
line-height: 1.5;
}
main {
max-width: 42rem;
margin: 0 auto;
}
h1 {
font-size: 1.5rem;
font-weight: 600;
margin: 0 0 0.5rem;
color: #f8fafc;
}
.badge {
display: inline-block;
background: #1e40af;
color: #dbeafe;
font-size: 0.75rem;
font-weight: 600;
padding: 0.2rem 0.5rem;
border-radius: 0.25rem;
margin-bottom: 1rem;
}
p {
margin: 0 0 1rem;
color: #94a3b8;
}
.warn {
background: #422006;
border: 1px solid #b45309;
color: #fde68a;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
margin: 1rem 0 1.5rem;
font-size: 0.9rem;
}
ol {
margin: 0 0 1.5rem;
padding-left: 1.25rem;
color: #cbd5e1;
}
li {
margin-bottom: 0.5rem;
}
code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 0.85em;
background: #1e293b;
padding: 0.15em 0.35em;
border-radius: 0.25rem;
color: #7dd3fc;
}
a {
color: #38bdf8;
}
footer {
margin-top: 2rem;
font-size: 0.8rem;
color: #64748b;
}
</style>
</head>
<body>
<main>
<span class="badge">Metro bundler</span>
<h1>EventBuzz Checkins</h1>
<p>
The JavaScript dev server is running. This page is <strong>not</strong> the mobile
app — React Native does not run in the browser unless you add web support.
</p>
<div class="warn">
To use EventBuzz Checkins, open the app on an <strong>Android emulator/device</strong>
or <strong>iOS Simulator</strong> (see steps below). You should see the
<strong>email login</strong> screen.
</div>
<ol>
<li>Keep this terminal running: <code>npm start</code></li>
<li>
In a second terminal from <code>eventbuzz-checkins</code>:
<code>npm run android</code> or <code>npm run ios</code>
</li>
<li>
Set <code>API_BASE_URL</code> in <code>.env</code> (see
<code>.env.example</code>) — backend must be reachable from the device.
</li>
<li>If the simulator shows an old screen, press <code>r</code> in this Metro terminal to reload.</li>
</ol>
<p>
<a href="https://reactnative.dev/docs/environment-setup">React Native environment setup</a>
</p>
<footer>Port 8081 · EventBuzz Checkins</footer>
</main>
</body>
</html>

9
index.js Normal file
View File

@ -0,0 +1,9 @@
/**
* @format
*/
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);

11
ios/.xcode.env Normal file
View File

@ -0,0 +1,11 @@
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)

View File

@ -0,0 +1,496 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
0C80B921A6F3F58F76C31292 /* libPods-EventBuzzCheckins.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-EventBuzzCheckins.a */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
7F20B9F2B49CE7E8967DB6A4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
13B07F961A680F5B00A75B9A /* EventBuzzCheckins.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EventBuzzCheckins.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = EventBuzzCheckins/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = EventBuzzCheckins/Info.plist; sourceTree = "<group>"; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = EventBuzzCheckins/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
3B4392A12AC88292D35C810B /* Pods-EventBuzzCheckins.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EventBuzzCheckins.debug.xcconfig"; path = "Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-EventBuzzCheckins.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EventBuzzCheckins.release.xcconfig"; path = "Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins.release.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-EventBuzzCheckins.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EventBuzzCheckins.a"; sourceTree = BUILT_PRODUCTS_DIR; };
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = EventBuzzCheckins/AppDelegate.swift; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = EventBuzzCheckins/LaunchScreen.storyboard; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0C80B921A6F3F58F76C31292 /* libPods-EventBuzzCheckins.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
13B07FAE1A68108700A75B9A /* EventBuzzCheckins */ = {
isa = PBXGroup;
children = (
13B07FB51A68108700A75B9A /* Images.xcassets */,
761780EC2CA45674006654EE /* AppDelegate.swift */,
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
);
name = EventBuzzCheckins;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
5DCACB8F33CDC322A6C60F78 /* libPods-EventBuzzCheckins.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
);
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* EventBuzzCheckins */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
BBD78D7AC51CEA395F1C20DB /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
tabWidth = 2;
usesTabs = 0;
};
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* EventBuzzCheckins.app */,
);
name = Products;
sourceTree = "<group>";
};
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
3B4392A12AC88292D35C810B /* Pods-EventBuzzCheckins.debug.xcconfig */,
5709B34CF0A7D63546082F79 /* Pods-EventBuzzCheckins.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
13B07F861A680F5B00A75B9A /* EventBuzzCheckins */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "EventBuzzCheckins" */;
buildPhases = (
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = EventBuzzCheckins;
productName = EventBuzzCheckins;
productReference = 13B07F961A680F5B00A75B9A /* EventBuzzCheckins.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1210;
TargetAttributes = {
13B07F861A680F5B00A75B9A = {
LastSwiftMigration = 1120;
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "EventBuzzCheckins" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* EventBuzzCheckins */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
13B07F8E1A680F5B00A75B9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
7F20B9F2B49CE7E8967DB6A4 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(SRCROOT)/.xcode.env.local",
"$(SRCROOT)/.xcode.env",
);
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"\\\"$WITH_ENVIRONMENT\\\" \\\"$REACT_NATIVE_XCODE\\\"\"\n";
};
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-EventBuzzCheckins-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-EventBuzzCheckins/Pods-EventBuzzCheckins-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
13B07F871A680F5B00A75B9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-EventBuzzCheckins.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L5C269GZ5Z;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = EventBuzzCheckins/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = com.stratawiz.eventbuzzcheckins;
PRODUCT_NAME = EventBuzzCheckins;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-EventBuzzCheckins.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = L5C269GZ5Z;
INFOPLIST_FILE = EventBuzzCheckins/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = com.stratawiz.eventbuzzcheckins;
PRODUCT_NAME = EventBuzzCheckins;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
83CBBA201A601CBA00E9B192 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
USE_HERMES = true;
};
name = Debug;
};
83CBBA211A601CBA00E9B192 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = (
"$(inherited)",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
"-DRCT_REMOVE_LEGACY_ARCH=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
USE_HERMES = true;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "EventBuzzCheckins" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
13B07F951A680F5B00A75B9A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "EventBuzzCheckins" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
83CBBA211A601CBA00E9B192 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
}

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "EventBuzzCheckins.app"
BlueprintName = "EventBuzzCheckins"
ReferencedContainer = "container:EventBuzzCheckins.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "EventBuzzCheckinsTests.xctest"
BlueprintName = "EventBuzzCheckinsTests"
ReferencedContainer = "container:EventBuzzCheckins.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "EventBuzzCheckins.app"
BlueprintName = "EventBuzzCheckins"
ReferencedContainer = "container:EventBuzzCheckins.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "EventBuzzCheckins.app"
BlueprintName = "EventBuzzCheckins"
ReferencedContainer = "container:EventBuzzCheckins.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:EventBuzzCheckins.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,48 @@
import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var reactNativeDelegate: ReactNativeDelegate?
var reactNativeFactory: RCTReactNativeFactory?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
let delegate = ReactNativeDelegate()
let factory = RCTReactNativeFactory(delegate: delegate)
delegate.dependencyProvider = RCTAppDependencyProvider()
reactNativeDelegate = delegate
reactNativeFactory = factory
window = UIWindow(frame: UIScreen.main.bounds)
factory.startReactNative(
withModuleName: "EventBuzzCheckins",
in: window,
launchOptions: launchOptions
)
return true
}
}
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}
override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}

View File

@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>EventBuzz Checkins</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Camera access is required to scan participant QR codes for check-in.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>RCTNewArchEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="EventBuzzCheckins" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>

34
ios/Podfile Normal file
View File

@ -0,0 +1,34 @@
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'EventBuzzCheckins' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
end
end

2286
ios/Podfile.lock Normal file

File diff suppressed because it is too large Load Diff

3
jest.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
preset: '@react-native/jest-preset',
};

11
metro.config.js Normal file
View File

@ -0,0 +1,11 @@
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('@react-native/metro-config').MetroConfig}
*/
const config = {};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);

12397
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

48
package.json Normal file
View File

@ -0,0 +1,48 @@
{
"name": "EventBuzzCheckins",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"postinstall": "node scripts/patch-metro-index.js",
"start": "node scripts/patch-metro-index.js && react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^3.0.3",
"@react-navigation/native": "^7.2.4",
"@react-navigation/native-stack": "^7.15.1",
"react": "19.2.3",
"react-native": "0.85.3",
"react-native-config": "^1.6.1",
"react-native-safe-area-context": "^5.5.2",
"react-native-screens": "^4.25.1",
"react-native-vision-camera": "4.7.3"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "20.1.0",
"@react-native-community/cli-platform-android": "20.1.0",
"@react-native-community/cli-platform-ios": "20.1.0",
"@react-native/babel-preset": "0.85.3",
"@react-native/eslint-config": "0.85.3",
"@react-native/jest-preset": "0.85.3",
"@react-native/metro-config": "0.85.3",
"@react-native/typescript-config": "0.85.3",
"@types/jest": "^29.5.13",
"@types/react": "^19.2.0",
"@types/react-test-renderer": "^19.1.0",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "19.2.3",
"typescript": "^5.8.3"
},
"engines": {
"node": ">= 22.11.0"
}
}

View File

@ -0,0 +1,26 @@
/**
* Replaces React Native's default Metro landing page ("Welcome to React Native")
* with EventBuzz Checkins instructions. Runs before `npm start` and on postinstall.
*/
const fs = require('fs');
const path = require('path');
const source = path.join(__dirname, '../dev-server/metro-index.html');
const target = path.join(
__dirname,
'../node_modules/@react-native-community/cli-server-api/build/index.html',
);
if (!fs.existsSync(source)) {
console.warn('[patch-metro-index] Source HTML missing:', source);
process.exit(0);
}
if (!fs.existsSync(path.dirname(target))) {
console.warn(
'[patch-metro-index] cli-server-api not installed yet; skip until after npm install.',
);
process.exit(0);
}
fs.copyFileSync(source, target);

33
src/api/attendances.ts Normal file
View File

@ -0,0 +1,33 @@
import { api } from './client';
import type {
AttendanceRecord,
AttendanceSearchParticipant,
AttendanceCheckInResult,
ParticipantPreview,
} from './types';
export const attendancesApi = {
list(eventId: string) {
return api.get<{ attendances: AttendanceRecord[] }>(`/events/${eventId}/attendances`);
},
searchParticipants(eventId: string, attendanceId: string, q?: string) {
const sp = q?.trim() ? `?q=${encodeURIComponent(q.trim())}` : '';
return api.get<{ participants: AttendanceSearchParticipant[] }>(
`/events/${eventId}/attendances/${attendanceId}/search-participants${sp}`,
);
},
getParticipantPreview(eventId: string, attendanceId: string, participantId: string) {
return api.get<ParticipantPreview>(
`/events/${eventId}/attendances/${attendanceId}/participants/${participantId}`,
);
},
checkIn(eventId: string, attendanceId: string, participantId: string) {
return api.post<AttendanceCheckInResult>(
`/events/${eventId}/attendances/${attendanceId}/check-in`,
{ participantId },
);
},
};

28
src/api/auth.ts Normal file
View File

@ -0,0 +1,28 @@
import { api, setTokens } from './client';
import type { AuthResponse, LoginRequiresTwoFactor, User } from './types';
export const authApi = {
async login(email: string, password: string) {
const res = await api.post<AuthResponse | LoginRequiresTwoFactor>('/auth/login', {
email,
password,
});
const d = res.data;
if (d && 'token' in d && d.token && 'refreshToken' in d) {
await setTokens(d.token, d.refreshToken);
}
return res;
},
async login2fa(twoFactorToken: string, token: string) {
const res = await api.post<AuthResponse>('/auth/login/2fa', { twoFactorToken, token });
if (res.data?.token && res.data.refreshToken) {
await setTokens(res.data.token, res.data.refreshToken);
}
return res;
},
me() {
return api.get<User>('/auth/me');
},
};

8
src/api/checkins.ts Normal file
View File

@ -0,0 +1,8 @@
import { api } from './client';
import type { CheckinsEvent } from './types';
export const checkinsApi = {
listEvents() {
return api.get<{ events: CheckinsEvent[] }>('/checkins/events');
},
};

119
src/api/client.ts Normal file
View File

@ -0,0 +1,119 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { API_BASE_URL } from '../config';
const STORAGE_ACCESS = 'eventbuzz_checkins_access';
const STORAGE_REFRESH = 'eventbuzz_checkins_refresh';
let accessToken: string | null = null;
let refreshToken: string | null = null;
export async function loadTokensFromStorage(): Promise<void> {
const [access, refresh] = await Promise.all([
AsyncStorage.getItem(STORAGE_ACCESS),
AsyncStorage.getItem(STORAGE_REFRESH),
]);
accessToken = access;
refreshToken = refresh;
}
export async function setTokens(access: string, refresh: string): Promise<void> {
accessToken = access;
refreshToken = refresh;
await AsyncStorage.setItem(STORAGE_ACCESS, access);
await AsyncStorage.setItem(STORAGE_REFRESH, refresh);
}
export async function clearTokens(): Promise<void> {
accessToken = null;
refreshToken = null;
await AsyncStorage.removeItem(STORAGE_ACCESS);
await AsyncStorage.removeItem(STORAGE_REFRESH);
}
export function getAccessToken(): string | null {
return accessToken;
}
function apiUrl(path: string): string {
const p = path.startsWith('/') ? path : `/${path}`;
return `${API_BASE_URL}${p}`;
}
async function doRefresh(): Promise<boolean> {
if (!refreshToken) return false;
try {
const res = await fetch(apiUrl('/auth/refresh'), {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ refreshToken }),
});
const data = await res.json();
if (data.success && data.data?.token) {
await setTokens(data.data.token, refreshToken);
return true;
}
} catch {
/* ignore */
}
await clearTokens();
return false;
}
export async function request<T>(
path: string,
options: RequestInit = {},
): Promise<{ data?: T; error?: string; status: number }> {
const headers: Record<string, string> = {
'Content-Type': 'application/json',
...(typeof options.headers === 'object' && !(options.headers instanceof Headers)
? (options.headers as Record<string, string>)
: {}),
};
if (accessToken) headers.Authorization = `Bearer ${accessToken}`;
let res: Response;
try {
res = await fetch(apiUrl(path), { ...options, headers });
} catch (e) {
const msg = e instanceof Error ? e.message : 'Network request failed';
return {
error: `Cannot reach API at ${API_BASE_URL}. ${msg}. On Android emulator use 10.0.2.2 (not localhost). Is the backend running? (cd backend && npm run dev)`,
status: 0,
};
}
if (res.status === 401 && refreshToken) {
const refreshed = await doRefresh();
if (refreshed) {
headers.Authorization = `Bearer ${accessToken}`;
try {
res = await fetch(apiUrl(path), { ...options, headers });
} catch (e) {
const msg = e instanceof Error ? e.message : 'Network request failed';
return { error: `Cannot reach API (${API_BASE_URL}). ${msg}`, status: 0 };
}
}
}
let body: unknown;
try {
body = await res.json();
} catch {
return { error: res.statusText || 'Network error', status: res.status };
}
const api = body as { success?: boolean; data?: T; error?: { message?: string } };
if (api.success === true && api.data !== undefined) {
return { data: api.data, status: res.status };
}
return {
error: api.error?.message || res.statusText || 'Request failed',
status: res.status,
};
}
export const api = {
get: <T>(path: string) => request<T>(path, { method: 'GET' }),
post: <T>(path: string, body: unknown) =>
request<T>(path, { method: 'POST', body: JSON.stringify(body) }),
};

88
src/api/types.ts Normal file
View File

@ -0,0 +1,88 @@
export interface ApiErrorBody {
success: false;
error: { code?: string; message: string };
}
export interface User {
_id: string;
email: string;
firstName?: string;
lastName?: string;
role?: string;
organization?: { _id: string; name: string };
}
export interface AuthResponse {
user: User;
token: string;
refreshToken: string;
expiresIn?: string;
}
export interface LoginRequiresTwoFactor {
requiresTwoFactor: true;
twoFactorToken: string;
email: string;
}
export interface CheckinsEvent {
_id: string;
name: string;
startDate?: string;
endDate?: string;
location?: string;
image?: string;
status?: string;
attendanceSessionCount: number;
}
export interface AttendanceRecord {
_id: string;
name: string;
description?: string;
status: 'active' | 'archived';
settings?: {
allowDuplicateCheckIn?: boolean;
publicLinkEnabled?: boolean;
};
uniqueParticipants?: number;
totalCheckedIn?: number;
}
export interface AttendanceSearchParticipant {
_id: string;
firstName?: string;
lastName?: string;
email?: string;
phone?: string;
displayName: string;
alreadyCheckedIn: boolean;
checkInCount: number;
lastCheckedInAt?: string | null;
}
export interface AttendanceCheckInResult {
attendanceId: string;
attendanceName: string;
participantId: string;
displayName: string;
email: string;
phone: string;
checkInCount: number;
lastCheckedInAt: string | null;
allowDuplicateCheckIn: boolean;
alreadyCheckedIn: boolean;
}
export interface ParticipantPreview {
_id: string;
displayName: string;
firstName?: string;
lastName?: string;
email?: string;
phone?: string;
alreadyCheckedIn: boolean;
checkInCount: number;
lastCheckedInAt?: string | null;
allowDuplicateCheckIn: boolean;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -0,0 +1,87 @@
import React from 'react';
import { Modal, Pressable, StyleSheet, Text, View } from 'react-native';
import type { AttendanceCheckInResult } from '../api/types';
import { colors, radii, spacing, typography } from '../theme';
import { Card, PrimaryButton } from './ui';
type Props = {
visible: boolean;
result: AttendanceCheckInResult | null;
error: string | null;
onClose: () => void;
};
export function CheckInResultModal({ visible, result, error, onClose }: Props) {
const success = Boolean(result && !error);
return (
<Modal visible={visible} transparent animationType="fade" onRequestClose={onClose}>
<Pressable style={styles.overlay} onPress={onClose}>
<Pressable onPress={(e) => e.stopPropagation()}>
<Card style={styles.card} padded>
{error ? (
<>
<Text style={styles.titleError}>Check-in failed</Text>
<Text style={styles.body}>{error}</Text>
</>
) : result ? (
<>
<Text style={styles.titleSuccess}>Checked in</Text>
<Text style={styles.name}>{result.displayName}</Text>
{result.email ? <Text style={styles.meta}>{result.email}</Text> : null}
{result.phone ? <Text style={styles.meta}>{result.phone}</Text> : null}
<Text style={styles.meta}>
Session: {result.attendanceName}
</Text>
{result.lastCheckedInAt ? (
<Text style={styles.meta}>
{new Date(result.lastCheckedInAt).toLocaleString()}
</Text>
) : null}
</>
) : null}
<PrimaryButton title="Done" onPress={onClose} />
</Card>
</Pressable>
</Pressable>
</Modal>
);
}
const styles = StyleSheet.create({
overlay: {
flex: 1,
backgroundColor: 'rgba(0,0,0,0.45)',
justifyContent: 'center',
padding: 24,
},
card: {
borderRadius: radii.xl,
borderWidth: 0,
},
titleSuccess: {
...typography.h2,
color: colors.success,
marginBottom: 12,
},
titleError: {
...typography.h2,
color: colors.error,
marginBottom: 12,
},
name: {
...typography.h3,
color: colors.text,
marginBottom: 8,
},
body: {
...typography.body,
color: colors.text,
marginBottom: 16,
},
meta: {
...typography.small,
color: colors.muted,
marginBottom: 4,
},
});

View File

@ -0,0 +1,46 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import type { ViewStyle } from 'react-native';
import { colors, radii, typography } from '../../theme';
type Props = {
email?: string | null;
size?: number;
style?: ViewStyle | ViewStyle[];
};
function getInitials(email?: string | null) {
const raw = (email ?? '').split('@')[0]?.trim() ?? '';
const letters = raw.replace(/[^a-zA-Z0-9]/g, '').slice(0, 2).toUpperCase();
return letters || 'EB';
}
export function AvatarInitials({ email, size = 40, style }: Props) {
const initials = getInitials(email);
return (
<View
style={[
styles.wrap,
{ width: size, height: size, borderRadius: size / 2 },
style,
]}
>
<Text style={styles.text}>{initials}</Text>
</View>
);
}
const styles = StyleSheet.create({
wrap: {
backgroundColor: 'rgba(255,255,255,0.25)',
alignItems: 'center',
justifyContent: 'center',
},
text: {
...typography.small,
color: '#fff',
fontWeight: '800',
letterSpacing: 0.5,
},
});

View File

@ -0,0 +1,33 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import type { ViewStyle } from 'react-native';
import { colors, radii, typography } from '../../theme';
type Props = {
children: string;
style?: ViewStyle | ViewStyle[];
};
export function Badge({ children, style }: Props) {
return (
<View style={[styles.wrap, style]}>
<Text style={styles.text}>{children}</Text>
</View>
);
}
const styles = StyleSheet.create({
wrap: {
alignSelf: 'flex-start',
paddingHorizontal: 12,
paddingVertical: 7,
borderRadius: radii.pill,
backgroundColor: 'rgba(247,148,29,0.12)',
},
text: {
...typography.small,
color: colors.primaryDark,
fontWeight: '600',
},
});

View File

@ -0,0 +1,32 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
import type { ViewProps, ViewStyle } from 'react-native';
import { colors, radii, shadows } from '../../theme';
import { platformShadow } from './platformShadow';
type Props = ViewProps & {
padded?: boolean;
style?: ViewStyle | ViewStyle[];
};
export function Card({ padded = true, style, ...props }: Props) {
return (
<View
{...props}
style={[styles.base, padded && styles.padded, style, platformShadow(shadows.card)]}
/>
);
}
const styles = StyleSheet.create({
base: {
backgroundColor: colors.card,
borderRadius: radii.lg,
borderWidth: 1,
borderColor: colors.border,
},
padded: {
padding: 16,
},
});

View File

@ -0,0 +1,83 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import type { ViewStyle } from 'react-native';
import { colors, spacing, typography } from '../../theme';
type Props = {
title?: string;
subtitle?: string;
right?: React.ReactNode;
bottom?: React.ReactNode;
style?: ViewStyle | ViewStyle[];
};
export function GradientHeader({ title, subtitle, right, bottom, style }: Props) {
return (
<View style={[styles.wrap, style]}>
{/* Faux “gradient”: solid orange with decorative circles. Replace with LinearGradient once deps install. */}
<View style={styles.bg} />
<View style={styles.circleA} />
<View style={styles.circleB} />
<View style={styles.topRow}>
<View style={styles.textCol}>
{title ? <Text style={styles.title}>{title}</Text> : null}
{subtitle ? <Text style={styles.subtitle}>{subtitle}</Text> : null}
</View>
{right ? <View style={styles.right}>{right}</View> : null}
</View>
{bottom ? <View style={styles.bottom}>{bottom}</View> : null}
</View>
);
}
const styles = StyleSheet.create({
wrap: {
paddingTop: 52,
paddingBottom: 18,
paddingHorizontal: spacing.xl,
overflow: 'hidden',
},
bg: {
...StyleSheet.absoluteFillObject,
backgroundColor: colors.primary,
},
circleA: {
position: 'absolute',
width: 140,
height: 140,
borderRadius: 70,
right: -40,
top: -40,
backgroundColor: 'rgba(255,255,255,0.12)',
},
circleB: {
position: 'absolute',
width: 110,
height: 110,
borderRadius: 55,
left: -24,
bottom: -32,
backgroundColor: 'rgba(255,255,255,0.10)',
},
topRow: {
flexDirection: 'row',
alignItems: 'flex-start',
justifyContent: 'space-between',
gap: 12,
},
textCol: { flex: 1 },
title: {
...typography.title,
color: '#fff',
},
subtitle: {
marginTop: 6,
...typography.small,
color: 'rgba(255,255,255,0.75)',
},
right: { alignItems: 'flex-end' },
bottom: { marginTop: 14 },
});

View File

@ -0,0 +1,71 @@
import React from 'react';
import { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-native';
import type { PressableProps, ViewStyle } from 'react-native';
import { colors, radii, typography } from '../../theme';
type Props = Omit<PressableProps, 'style'> & {
title: string;
loading?: boolean;
style?: ViewStyle | ViewStyle[];
};
export function PrimaryButton({ title, loading, disabled, style, ...props }: Props) {
const isDisabled = Boolean(disabled || loading);
return (
<Pressable
{...props}
disabled={isDisabled}
style={({ pressed }) => [
styles.wrap,
pressed && !isDisabled ? styles.pressed : null,
isDisabled ? styles.disabled : null,
style,
]}
>
{/* Faux “gradient”: solid base + darker highlight strip. Replace with LinearGradient once deps install. */}
<View style={styles.bg} />
<View style={styles.highlight} />
<View style={styles.content}>
{loading ? <ActivityIndicator color="#fff" /> : <Text style={styles.text}>{title}</Text>}
</View>
</Pressable>
);
}
const styles = StyleSheet.create({
wrap: {
height: 52,
borderRadius: radii.md,
overflow: 'hidden',
alignItems: 'center',
justifyContent: 'center',
},
bg: {
...StyleSheet.absoluteFillObject,
backgroundColor: colors.primary,
},
highlight: {
position: 'absolute',
left: 0,
right: 0,
top: 0,
height: '55%',
backgroundColor: colors.primaryDark,
opacity: 0.35,
},
content: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
paddingHorizontal: 18,
},
text: {
color: '#fff',
...typography.bodyEm,
fontSize: 16,
},
pressed: { transform: [{ scale: 0.99 }] },
disabled: { opacity: 0.7 },
});

View File

@ -0,0 +1,55 @@
import React from 'react';
import { StyleSheet, Text, TextInput, View } from 'react-native';
import type { TextInputProps, ViewStyle } from 'react-native';
import { colors, radii, typography } from '../../theme';
type Props = TextInputProps & {
label?: string;
left?: React.ReactNode;
right?: React.ReactNode;
containerStyle?: ViewStyle | ViewStyle[];
};
export function TextField({ label, left, right, containerStyle, style, ...props }: Props) {
return (
<View style={containerStyle}>
{label ? <Text style={styles.label}>{label}</Text> : null}
<View style={styles.row}>
{left ? <View style={styles.side}>{left}</View> : null}
<TextInput
{...props}
style={[styles.input, style]}
placeholderTextColor={colors.muted}
/>
{right ? <View style={styles.side}>{right}</View> : null}
</View>
</View>
);
}
const styles = StyleSheet.create({
label: {
...typography.small,
color: colors.muted,
marginBottom: 8,
},
row: {
flexDirection: 'row',
alignItems: 'center',
gap: 10,
paddingHorizontal: 14,
paddingVertical: 12,
borderRadius: radii.md,
borderWidth: 1,
borderColor: colors.border,
backgroundColor: '#F9FAFB',
},
side: { alignItems: 'center', justifyContent: 'center' },
input: {
flex: 1,
...typography.body,
color: colors.text,
paddingVertical: 0,
},
});

View File

@ -0,0 +1,7 @@
export * from './Card';
export * from './PrimaryButton';
export * from './TextField';
export * from './Badge';
export * from './AvatarInitials';
export * from './GradientHeader';

View File

@ -0,0 +1,14 @@
import { Platform } from 'react-native';
import type { ViewStyle } from 'react-native';
export function platformShadow(shadow: {
ios: ViewStyle;
android: ViewStyle;
}): ViewStyle {
return Platform.select({
ios: shadow.ios,
android: shadow.android,
default: shadow.ios,
}) as ViewStyle;
}

23
src/config.ts Normal file
View File

@ -0,0 +1,23 @@
import Config from 'react-native-config';
import { Platform } from 'react-native';
const DEFAULT_ANDROID = 'http://10.0.2.2:3001/api';
const DEFAULT_IOS = 'http://localhost:3001/api';
/**
* On Android emulator, localhost / 127.0.0.1 is the emulator — not your dev machine.
* Rewrite those hosts to 10.0.2.2 (special alias to the host loopback).
*/
function resolveApiBaseUrl(): string {
const platformDefault = Platform.OS === 'android' ? DEFAULT_ANDROID : DEFAULT_IOS;
let url = (Config.API_BASE_URL || platformDefault).replace(/\/$/, '');
if (Platform.OS === 'android') {
url = url.replace(/\/\/localhost\b/gi, '//10.0.2.2');
url = url.replace(/\/\/127\.0\.0\.1\b/g, '//10.0.2.2');
}
return url;
}
export const API_BASE_URL = resolveApiBaseUrl();

View File

@ -0,0 +1,56 @@
import React, { createContext, useCallback, useContext, useEffect, useState } from 'react';
import { authApi } from '../api/auth';
import { clearTokens, getAccessToken, loadTokensFromStorage } from '../api/client';
import type { User } from '../api/types';
interface AuthContextValue {
user: User | null;
loading: boolean;
signOut: () => Promise<void>;
refreshUser: () => Promise<void>;
}
const AuthContext = createContext<AuthContextValue | null>(null);
export function AuthProvider({ children }: { children: React.ReactNode }) {
const [user, setUser] = useState<User | null>(null);
const [loading, setLoading] = useState(true);
const refreshUser = useCallback(async () => {
const token = getAccessToken();
if (!token) {
setUser(null);
return;
}
const res = await authApi.me();
if (res.data) setUser(res.data);
else setUser(null);
}, []);
useEffect(() => {
(async () => {
await loadTokensFromStorage();
if (getAccessToken()) {
await refreshUser();
}
setLoading(false);
})();
}, [refreshUser]);
const signOut = useCallback(async () => {
await clearTokens();
setUser(null);
}, []);
return (
<AuthContext.Provider value={{ user, loading, signOut, refreshUser }}>
{children}
</AuthContext.Provider>
);
}
export function useAuth() {
const ctx = useContext(AuthContext);
if (!ctx) throw new Error('useAuth must be used within AuthProvider');
return ctx;
}

View File

@ -0,0 +1,75 @@
import React from 'react';
import { ActivityIndicator, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { useAuth } from '../context/AuthContext';
import { LoginScreen } from '../screens/LoginScreen';
import { Login2FAScreen } from '../screens/Login2FAScreen';
import { EventsScreen } from '../screens/EventsScreen';
import { AttendanceSessionsScreen } from '../screens/AttendanceSessionsScreen';
import { ParticipantsScreen } from '../screens/ParticipantsScreen';
import { QrScannerScreen } from '../screens/QrScannerScreen';
import type { RootStackParamList } from './types';
import { colors } from '../theme';
import { getAccessToken } from '../api/client';
const Stack = createNativeStackNavigator<RootStackParamList>();
export function RootNavigator() {
const { loading, user } = useAuth();
const hasToken = Boolean(getAccessToken());
if (loading) {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<ActivityIndicator size="large" color={colors.primary} />
</View>
);
}
const initialRoute = user || hasToken ? 'Events' : 'Login';
return (
<NavigationContainer>
<Stack.Navigator
initialRouteName={initialRoute}
screenOptions={{
headerStyle: { backgroundColor: colors.card },
headerTintColor: colors.primaryDark,
headerTitleStyle: { fontWeight: '700', color: colors.text },
}}
>
<Stack.Screen
name="Login"
component={LoginScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Login2FA"
component={Login2FAScreen}
options={{ title: '2FA', headerShown: false }}
/>
<Stack.Screen
name="Events"
component={EventsScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="AttendanceSessions"
component={AttendanceSessionsScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Participants"
component={ParticipantsScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="QrScanner"
component={QrScannerScreen}
options={{ title: 'Scan QR', headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
);
}

19
src/navigation/types.ts Normal file
View File

@ -0,0 +1,19 @@
export type RootStackParamList = {
Login: undefined;
Login2FA: { twoFactorToken: string; email: string };
Events: undefined;
AttendanceSessions: { eventId: string; eventName: string };
Participants: {
eventId: string;
eventName: string;
attendanceId: string;
attendanceName: string;
allowDuplicate: boolean;
};
QrScanner: {
eventId: string;
attendanceId: string;
attendanceName: string;
allowDuplicate: boolean;
};
};

View File

@ -0,0 +1,125 @@
import React, { useCallback, useEffect, useState } from 'react';
import {
ActivityIndicator,
FlatList,
Pressable,
StyleSheet,
Text,
View,
} from 'react-native';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { attendancesApi } from '../api/attendances';
import type { AttendanceRecord } from '../api/types';
import type { RootStackParamList } from '../navigation/types';
import { colors, radii, spacing, typography } from '../theme';
import { Badge, Card, GradientHeader } from '../components/ui';
type Props = NativeStackScreenProps<RootStackParamList, 'AttendanceSessions'>;
export function AttendanceSessionsScreen({ navigation, route }: Props) {
const { eventId, eventName } = route.params;
const [sessions, setSessions] = useState<AttendanceRecord[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const load = useCallback(async () => {
setError(null);
const res = await attendancesApi.list(eventId);
if (res.error) {
setError(res.error);
setSessions([]);
} else {
const active = (res.data?.attendances ?? []).filter((s) => s.status === 'active');
setSessions(active);
}
}, [eventId]);
useEffect(() => {
(async () => {
setLoading(true);
await load();
setLoading(false);
})();
}, [load]);
return (
<View style={styles.wrap}>
<GradientHeader
title={eventName}
subtitle="Select an attendance session"
style={styles.header}
/>
{loading ? (
<ActivityIndicator style={styles.center} color={colors.primary} />
) : (
<FlatList
data={sessions}
keyExtractor={(item) => item._id}
contentContainerStyle={sessions.length === 0 ? styles.emptyList : styles.list}
ListEmptyComponent={
<Text style={styles.empty}>{error || 'No active attendance sessions.'}</Text>
}
renderItem={({ item }) => (
<Pressable
style={styles.cardPress}
onPress={() =>
navigation.navigate('Participants', {
eventId,
eventName,
attendanceId: item._id,
attendanceName: item.name,
allowDuplicate: Boolean(item.settings?.allowDuplicateCheckIn),
})
}
>
<Card style={styles.card}>
<View style={styles.row}>
<View style={styles.rowText}>
<Text style={styles.cardTitle}>{item.name}</Text>
<Text style={styles.cardMeta}>
{item.totalCheckedIn ?? 0} check-in
{(item.totalCheckedIn ?? 0) === 1 ? '' : 's'} ·{' '}
{item.uniqueParticipants ?? 0} people
</Text>
<View style={styles.badges}>
<Badge>{item.uniqueParticipants ?? 0} attendees</Badge>
</View>
</View>
<View style={styles.chev}>
<Text style={styles.chevText}>›</Text>
</View>
</View>
</Card>
</Pressable>
)}
/>
)}
</View>
);
}
const styles = StyleSheet.create({
wrap: { flex: 1, backgroundColor: colors.background },
header: { paddingBottom: 26 },
list: { padding: spacing.lg, paddingTop: spacing.lg },
emptyList: { flexGrow: 1, justifyContent: 'center', padding: 24 },
center: { marginTop: 32 },
cardPress: { marginBottom: 12 },
card: { borderRadius: radii.xl, borderWidth: 0 },
row: { flexDirection: 'row', alignItems: 'center', gap: 12 },
rowText: { flex: 1 },
cardTitle: { color: colors.text, fontSize: 15, fontWeight: '800', marginBottom: 6 },
cardMeta: { ...typography.small, color: colors.muted },
badges: { marginTop: 10 },
chev: {
width: 34,
height: 34,
borderRadius: 17,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(247,148,29,0.12)',
},
chevText: { color: colors.primaryDark, fontSize: 22, lineHeight: 22, fontWeight: '700' },
empty: { textAlign: 'center', color: colors.muted, fontSize: 15 },
});

View File

@ -0,0 +1,177 @@
import React, { useCallback, useState } from 'react';
import {
ActivityIndicator,
FlatList,
Pressable,
RefreshControl,
StyleSheet,
Text,
View,
} from 'react-native';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { checkinsApi } from '../api/checkins';
import type { CheckinsEvent } from '../api/types';
import { useAuth } from '../context/AuthContext';
import type { RootStackParamList } from '../navigation/types';
import { colors, radii, spacing, typography } from '../theme';
import { AvatarInitials, Badge, Card, GradientHeader } from '../components/ui';
type Props = NativeStackScreenProps<RootStackParamList, 'Events'>;
function formatDate(iso?: string) {
if (!iso) return '';
const d = new Date(iso);
if (Number.isNaN(d.getTime())) return '';
return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });
}
export function EventsScreen({ navigation }: Props) {
const { signOut, user } = useAuth();
const [events, setEvents] = useState<CheckinsEvent[]>([]);
const [loading, setLoading] = useState(true);
const [refreshing, setRefreshing] = useState(false);
const [error, setError] = useState<string | null>(null);
const load = useCallback(async () => {
setError(null);
const res = await checkinsApi.listEvents();
if (res.error) {
setError(res.error);
setEvents([]);
} else {
setEvents(res.data?.events ?? []);
}
}, []);
React.useEffect(() => {
(async () => {
setLoading(true);
await load();
setLoading(false);
})();
}, [load]);
const onRefresh = async () => {
setRefreshing(true);
await load();
setRefreshing(false);
};
const renderItem = ({ item }: { item: CheckinsEvent }) => (
<Pressable
style={styles.cardPress}
onPress={() =>
navigation.navigate('AttendanceSessions', {
eventId: item._id,
eventName: item.name,
})
}
>
<Card style={styles.card} padded>
<View style={styles.cardRow}>
<View style={styles.cardText}>
<Text style={styles.cardTitle}>{item.name}</Text>
<View style={styles.metaRow}>
<Text style={styles.cardMeta}>
{formatDate(item.startDate)}
{item.endDate && item.endDate !== item.startDate
? ` – ${formatDate(item.endDate)}`
: ''}
</Text>
</View>
{item.location ? <Text style={styles.cardMeta}>{item.location}</Text> : null}
<View style={styles.badges}>
<Badge>
{item.attendanceSessionCount} session
{item.attendanceSessionCount === 1 ? '' : 's'}
</Badge>
</View>
</View>
<View style={styles.chev}>
<Text style={styles.chevText}>›</Text>
</View>
</View>
</Card>
</Pressable>
);
return (
<View style={styles.wrap}>
<GradientHeader
title="EventBuzz"
subtitle={user?.email ? `Signed in as ${user.email}` : 'Signed in'}
right={
<Pressable onPress={signOut} hitSlop={10}>
<Text style={styles.logout}>Logout</Text>
</Pressable>
}
bottom={
<View style={styles.headerBottom}>
<AvatarInitials email={user?.email} />
<View style={styles.headerBottomText}>
<Text style={styles.headerBottomLabel}>Your Events</Text>
<Text style={styles.headerBottomCount}>
{events.length} event{events.length === 1 ? '' : 's'}
</Text>
</View>
</View>
}
/>
{loading ? (
<ActivityIndicator style={styles.center} color={colors.primary} />
) : (
<FlatList
data={events}
keyExtractor={(item) => item._id}
renderItem={renderItem}
contentContainerStyle={events.length === 0 ? styles.emptyList : styles.list}
refreshControl={
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
}
ListEmptyComponent={
<Text style={styles.empty}>
{error || 'No events with attendance sessions.'}
</Text>
}
/>
)}
</View>
);
}
const styles = StyleSheet.create({
wrap: { flex: 1, backgroundColor: colors.background },
logout: { color: 'rgba(255,255,255,0.85)', ...typography.small, fontWeight: '600' },
headerBottom: {
marginTop: 16,
flexDirection: 'row',
alignItems: 'center',
gap: 12,
},
headerBottomText: { flex: 1 },
headerBottomLabel: { color: '#fff', ...typography.h2 },
headerBottomCount: { marginTop: 2, color: 'rgba(255,255,255,0.75)', ...typography.small },
list: { padding: spacing.lg, paddingTop: spacing.lg },
emptyList: { flexGrow: 1, justifyContent: 'center', padding: 24 },
center: { marginTop: 40 },
cardPress: { marginBottom: 12 },
card: { borderRadius: radii.xl, borderWidth: 0 },
cardRow: { flexDirection: 'row', alignItems: 'flex-start', gap: 12 },
cardText: { flex: 1, minWidth: 0 },
cardTitle: { color: colors.text, fontSize: 15, fontWeight: '800', marginBottom: 8 },
metaRow: { flexDirection: 'row', alignItems: 'center', gap: 8 },
cardMeta: { color: colors.muted, fontSize: 12, marginBottom: 4 },
badges: { marginTop: 10 },
chev: {
width: 34,
height: 34,
borderRadius: 17,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'rgba(247,148,29,0.12)',
},
chevText: { color: colors.primaryDark, fontSize: 22, lineHeight: 22, fontWeight: '700' },
empty: { textAlign: 'center', color: colors.muted, fontSize: 15 },
});

View File

@ -0,0 +1,128 @@
import React, { useState } from 'react';
import {
ActivityIndicator,
KeyboardAvoidingView,
Platform,
Pressable,
StyleSheet,
Text,
View,
} from 'react-native';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { authApi } from '../api/auth';
import type { RootStackParamList } from '../navigation/types';
import { useAuth } from '../context/AuthContext';
import { colors, radii, spacing, typography } from '../theme';
import { Card, GradientHeader, PrimaryButton, TextField } from '../components/ui';
type Props = NativeStackScreenProps<RootStackParamList, 'Login2FA'>;
export function Login2FAScreen({ navigation, route }: Props) {
const { refreshUser } = useAuth();
const { twoFactorToken, email } = route.params;
const [code, setCode] = useState('');
const [error, setError] = useState<string | null>(null);
const [loading, setLoading] = useState(false);
const submit = async () => {
setError(null);
if (!code.trim()) {
setError('Enter your authenticator code');
return;
}
setLoading(true);
const res = await authApi.login2fa(twoFactorToken, code.trim());
setLoading(false);
if (res.error) {
setError(res.error);
return;
}
await refreshUser();
navigation.replace('Events');
};
return (
<KeyboardAvoidingView
style={styles.wrap}
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
>
<View style={styles.inner}>
<GradientHeader
title="Two-factor"
subtitle={`Enter the code for ${email}`}
style={styles.hero}
/>
<Card style={styles.sheet} padded={false}>
<View style={styles.sheetInner}>
{error ? (
<View style={styles.errorBox}>
<Text style={styles.errorText}>{error}</Text>
</View>
) : null}
<TextField
label="Authenticator code"
value={code}
onChangeText={setCode}
keyboardType="number-pad"
autoComplete="one-time-code"
placeholder="6-digit code"
style={styles.codeInput}
/>
<View style={styles.actions}>
<PrimaryButton title={loading ? 'Verifying…' : 'Verify'} loading={loading} onPress={submit} />
<Pressable onPress={() => navigation.goBack()} style={styles.back}>
<Text style={styles.backText}>Back to login</Text>
</Pressable>
</View>
</View>
</Card>
</View>
</KeyboardAvoidingView>
);
}
const styles = StyleSheet.create({
wrap: { flex: 1, backgroundColor: colors.background },
inner: { flex: 1 },
hero: {
paddingTop: 72,
paddingBottom: 44,
paddingHorizontal: spacing.xl,
},
sheet: {
flex: 1,
marginTop: -28,
borderTopLeftRadius: radii.xl,
borderTopRightRadius: radii.xl,
borderBottomLeftRadius: 0,
borderBottomRightRadius: 0,
borderWidth: 0,
},
sheetInner: {
flex: 1,
paddingHorizontal: spacing.xl,
paddingTop: spacing.xl,
paddingBottom: spacing.xl,
},
errorBox: {
backgroundColor: 'rgba(220,38,38,0.08)',
borderWidth: 1,
borderColor: 'rgba(220,38,38,0.18)',
borderRadius: radii.md,
paddingHorizontal: 14,
paddingVertical: 12,
marginBottom: 14,
},
errorText: { ...typography.body, color: colors.error },
codeInput: {
fontSize: 20,
letterSpacing: 4,
textAlign: 'center',
},
actions: { marginTop: 18, gap: 14 },
back: { alignItems: 'center' },
backText: { color: colors.primaryDark, ...typography.bodyEm },
});

275
src/screens/LoginScreen.tsx Normal file
View File

@ -0,0 +1,275 @@
import React, { useState } from 'react';
import {
Image,
KeyboardAvoidingView,
Platform,
Pressable,
ScrollView,
StatusBar,
StyleSheet,
Text,
useWindowDimensions,
View,
} from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { authApi } from '../api/auth';
import type { RootStackParamList } from '../navigation/types';
import { useAuth } from '../context/AuthContext';
import { colors, radii, spacing, typography } from '../theme';
import { PrimaryButton, TextField } from '../components/ui';
type Props = NativeStackScreenProps<RootStackParamList, 'Login'>;
const BRAND_ORANGE = '#F7941D';
const BRAND_ORANGE_DARK = '#E8780A';
const BUTTON_HEIGHT = 52;
const BOTTOM_BAR_PAD_Y = 16;
export function LoginScreen({ navigation }: Props) {
const { refreshUser } = useAuth();
const { height: windowHeight } = useWindowDimensions();
const insets = useSafeAreaInsets();
const heroHeight = Math.round(windowHeight * 0.42);
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [showPw, setShowPw] = useState(false);
const [error, setError] = useState<string | null>(null);
const [loading, setLoading] = useState(false);
const submit = async () => {
setError(null);
const em = email.trim();
if (!em || !password) {
setError('Email and password are required');
return;
}
setLoading(true);
let res;
try {
res = await authApi.login(em, password);
} catch {
setLoading(false);
setError('Network error. Check API URL and that the backend is running.');
return;
}
setLoading(false);
if (res.error) {
setError(res.error);
return;
}
const d = res.data;
if (d && 'requiresTwoFactor' in d && d.requiresTwoFactor) {
navigation.navigate('Login2FA', {
twoFactorToken: d.twoFactorToken,
email: d.email,
});
return;
}
await refreshUser();
navigation.replace('Events');
};
return (
<View style={styles.root}>
<StatusBar barStyle="light-content" backgroundColor={BRAND_ORANGE} />
{/* Orange hero — fixed pixel height so it always renders */}
<View style={[styles.hero, { height: heroHeight + insets.top, paddingTop: insets.top + 24 }]}>
<View style={styles.heroGradientDark} />
<View style={styles.heroCircleA} />
<View style={styles.heroCircleB} />
<View style={styles.logoCard}>
<Image
source={require('../assets/eventbuzz-logo.png')}
style={styles.logo}
resizeMode="contain"
/>
</View>
<Text style={styles.heroSubtitle}>Attendance Management</Text>
</View>
<KeyboardAvoidingView
style={styles.formArea}
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
>
<View style={styles.sheet}>
<ScrollView
keyboardShouldPersistTaps="handled"
contentContainerStyle={[
styles.sheetScroll,
{
paddingBottom:
BUTTON_HEIGHT +
BOTTOM_BAR_PAD_Y * 2 +
Math.max(insets.bottom, 16) +
18,
},
]}
showsVerticalScrollIndicator={false}
>
<Text style={styles.title}>Welcome back</Text>
<Text style={styles.sub}>Sign in to your dashboard account</Text>
{error ? (
<View style={styles.errorBox}>
<Text style={styles.errorText}>{error}</Text>
</View>
) : null}
<View style={styles.fields}>
<TextField
label="Email address"
value={email}
onChangeText={setEmail}
autoCapitalize="none"
keyboardType="email-address"
autoComplete="email"
placeholder="you@example.com"
left={<Text style={styles.fieldIcon}>✉</Text>}
/>
<TextField
label="Password"
value={password}
onChangeText={setPassword}
secureTextEntry={!showPw}
placeholder="Your password"
left={<Text style={styles.fieldIcon}>🔒</Text>}
right={
<Pressable onPress={() => setShowPw((v) => !v)} hitSlop={10}>
<Text style={styles.fieldIcon}>{showPw ? '🙈' : '👁'}</Text>
</Pressable>
}
/>
</View>
</ScrollView>
<View style={[styles.bottomBar, { paddingBottom: Math.max(insets.bottom, 16) }]}>
<PrimaryButton
title={loading ? 'Signing in…' : 'Sign In'}
loading={loading}
onPress={submit}
style={styles.signInBtn}
/>
</View>
</View>
</KeyboardAvoidingView>
</View>
);
}
const styles = StyleSheet.create({
root: {
flex: 1,
backgroundColor: BRAND_ORANGE,
},
hero: {
backgroundColor: BRAND_ORANGE,
alignItems: 'center',
justifyContent: 'flex-end',
paddingBottom: 36,
overflow: 'hidden',
},
heroGradientDark: {
position: 'absolute',
right: 0,
bottom: 0,
width: '70%',
height: '80%',
backgroundColor: BRAND_ORANGE_DARK,
opacity: 0.45,
borderTopLeftRadius: 200,
},
heroCircleA: {
position: 'absolute',
width: 176,
height: 176,
borderRadius: 88,
right: -44,
top: -36,
backgroundColor: 'rgba(255,255,255,0.12)',
},
heroCircleB: {
position: 'absolute',
width: 128,
height: 128,
borderRadius: 64,
left: -28,
bottom: 8,
backgroundColor: 'rgba(255,255,255,0.10)',
},
logoCard: {
backgroundColor: '#fff',
borderRadius: 16,
paddingHorizontal: 20,
paddingVertical: 16,
marginBottom: 14,
zIndex: 2,
shadowColor: '#000',
shadowOffset: { width: 0, height: 8 },
shadowOpacity: 0.12,
shadowRadius: 20,
elevation: 8,
},
logo: { width: 144, height: 52 },
heroSubtitle: {
color: 'rgba(255,255,255,0.85)',
fontSize: 14,
letterSpacing: 0.4,
zIndex: 2,
},
formArea: {
flex: 1,
},
sheet: {
flex: 1,
marginTop: -28,
backgroundColor: '#fff',
borderTopLeftRadius: 28,
borderTopRightRadius: 28,
shadowColor: '#000',
shadowOffset: { width: 0, height: -4 },
shadowOpacity: 0.08,
shadowRadius: 24,
elevation: 12,
overflow: 'hidden',
},
sheetScroll: {
paddingHorizontal: spacing.xl,
paddingTop: 32,
paddingBottom: 16,
},
title: { ...typography.title, color: colors.text, marginBottom: 6 },
sub: { ...typography.body, color: colors.muted, marginBottom: 24 },
fields: { gap: 16 },
fieldIcon: { fontSize: 16, color: '#9CA3AF' },
errorBox: {
backgroundColor: 'rgba(220,38,38,0.08)',
borderWidth: 1,
borderColor: 'rgba(220,38,38,0.18)',
borderRadius: radii.md,
paddingHorizontal: 14,
paddingVertical: 12,
marginBottom: 14,
},
errorText: { ...typography.body, color: colors.error },
signInBtn: {
borderRadius: 14,
shadowColor: BRAND_ORANGE,
shadowOffset: { width: 0, height: 8 },
shadowOpacity: 0.35,
shadowRadius: 16,
elevation: 6,
},
bottomBar: {
position: 'absolute',
left: 0,
right: 0,
bottom: 0,
paddingHorizontal: spacing.xl,
paddingTop: BOTTOM_BAR_PAD_Y,
backgroundColor: '#fff',
},
});

View File

@ -0,0 +1,210 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import {
ActivityIndicator,
FlatList,
Pressable,
StyleSheet,
Text,
View,
} from 'react-native';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { attendancesApi } from '../api/attendances';
import type { AttendanceCheckInResult, AttendanceSearchParticipant } from '../api/types';
import { CheckInResultModal } from '../components/CheckInResultModal';
import type { RootStackParamList } from '../navigation/types';
import { colors, radii, spacing, typography } from '../theme';
import { Card, GradientHeader, PrimaryButton, TextField } from '../components/ui';
type Props = NativeStackScreenProps<RootStackParamList, 'Participants'>;
function matchesParticipant(p: AttendanceSearchParticipant, q: string): boolean {
const needle = q.trim().toLowerCase();
if (!needle) return true;
const hay = [p.displayName, p.firstName, p.lastName, p.email, p.phone]
.filter(Boolean)
.join(' ')
.toLowerCase();
return hay.includes(needle);
}
export function ParticipantsScreen({ navigation, route }: Props) {
const { eventId, attendanceId, attendanceName, allowDuplicate } = route.params;
const [all, setAll] = useState<AttendanceSearchParticipant[]>([]);
const [searchQ, setSearchQ] = useState('');
const [loading, setLoading] = useState(true);
const [busyId, setBusyId] = useState<string | null>(null);
const [error, setError] = useState<string | null>(null);
const [result, setResult] = useState<AttendanceCheckInResult | null>(null);
const [resultError, setResultError] = useState<string | null>(null);
const [modalVisible, setModalVisible] = useState(false);
const load = useCallback(async () => {
setError(null);
const res = await attendancesApi.searchParticipants(eventId, attendanceId);
if (res.error) {
setError(res.error);
setAll([]);
} else {
setAll(res.data?.participants ?? []);
}
}, [eventId, attendanceId]);
useEffect(() => {
const unsub = navigation.addListener('focus', () => {
load();
});
(async () => {
setLoading(true);
await load();
setLoading(false);
})();
return unsub;
}, [navigation, load]);
const displayed = useMemo(
() => all.filter((p) => matchesParticipant(p, searchQ)),
[all, searchQ],
);
const checkIn = async (participantId: string) => {
setBusyId(participantId);
setResultError(null);
const res = await attendancesApi.checkIn(eventId, attendanceId, participantId);
setBusyId(null);
if (res.error) {
setResult(null);
setResultError(res.error);
setModalVisible(true);
return;
}
setResult(res.data ?? null);
setResultError(null);
setModalVisible(true);
await load();
};
const closeModal = () => {
setModalVisible(false);
setResult(null);
setResultError(null);
};
return (
<View style={styles.wrap}>
<GradientHeader
title={attendanceName}
subtitle={
searchQ.trim()
? `${displayed.length} of ${all.length} shown`
: `${all.length} participant${all.length === 1 ? '' : 's'}`
}
style={styles.header}
bottom={
<TextField
value={searchQ}
onChangeText={setSearchQ}
placeholder="Filter by name, email, phone…"
containerStyle={styles.searchContainer}
/>
}
/>
{loading ? (
<ActivityIndicator style={styles.center} color={colors.primary} />
) : (
<FlatList
data={displayed}
keyExtractor={(item) => item._id}
contentContainerStyle={displayed.length === 0 ? styles.emptyList : styles.list}
ListEmptyComponent={
<Text style={styles.empty}>{error || 'No participants found.'}</Text>
}
renderItem={({ item }) => {
const canCheckIn = !item.alreadyCheckedIn || allowDuplicate;
return (
<Card style={styles.rowCard} padded={false}>
<View style={styles.row}>
<View style={styles.rowText}>
<Text style={styles.name}>{item.displayName}</Text>
<Text style={styles.meta}>
{[item.email, item.phone].filter(Boolean).join(' · ') || '—'}
</Text>
{item.alreadyCheckedIn ? (
<Text style={styles.checked}>Already checked in</Text>
) : null}
</View>
<Pressable
style={[styles.checkBtn, !canCheckIn && styles.checkBtnOff]}
disabled={!canCheckIn || busyId === item._id}
onPress={() => checkIn(item._id)}
>
{busyId === item._id ? (
<ActivityIndicator color="#fff" size="small" />
) : (
<Text style={styles.checkBtnText}>
{item.alreadyCheckedIn && allowDuplicate ? 'Again' : 'Check in'}
</Text>
)}
</Pressable>
</View>
</Card>
);
}}
/>
)}
<View style={styles.bottomBar}>
<PrimaryButton
title="Scan QR"
onPress={() =>
navigation.navigate('QrScanner', {
eventId,
attendanceId,
attendanceName,
allowDuplicate,
})
}
/>
</View>
<CheckInResultModal
visible={modalVisible}
result={result}
error={resultError}
onClose={closeModal}
/>
</View>
);
}
const styles = StyleSheet.create({
wrap: { flex: 1, backgroundColor: colors.background },
header: { paddingBottom: 18 },
searchContainer: { marginTop: 14 },
list: { paddingHorizontal: spacing.lg, paddingBottom: 120, paddingTop: spacing.lg },
emptyList: { flexGrow: 1, justifyContent: 'center', padding: 24 },
center: { marginTop: 32 },
rowCard: { marginBottom: 10, borderRadius: radii.xl, borderWidth: 0 },
row: { flexDirection: 'row', alignItems: 'center', padding: 14, gap: 12 },
rowText: { flex: 1, marginRight: 10 },
name: { color: colors.text, fontSize: 15, fontWeight: '800' },
meta: { ...typography.small, color: colors.muted, marginTop: 4 },
checked: { ...typography.small, color: colors.success, marginTop: 6, fontWeight: '700' },
checkBtn: {
backgroundColor: colors.primaryDark,
paddingHorizontal: 14,
paddingVertical: 11,
borderRadius: radii.md,
minWidth: 88,
alignItems: 'center',
},
checkBtnOff: { backgroundColor: colors.disabled },
checkBtnText: { color: '#fff', fontWeight: '700', fontSize: 14 },
empty: { textAlign: 'center', color: colors.muted },
bottomBar: {
position: 'absolute',
left: spacing.lg,
right: spacing.lg,
bottom: 18,
},
});

View File

@ -0,0 +1,186 @@
import React, { useCallback, useRef, useState } from 'react';
import { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-native';
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import {
Camera,
useCameraDevice,
useCameraPermission,
useCodeScanner,
} from 'react-native-vision-camera';
import { attendancesApi } from '../api/attendances';
import type { AttendanceCheckInResult } from '../api/types';
import { CheckInResultModal } from '../components/CheckInResultModal';
import type { RootStackParamList } from '../navigation/types';
import { parseParticipantIdFromQr } from '../utils/parseParticipantQr';
import { colors, radii, spacing, typography } from '../theme';
import { PrimaryButton } from '../components/ui';
type Props = NativeStackScreenProps<RootStackParamList, 'QrScanner'>;
export function QrScannerScreen({ navigation, route }: Props) {
const { eventId, attendanceId, attendanceName } = route.params;
const { hasPermission, requestPermission } = useCameraPermission();
const device = useCameraDevice('back');
const scannedRef = useRef(false);
const [processing, setProcessing] = useState(false);
const [result, setResult] = useState<AttendanceCheckInResult | null>(null);
const [resultError, setResultError] = useState<string | null>(null);
const [modalVisible, setModalVisible] = useState(false);
const handleScan = useCallback(
async (raw: string) => {
if (scannedRef.current || processing) return;
const parsed = parseParticipantIdFromQr(raw);
if ('error' in parsed) {
scannedRef.current = true;
setResult(null);
setResultError(parsed.error);
setModalVisible(true);
return;
}
scannedRef.current = true;
setProcessing(true);
setResultError(null);
const res = await attendancesApi.checkIn(eventId, attendanceId, parsed.participantId);
setProcessing(false);
if (res.error) {
setResult(null);
setResultError(res.error);
} else {
setResult(res.data ?? null);
setResultError(null);
}
setModalVisible(true);
},
[eventId, attendanceId, processing],
);
const codeScanner = useCodeScanner({
codeTypes: ['qr'],
onCodeScanned: (codes) => {
const value = codes[0]?.value;
if (value) handleScan(value);
},
});
const closeModal = () => {
setModalVisible(false);
setResult(null);
setResultError(null);
scannedRef.current = false;
if (result && !resultError) {
navigation.goBack();
}
};
if (!hasPermission) {
return (
<View style={styles.centered}>
<Text style={styles.msg}>Camera permission is required to scan QR codes.</Text>
<View style={styles.actions}>
<PrimaryButton title="Grant permission" onPress={requestPermission} />
<Pressable onPress={() => navigation.goBack()} style={styles.linkBtn}>
<Text style={styles.link}>Cancel</Text>
</Pressable>
</View>
</View>
);
}
if (!device) {
return (
<View style={styles.centered}>
<Text style={styles.msg}>No camera device available.</Text>
<Pressable onPress={() => navigation.goBack()}>
<Text style={styles.link}>Go back</Text>
</Pressable>
</View>
);
}
return (
<View style={styles.wrap}>
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={!modalVisible}
codeScanner={codeScanner}
/>
<View style={styles.overlay}>
<View style={styles.topPill}>
<Text style={styles.title}>{attendanceName}</Text>
<Text style={styles.hint}>Point at participant badge QR</Text>
{processing ? (
<ActivityIndicator color="#fff" size="large" style={styles.spinner} />
) : null}
</View>
</View>
<View style={styles.bottom}>
<Pressable style={styles.cancel} onPress={() => navigation.goBack()}>
<Text style={styles.cancelText}>Cancel</Text>
</Pressable>
</View>
<CheckInResultModal
visible={modalVisible}
result={result}
error={resultError}
onClose={closeModal}
/>
</View>
);
}
const styles = StyleSheet.create({
wrap: { flex: 1, backgroundColor: '#000' },
overlay: {
position: 'absolute',
top: 48,
left: 0,
right: 0,
alignItems: 'center',
},
topPill: {
width: '92%',
paddingHorizontal: 18,
paddingVertical: 14,
borderRadius: radii.xl,
backgroundColor: 'rgba(0,0,0,0.45)',
borderWidth: 1,
borderColor: 'rgba(255,255,255,0.18)',
alignItems: 'center',
},
title: { color: '#fff', ...typography.h3 },
hint: { color: 'rgba(255,255,255,0.85)', ...typography.body, marginTop: 6 },
spinner: { marginTop: 16 },
bottom: {
position: 'absolute',
left: spacing.lg,
right: spacing.lg,
bottom: 22,
},
cancel: {
paddingHorizontal: 24,
paddingVertical: 14,
backgroundColor: 'rgba(0,0,0,0.55)',
borderRadius: radii.md,
alignItems: 'center',
borderWidth: 1,
borderColor: 'rgba(255,255,255,0.16)',
},
cancelText: { color: '#fff', ...typography.bodyEm },
centered: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 24,
backgroundColor: colors.background,
},
msg: { fontSize: 16, color: colors.text, textAlign: 'center', marginBottom: 20 },
actions: { width: '100%', gap: 14 },
linkBtn: { alignItems: 'center', paddingVertical: 6 },
link: { color: colors.primaryDark, ...typography.bodyEm },
});

70
src/theme.ts Normal file
View File

@ -0,0 +1,70 @@
export const colors = {
// Brand (orange gradient theme, per redesign reference)
primary: '#F7941D',
primaryDark: '#E8780A',
navy: '#16213E',
// Surfaces / text
background: '#F5F6F8', // close to redesign's light gray canvas
card: '#FFFFFF',
text: '#111827',
muted: '#6B7280',
border: 'rgba(17, 24, 39, 0.10)',
// Status
success: '#16A34A',
error: '#DC2626',
disabled: '#D1D5DB',
};
export const spacing = {
xs: 6,
sm: 10,
md: 14,
lg: 18,
xl: 24,
'2xl': 32,
} as const;
export const radii = {
sm: 10,
md: 14,
lg: 18,
xl: 24,
pill: 999,
} as const;
export const typography = {
title: { fontSize: 22, fontWeight: '700' as const },
h2: { fontSize: 18, fontWeight: '700' as const },
h3: { fontSize: 16, fontWeight: '700' as const },
body: { fontSize: 15, fontWeight: '400' as const },
bodyEm: { fontSize: 15, fontWeight: '600' as const },
small: { fontSize: 13, fontWeight: '500' as const },
} as const;
export const shadows = {
card: {
ios: {
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.08,
shadowRadius: 12,
},
android: { elevation: 3 },
},
raised: {
ios: {
shadowColor: '#000',
shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.12,
shadowRadius: 16,
},
android: { elevation: 5 },
},
} as const;
export const gradients = {
brand: [colors.primary, colors.primaryDark] as const,
navy: ['#1A1A2E', colors.navy, '#0F3460'] as const,
} as const;

7
src/types/react-native-config.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
declare module 'react-native-config' {
export interface NativeConfig {
API_BASE_URL?: string;
}
export const Config: NativeConfig;
export default Config;
}

View File

@ -0,0 +1,28 @@
export function parseParticipantIdFromQr(data: string): { participantId: string } | { error: string } {
const raw = String(data || '').trim();
if (!raw) return { error: 'Empty QR code' };
const prefix = 'eventbuzz:';
if (raw.toLowerCase().startsWith(prefix)) {
const parts = raw.split(':');
if (parts.length < 3) return { error: 'Invalid EventBuzz QR format' };
const kind = parts[1].toLowerCase();
const id = parts.slice(2).join(':').trim();
if (kind === 'faculty') {
return { error: 'This QR is for faculty, not a participant check-in' };
}
if (kind !== 'participant') {
return { error: `Unsupported QR type: ${kind}` };
}
if (!/^[a-fA-F0-9]{24}$/.test(id)) {
return { error: 'Invalid participant id in QR code' };
}
return { participantId: id };
}
if (/^[a-fA-F0-9]{24}$/.test(raw)) {
return { participantId: raw };
}
return { error: 'Unrecognized QR code format' };
}

8
tsconfig.json Normal file
View File

@ -0,0 +1,8 @@
{
"extends": "@react-native/typescript-config",
"compilerOptions": {
"types": ["jest"]
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["**/node_modules", "**/Pods"]
}