This repository contains an Expo project with Firebase Authentication implemented. It provides a basic setup for integrating Firebase Authentication into your Expo project, allowing users to sign up, sign in, and sign out using google account.
To get started with this project, follow the steps below:
- Clone this repository to your local machine.
- Install Expo CLI globally by running the following command:
npm i -g expo-cli
- Navigate to the project directory and install the dependencies by running:
npm i
- Register android application with
com.fasttech.bms
as android package and downloadgoogle-services.json
file. After completion of registration, installeas-cli
globally for generating application buildnpm i -g eas-cli
- Fetch SHA256 using following command
eas credentials
- Now add the certificate fingerprint in firebase console under Project settings > General > Your apps >
com.fasttech.bms
> Add fingerprint. - Once done install expo app from the app store on testing device/emulator and run
to generate development build locally, as it uses react-native-firebase and this can be later used in further development of app.
eas build --profile development --platform android --local
- Once finished install the
apk file
on testing device.
Before running the project, make sure you have following environment variables in a .env file present in the root folder.
- FIREBASE_WEB_CLIENT_ID: client > oauth_client > client_id of client_type 3. This can be found in
google-services.json
. - GRAPHQL_API_URL: Backend Graphql API url.
- Scan the QR code on expo app, generated using
npx expo start --dev-client
- After scanning the QR code, it should open the generated development build which we manually installed.
| NOTE: If the development build fails locally due to google-service.json
being not found by EAS, comment out google-services.json
temporarily in .gitgnore
and make sure google-services.json
is present in root directory |
The project follows barrel exports as a standard. The structure is as follows:
App.tsx
: The main entry point of the Expo app.src/components
: Contains reusable UI components.src/__generated__
: Contains auto-generated typings from graphql server.src/screens
: Contains the screens of the app.src/navigation
: Contains the navigation configuration.src/context
: Contains the context for managing the user authentication state.src/utils
: Contains the utility functions for authentication, firebase, authentication, custom helper functions and constants.src/types
: Contains typings used by components and functions across the project.src/tailwind
: Contains configuration related to tailwind package twrnc.src/graphql
: Contains queries and mutations used in graphql.
Contributions to this project are welcome. If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
When contributing, please follow the existing code style and ensure that your changes are well-documented and tested.