Code Monkey home page Code Monkey logo

rsg_hub's Introduction

RSG Hub ๐Ÿš€

RSG Hub is a comprehensive platform for extracting and displaying blog post data using a backend written in Python and a frontend built with React Native. The backend processes and serves the blog post data, while the React Native app displays the posts in an interactive and user-friendly manner. This is a work in progress, and this README is aspirational. To run the program, run main.py. There is no complete front end, but the backend logic is functional.

Project Structure ๐Ÿ“

rsg_hub/ โ”œโ”€โ”€ backend/ โ”‚ โ”œโ”€โ”€ config/ โ”‚ โ”‚ โ”œโ”€โ”€ init.py โ”‚ โ”‚ โ”œโ”€โ”€ config_loader.py โ”‚ โ”‚ โ”œโ”€โ”€ config.yaml โ”‚ โ”œโ”€โ”€ data/ โ”‚ โ”‚ โ”œโ”€โ”€ clean/ โ”‚ โ”‚ โ”œโ”€โ”€ raw/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ blog_posts.json โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ blog_posts_extracted.json โ”‚ โ”œโ”€โ”€ logs/ โ”‚ โ”‚ โ”œโ”€โ”€ app.log โ”‚ โ”‚ โ”œโ”€โ”€ blog.log โ”‚ โ”‚ โ”œโ”€โ”€ error.log โ”‚ โ”‚ โ”œโ”€โ”€ resolute_cleaner.log โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ init.py โ”‚ โ”‚ โ”œโ”€โ”€ resolute_cleaner.py โ”‚ โ”‚ โ”œโ”€โ”€ resolute_extractor.py โ”‚ โ”‚ โ”œโ”€โ”€ resolute_scraper.py โ”‚ โ”‚ โ”œโ”€โ”€ server.py โ”‚ โ”œโ”€โ”€ .env โ”‚ โ”œโ”€โ”€ .env.template โ”‚ โ”œโ”€โ”€ requirements.txt โ”œโ”€โ”€ react-native-app/ โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ BlogPosts.js โ”‚ โ”‚ โ”œโ”€โ”€ App.js โ”‚ โ”œโ”€โ”€ package.json โ”œโ”€โ”€ .gitignore โ”œโ”€โ”€ Dockerfile โ”œโ”€โ”€ main.py โ”œโ”€โ”€ README.md โ”œโ”€โ”€ setup.py

Prerequisites ๐Ÿ“‹

  • Docker
  • Node.js and npm
  • Python 3.9 or later

Setup ๐Ÿ› ๏ธ

Backend Setup

  1. Navigate to the backend directory:

    cd rsg_hub/backend
  2. Install the required Python packages:

    pip install -r requirements.txt
  3. Run the Python extraction script:

    python main.py
  4. Start the Flask server:

    python src/server.py

React Native App Setup

  1. Navigate to the rsg_hub_app directory:

    cd rsg_hub/rsg_hub_app
  2. Install the required npm packages:

    npm install
  3. Run the React Native app:

    npx react-native run-android
    
    or
    
    npx react-native run-ios

Docker Setup ๐Ÿณ

Run the setup script to build and run the Docker containers for both the backend and the app:

./setup_docker.sh

Usage ๐Ÿš€

Backend: The Flask server will be running on port 5000 and can be accessed at http://localhost:5000/data/blog_posts.

App: The Metro Bundler will be running on port 8081. Ensure your mobile device or emulator is connected to the same network as your development machine.

Example API Endpoint

Get Blog Posts: GET /data/blog_posts

Environment Variables ๐ŸŒ

Ensure you have a .env file in the backend directory with the necessary environment variables:

OPENAI_API_KEY=your_openai_api_key SMART_LLM=GPT-4o TEMPERATURE=0

Development ๐Ÿง‘โ€๐Ÿ’ป

Adding New Features Backend: Add new features to the backend by modifying the scripts in the src directory. Ensure you update the Flask server endpoints as needed.

Frontend: Add new components or update existing ones in the react-native-app/src/components directory.

Logging ๐Ÿ“œ

Logs are stored in the backend/logs directory. Ensure you monitor these logs for any errors or important information.

Contributing ๐Ÿค

Fork the repository. Create a new branch (git checkout -b feature-branch). Commit your changes (git commit -m 'Add new feature'). Push to the branch (git push origin feature-branch). Create a new Pull Request. License ๐Ÿ“„ This project is for RSG use only

Contact ๐Ÿ“ฌ

For any questions or support, please open an issue on GitHub or contact the maintainer.

Happy coding! ๐ŸŽ‰

Instructions for Usage

  1. Clone the repository:

    git clone <https://github.com/rsgTom/rsg_hub.git>
    cd rsg_hub
  2. Run the setup script:

    ./setup_docker.sh
  3. Access the backend:

    Open a browser and navigate to http://localhost:5000/data/blog_posts.

  4. Run the App:

    Connect your mobile device or start an emulator.

    cd rsg_hub_app
    npx react-native run-android

    or

    npx react-native run-ios

By following these instructions, you should be able to set up and run both the backend and the frontend of your project seamlessly. Let me know if you need any further adjustments or additional details!

rsg_hub's People

Contributors

rsgtom avatar

Watchers

Kostas Georgiou avatar  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.