Skip to content

A full stack starter with routing,toasts, Nodejs+expressjs backend,mongodb database,firebase auth

License

Notifications You must be signed in to change notification settings

tejartr7/full-stack-expo-react-native-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Full Stack Expo React Native Starter

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.

Table of Contents

Features

  • User authentication using Firebase
  • User management (add, get, update)
  • Product management (add, get, update, delete)
  • Responsive design with React Native

Technologies Used

  • 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

Getting Started

Frontend Setup

  1. Clone the repository:

    git clone https://github.com/tejartr7/full-stack-expo-react-native-starter.git 
    cd full-stack-expo-react-native-starter/frontend 
  2. Install dependencies:

    npm install 
  3. Run the app:

    expo start 

Backend Setup

  1. Navigate to the backend folder:

    cd full-stack-expo-react-native-starter/backend 
  2. Install dependencies:

    npm install 
  3. Create a .env file in the backend 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 
    
  4. Run the server:

    npm start 

Environment Variables

The backend requires several environment variables, which can be obtained from the Firebase Console. Here's how to get them:

  1. MONGO_URI: Your MongoDB connection string.
  2. 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

Usage

  • 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.

API Endpoints

User Routes

  • 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.

Product Routes

  • 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.

Contributing

Contributions are welcome! If you have suggestions for improvements or features, please create a pull request or open an issue.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A full stack starter with routing,toasts, Nodejs+expressjs backend,mongodb database,firebase auth

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published