GithubHelp home page GithubHelp logo

celes_assignment's Introduction

**

Celes Assignment

Overview

Celes Assignment is a Python-based project developed to create authenticated endpoints that perform queries on a dataset of parquet files. The project leverages FastAPI for building APIs and Firebase for authentication, ensuring secure and efficient data handling.

Prerequisites

  • Python (preferably the latest version)
  • Firebase Account
  • FastAPI
  • Uvicorn
  • Pytest for running unit tests

Setting Up Firebase Authentication

  1. Create a Firebase Project: Go to the Firebase Console and create a new project.

  2. Download Credentials:

    • Navigate to the Project settings > Service accounts.
    • Click on "Generate new private key" and download the credentials.json file.
    • Place this file in the root directory of the project.
  3. Create Verified User:

    • In Firebase, set up authentication (Email/Password) and create a user.
    • Store the user's email and password in a .env file in the root directory of the project with the keys FIREBASE_USERNAME and FIREBASE_PASSWORD.

Setting Up Firebase Configuration

  1. Retrieve Firebase Configuration Data:

    • Go to the Firebase Console.
    • Select your project.
    • Click on the gear icon next to "Project Overview" and choose "Project settings".
    • Under "Your apps", select the app for which you want the configuration.
    • Here, you'll find your Firebase configuration object (firebaseConfig).
  2. Create Firebase Configuration File:

    • Create a file named firebase_config.py in the celes_microservice folder of your project.

    • Copy your Firebase configuration data into this file in the following format:

      pythonCopy code

      # celes_microservice/firebase_config.py firebaseConfig = { "apiKey": "your-api-key", "authDomain": "your-project-id.firebaseapp.com", "projectId": "your-project-id", "storageBucket": "your-project-id.appspot.com", "messagingSenderId": "your-messaging-sender-id", "appId": "your-app-id", "databaseURL": "your-database-url" }

    • Replace the placeholder values with your actual Firebase project settings.

  3. Using Firebase Configuration in Your Application:

    • Import this configuration into your application wherever you need to initialize Firebase:

      pythonCopy code

      `from .firebase_config import firebaseConfig

  4. Securing Configuration Data:

    • Remember that your Firebase configuration data, especially the apiKey, should be handled securely.
    • Avoid exposing these details in public repositories or unsecured files.

Installation and Setup

  1. Clone the Repository:

    bashCopy code

    git clone <repository_url> cd <repository_name>

  2. Install Dependencies:

    bashCopy code

    pip install -r requirements.txt

  3. Set Up Environment Variables:

    • Ensure the .env file is correctly configured with Firebase credentials.
  4. Run the Application:

    • Start the FastAPI application using Uvicorn:

      bashCopy code

      uvicorn api_queries:app --reload

Data Files

Store the parquet data files in the relative path '/resources/data_files'.

Running Tests

To verify that all endpoints are functioning as expected:

  1. Execute Unit Tests:

    bashCopy code

    pytest unit_tests.py

  2. Test Results:

    • Review the output of pytest to ensure all tests pass successfully.

Usage

Once the microservice is up and running, the authenticated endpoints can be accessed and integrated into any user interface or system that requires data querying capabilities on the parquet dataset.

**

celes_assignment's People

Contributors

samir221 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.