This project is a full-stack application built with React Native for the frontend and Express.js with MongoDB for the backend. It features user authentication using Firebase and provides a simple API for managing users and products.
- Features
- Technologies Used
- Getting Started
- Environment Variables
- Usage
- API Endpoints
- Contributing
- License
- User authentication using Firebase
- User management (add, get, update)
- Product management (add, get, update, delete)
- Responsive design with React Native
- React Native (Expo)
- Express.js
- MongoDB
- Firebase Authentication
- dotenv for environment variable management
- Helmet for security
- CORS for cross-origin requests
- Compression for performance optimization
-
Clone the repository:
git clone https://github.com/tejartr7/full-stack-expo-react-native-starter.git cd full-stack-expo-react-native-starter/frontend
-
Install dependencies:
npm install
-
Run the app:
expo start
-
Navigate to the backend folder:
cd full-stack-expo-react-native-starter/backend
-
Install dependencies:
npm install
-
Create a
.env
file in thebackend
folder and add the following environment variables:MONGO_URI=your_mongo_connection_string private_key_id=your_private_key_id client_email=your_client_email client_id=your_client_id auth_uri=your_auth_uri token_uri=your_token_uri universe_domain=your_universe_domain
-
Run the server:
npm start
The backend requires several environment variables, which can be obtained from the Firebase Console. Here's how to get them:
- MONGO_URI: Your MongoDB connection string.
- Firebase Service Account:
- Go to the Firebase Console.
- Navigate to Project Settings > Service accounts.
- Click on Generate new private key to download the JSON file.
- Extract the following fields from the downloaded JSON:
private_key_id
client_email
client_id
auth_uri
token_uri
universe_domain
- The frontend application is a mobile application built with React Native. Users can register, login, and manage their profiles.
- The backend API provides endpoints for user and product management, secured with Firebase authentication.
- GET
/user/getUser
- Get the authenticated user. - POST
/user/addUser
- Add a new user. - GET
/user/getAllUsers
- Retrieve all users. - PUT
/user/updateUser/:id
- Update a user by ID.
- GET
/products
- Get all products. - POST
/products/addProduct
- Add a new product. - PUT
/products/updateProduct/:id
- Update a product by ID. - DELETE
/products/deleteProduct/:id
- Delete a product by ID. - GET
/products/:id
- Get a product by ID.
Contributions are welcome! If you have suggestions for improvements or features, please create a pull request or open an issue.
This project is licensed under the MIT License. See the LICENSE file for details.