Skip to content

k-zehnder/gophersignal

Repository files navigation

gophersignal

Getting Started

  1. Clone the Repository:

    git clone https://github.com/k-zehnder/gophersignal.git
    cd gophersignal
  2. Configure Environment: Copy the example environment file and edit it with your preferences:

    cp .env.example .env 

    Obtain API Keys: To use third-party services, you need to obtain API keys. Follow these steps to get your API keys:

    • Hugging Face API Key: Visit Hugging Face to create an account and obtain your API key. Set it as HUGGING_FACE_API_KEY in your .env file.
    • OpenAI API Key: Visit OpenAI to create an account and obtain your API key. Set it as OPEN_AI_API_KEY in your .env file.
  3. Launch Services with Docker:

    make dev_env
  4. Determine the MySQL Container ID: Find the running MySQL container ID using the following command:

    docker ps | grep mysql | awk '{print $1}'
  5. Access the MySQL Container: Replace <CONTAINER_ID> with the ID from the previous command, then execute the following command to access the container's bash shell:

    docker exec -it <CONTAINER_ID> mysql -u user -p
  6. Create the Database and Tables: Inside the MySQL shell, you can directly create the database and tables using the following SQL commands:

    CREATE DATABASE IF NOT EXISTS gophersignal;
    USE gophersignal;
    
    CREATE TABLE IF NOT EXISTS articles (
        id INT AUTO_INCREMENT PRIMARY KEY,
        title VARCHAR(255) NOT NULL,
        link VARCHAR(512) NOT NULL,
        content TEXT,
        summary VARCHAR(2000),
        source VARCHAR(100) NOT NULL,
        created_at TIMESTAMP NOT NULL,
        updated_at TIMESTAMP NOT NULL
    );
  7. Exit the MySQL Shell: Once you have set up your database, you can exit the MySQL shell by typing:

    exit
  8. Setting up Development Data: To initialize the development data, such as scraping and summarizing information with HuggingFace, execute the following command on the host environment:

    make setup_dev_env HUGGING_FACE_API_KEY=<key> MYSQL_DSN=<dsn>

Your development environment should now be running.

Accessing the Application

  • Frontend: Visit http://localhost:3000 to view the frontend.
  • Swagger UI: Access the API documentation at http://localhost:8080/swagger/index.html.

About

Gopher Signal uses smart technology to quickly summarize important points from HackerNews.com articles. https://gophersignal.com

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published