-
Clone the Repository:
git clone https://github.com/k-zehnder/gophersignal.git cd gophersignal
-
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.
- Hugging Face API Key: Visit Hugging Face to create an account and obtain your API key. Set it as
-
Launch Services with Docker:
make dev_env
-
Determine the MySQL Container ID: Find the running MySQL container ID using the following command:
docker ps | grep mysql | awk '{print $1}'
-
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
-
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 );
-
Exit the MySQL Shell: Once you have set up your database, you can exit the MySQL shell by typing:
exit
-
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.
- Frontend: Visit
http://localhost:3000
to view the frontend. - Swagger UI: Access the API documentation at
http://localhost:8080/swagger/index.html
.