Skip to content

Project for the Bio X AI Hackathon. All about resurrecting old abandonware repos, and reducing the effort to get them up and running again.

License

Notifications You must be signed in to change notification settings

matthew-mcateer/rescuerepo

Repository files navigation

Contributors Forks Stargazers Issues Apache License LinkedIn Maintainability Rating Technical Debt Lines of Code Code Smells Security Rating Bugs Vulnerabilities Duplicated Lines (%) Reliability Rating


hackathon-cover

RescueRepo

Project originally built for the Bio X AI Hackathon. All about resurrecting old abandonware repos, and reducing the effort to get them up and running again.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

A project built for resurrecting the countless abandonware repos littering GitHub. The goal is to make it easier to turn any repo, no matter how old, and turn it into a working GitHub Codespace.

rescuerepo_demo_video.mp4

(back to top)

Built With

architecture-image

(back to top)

Getting Started

For running this project locally, you can skip ahead to the Usage section.

To get a local copy up and running follow these simple steps:

Prerequisites

Here is a list of prerequisites you need to install before you can start using the examples in this repo.

  • python 3.9 or later
  • node 14.17.0 or later
  • NPX 7.19.1 or later

Installation

  1. First, Fork/Clone the repository.

Using HTTPS:

git clone https://github.com/matthew-mcateer/rescuerepo.git

or using the GitHub CLI:

gh repo clone matthew-mcateer/rescuerepo
  1. Obtain the following API keys, and put them in a .env file in the api directory of the project. You can use the api/.env.example file as a template.

your SUPABASE_URL and SUPABASE_ANON_KEYk from your Supabase account

export SUPABASE_URL=<your-supabase-url>
export SUPABASE_ANON_KEY=<your-supabase-anon-key>

your OpenAI API key

export OPENAI_API_KEY=<your-api-key>

your Anthropic API key

export ANTHROPIC_API_KEY=<your-api-key>

Your GitHub access token (classic) (make sure it has the codespaceand repo scopes):

export GH_ACCESS_TOKEN=<your-api-key>
Getting your properly-scoped GitHub Access token (click to expand)
  • First, log in to your GitHub account.

  • Click on your profile photo in the upper right corner of any page.

  • From the dropdown menu, select "Settings."

  • On the settings page, find "Developer settings" at the bottom of the left-hand side menu and click it.

  • Now you should see "Personal access tokens" on the left-hand side menu, click it (click the "classic" tokens).

  • Click "Generate new token" on the Personal access tokens page.

  • In the "Note" field, enter a descriptive name for this token that will help you recognize its purpose later (e.g., "Token for forking and Codespaces").

  • To choose the required permissions, you'll need to select the following scopes:

    • For forking repositories, you will need the "repo" scope which includes 'public_repo' and others.
    • To create GitHub Codespaces, you will need the 'codespaces' scope which will allow "full access to managing user codespaces." Therefore, you should select both 'repo' and 'codespaces'.
  • Scroll down and click "Generate token" at the bottom of the page.

  • After you click the "Generate token" button, GitHub will display your new personal access token. Make sure you copy this token value and store it in a secure location. GitHub will not show the token to you again.

Your CELERY_BROKER_URL:

export CELERY_BROKER_URL=<your-api-key>
Getting your CELERY_BROKER_URL (click to expand)

If you're using RabbitMQ, you can use export CELERY_BROKER_URL=pyamqp://guest@localhost//. The demo version of this project is using a CloudAMQP instance from Heroku (the free "Little Lemur" tier).

Or if you're using redis, you can use docker run -d -p 6379:6379 redis && export CELERY_BROKER_URL=redis://localhost:6379/0.

Your POSTMARK_API_KEY:

export POSTMARK_API_KEY=<your-api-key>
Getting your POSTMARK_API_KEY (click to expand)

Set up a https://postmarkapp.com/ account, and see the developer documentation.

  1. Once you've added your API keys to the file api/.env, you can set the environment variable with the following command:
$ export $(cat api/.env | xargs)
  1. Install the python dependencies.
$ python3.9 -m venv env
$ source env/bin/activate
(env)$ pip install -r requirements.txt
  1. Make sure that you have npx installed, and install the frontend dependencies:
$ npm install -g npx
$ npm install
  1. (OPTIONAL): Start up the Celery worker in one terminal window (separate from the one in the next step):
$ (env)$ celery --app api.tasks worker --loglevel INFO
  1. In a terminal window, run the NextJS front-end (which concurrently starts up the server-side FastAPI backend):
$ npm run dev
  1. Navigate to http://localhost:3000 to see the app running in your browser.

frontend-view

  1. (OPTIONAL): navigate to http://localhost:8000/api/docs to see the FastAPI docs.

backend-view

(back to top)

Usage

In order to start this project locally, you'll need to start the frontend and then the backend.

First, follow the installation instructions above.

Navigate to http://localhost:3000 to see the app running in your browser.

Sign into GitHub, after which you'll be greeted with the below page.

initial-page

You can enter in a GitHub repo URL of your choice. At the moment the default is https://github.com/lucidrains/progen.

Include with this information your GitHub Access token (make sure it has the repos and codespaces scopes enabled), as well as your email.

This will trigger the creation of the GitHub codespace.

If you navigate to the GitHub Codespaces Dashboard, you should see it being created (will resemble the below).

final-page

And if you load the codespace, you should be able to access it through VSCode or in the browser

in-the-codespace-page

Roadmap

The scope of this project is admittedly quite large, so we've broken it down into a few phases:

  • ✅ Embedding Map of Bioinformatics tools ( view here, see the notebook for its creation here )
  • ✅ Setting up a workflow for generating dev environments from an arbitrary repo
    • ✅ Creating a fork with a dockerfile, devcontainer.json, and anything else needed for a GitHub Codespace
    • ✅ Automatically Generated Dev Environments using GPT-4 (or Claude 100k)
    • 🚧 Get running environments built without error >50% of the time
  • ✅ Automatically Refactoring Code using GPT-4 (or Claude 100k)
  • 🚧 Translating languages using GPT-4 (or Claude 100k)
    • ✅ Nextflow-to-Flyte Translaton
    • 🚧 Nextflow-to-Snakemake Translaton
    • 🚧 Nextflow-to-Redun Translaton
    • 🚧 Nextflow-to-CWL Translaton
    • 🚧 MATLAB-to-Python Translaton
  • 🚧 Improving the UI/UX of the above.

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Matthew Mcateer (Author) - @MatthewMcAteer0 - [email protected]

Project Link: https://github.com/matthew-mcateer/rescuerepo

(back to top)

Acknowledgments

We'd like to thank everyone for their contributions to this project and the hackathon.

We would also like to thank the organizers of the Bio X AI Hackathon for putting on such a great event.

hackathon-cover

(back to top)

Quality Gate Status