<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: HansTognon</title>
    <description>The latest articles on DEV Community by HansTognon (@hanstognon).</description>
    <link>https://dev.to/hanstognon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F427618%2F11131ebd-0299-4c18-8e39-311bbbbf5ea7.png</url>
      <title>DEV Community: HansTognon</title>
      <link>https://dev.to/hanstognon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hanstognon"/>
    <language>en</language>
    <item>
      <title>Building a service for Redis Hackaton</title>
      <dc:creator>HansTognon</dc:creator>
      <pubDate>Mon, 29 Aug 2022 11:51:00 +0000</pubDate>
      <link>https://dev.to/hanstognon/building-a-service-for-redis-hackaton-2ih5</link>
      <guid>https://dev.to/hanstognon/building-a-service-for-redis-hackaton-2ih5</guid>
      <description>&lt;h3&gt;
  
  
  Overview of My Submission
&lt;/h3&gt;

&lt;p&gt;This project is a small service whose purpose is to provide stats about GitHub repositories. It pulls info about the commits and draw some conclusions. It's intended to be integrated in a micro-service architecture.&lt;br&gt;
I didn't provide any UI since I knew about this hackaton lately.&lt;/p&gt;
&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Wacky Wildcards&lt;/p&gt;
&lt;h3&gt;
  
  
  Language Used
&lt;/h3&gt;

&lt;p&gt;Python&lt;/p&gt;
&lt;h3&gt;
  
  
  Link to Code
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/tobihans"&gt;
        tobihans
      &lt;/a&gt; / &lt;a href="https://github.com/tobihans/gitlytics"&gt;
        gitlytics
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Gitlytics&lt;/h1&gt;
&lt;p&gt;A service powered by Redis Streams to provide stats about Github repositories.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/tobihans/gitlytics./screenshots/tasks.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C4_T6qhF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/tobihans/gitlytics./screenshots/tasks.png" alt="tasks"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/tobihans/gitlytics./screenshots/runner.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7D5T07iL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/tobihans/gitlytics./screenshots/runner.png" alt="Runner"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/tobihans/gitlytics./screenshots/result1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JG6dmNYH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/tobihans/gitlytics./screenshots/result1.png" alt="Result 1"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/tobihans/gitlytics./screenshots/result2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d_Qhv9rA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/tobihans/gitlytics./screenshots/result2.png" alt="Result 2"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/tobihans/gitlytics./screenshots/result3.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NKxTOvl1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/tobihans/gitlytics./screenshots/result3.png" alt="Result 3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
How it works&lt;/h2&gt;
&lt;h3&gt;
How the data is stored:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;repositories&lt;/code&gt; is a stream where information is added about repositories to analyze.&lt;/li&gt;
&lt;li&gt;For each analyzed repository
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;repos:{owner}:{repo}&lt;/code&gt; provides result of analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
How the data is accessed:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;List of Github repositories in process&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;XRANGE repositories - +&lt;/pre&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Result of repository analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;GET repos:{owner}:{repo}&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
How to run it locally?&lt;/h2&gt;
&lt;h3&gt;
Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Python 3.10&lt;/li&gt;
&lt;li&gt;&lt;a href="https://python-poetry.org/docs/" rel="nofollow"&gt;poetry 1.1.x&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Docker (optional)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Local installation&lt;/h3&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; use this to start redis or do it manually&lt;/span&gt;
&lt;span class="pl-k"&gt;export&lt;/span&gt; GLC_REDIS_PORT=6379 &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; modify this to customize your redis port&lt;/span&gt;
docker-compose up -d

&lt;span class="pl-c1"&gt;cd&lt;/span&gt; etl
cp etl/.env.example etl/.env &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; customize to your environment&lt;/span&gt;

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; install dependencies&lt;/span&gt;
poetry install

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; activate your virtual environment&lt;/span&gt;
poetry shell
python etl/main.py&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;In another tab:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; In another tab, use a redis client to create new tasks&lt;/span&gt;
poetry shell
owner=a_github_username
repo=a_repo_of_owner
XADD repositories &lt;span class="pl-k"&gt;*&lt;/span&gt; owner &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-smi"&gt;$owner&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tobihans/gitlytics"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Check out &lt;a href="https://redis.io/docs/stack/get-started/clients/#high-level-client-libraries"&gt;Redis OM&lt;/a&gt;, client libraries for working with Redis as a multi-model database.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Use &lt;a href="https://redis.info/redisinsight"&gt;RedisInsight&lt;/a&gt; to visualize your data in Redis.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Sign up for a &lt;a href="https://redis.info/try-free-dev-to"&gt;free Redis database&lt;/a&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>redishackathon</category>
    </item>
  </channel>
</rss>
