nuggit

Small bits of insights from GitHub repositories

https://github.com/verovaleros/nuggit

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.4%) to scientific vocabulary

Keywords

community github indexcard information software
Last synced: 4 months ago · JSON representation ·

Repository

Small bits of insights from GitHub repositories

Basic Info
  • Host: GitHub
  • Owner: verovaleros
  • License: gpl-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 472 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • Open Issues: 2
  • Releases: 0
Topics
community github indexcard information software
Created about 1 year ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Code of conduct Citation Security

README.md

Nuggit: GitHub Repository Tracking and Analysis

Nuggit is a web application for tracking and analyzing GitHub repositories. It provides a dashboard for monitoring repository metrics, comparing versions over time, and adding comments to repositories.

image

Features

  • User Authentication: Secure user registration, login, and email verification
  • Repository Dashboard: View and search all tracked repositories
  • Repository Details: Detailed view of repository metrics and information
  • Version Tracking: Track changes to repositories over time
  • Version Comparison: Compare metrics between different versions
  • Comments: Add and view comments on repositories
  • Tagging: Add tags to repositories for organization
  • GitHub Integration: Fetch and update repository data from GitHub
  • User Management: Admin panel for managing users and system settings
  • Email Notifications: Email verification and password reset functionality

Architecture

Nuggit follows a client-server architecture with three main components:

  1. Backend API: A FastAPI-based REST API that handles data processing, GitHub API interactions, and database operations.
  2. Frontend: A Svelte-based single-page application (SPA) that provides the user interface.
  3. Database: A SQLite database that stores repository information, comments, versions, and history.

Quick Start

Prerequisites

  • Python 3.9 or higher
  • Node.js 14 or higher
  • npm or yarn
  • Git
  • GitHub Personal Access Token (for repository data)
  • SMTP server access (for email functionality)

Backend Setup

```bash

Clone the repository

git clone https://github.com/verovaleros/nuggit.git cd nuggit

Create a virtual environment

python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate

Install dependencies

pip install -r requirements.txt

Configure environment variables

cp nuggit/.env_EXAMPLE nuggit/.env

Edit the .env file with your configuration (see Configuration section below)

Start the API server

uvicorn nuggit.api.main:app --host 0.0.0.0 --port 8001 --reload ```

Frontend Setup

```bash

Navigate to the frontend directory

cd nuggit/frontend

Install dependencies

npm install

or

yarn install

Start the development server

npm run dev

or

yarn dev ```

The frontend will be available at http://localhost:5173, and the API at http://localhost:8001.

Configuration

Environment Variables

Nuggit requires several environment variables to be configured in the .env file:

Required Configuration

  1. GitHub Token (Required for repository data): bash GITHUB_TOKEN=your_github_personal_access_token

    • Get your token from: https://github.com/settings/tokens
    • Required scopes: public_repo (for public repositories) or repo (for private repositories)
  2. JWT Secret Key (Required for authentication): bash JWT_SECRET_KEY=your-super-secret-jwt-key-change-this-in-production

    • Generate a secure key with: python -c "import secrets; print(secrets.token_urlsafe(32))"
  3. Email Configuration (Required for user registration and password reset): bash FROM_EMAIL=nuggit@yourdomain.com FROM_NAME=Nuggit SMTP_HOST=your-smtp-server.com SMTP_PORT=587 SMTP_USERNAME=your-smtp-username SMTP_PASSWORD=your-smtp-password SMTP_USE_TLS=true SMTP_USE_SSL=false

Optional Configuration

  • ACCESS_TOKEN_EXPIRE_MINUTES=10080 (7 days)
  • REFRESH_TOKEN_EXPIRE_DAYS=30
  • BASE_URL=http://localhost:5173
  • KO_FI_URL=https://ko-fi.com/yourusername

Email Setup Examples

Gmail

bash SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USERNAME=your-email@gmail.com SMTP_PASSWORD=your-app-password # Use App Password, not regular password SMTP_USE_TLS=true

Brevo (Sendinblue)

bash SMTP_HOST=smtp-relay.brevo.com SMTP_PORT=587 SMTP_USERNAME=your-brevo-username SMTP_PASSWORD=your-brevo-password SMTP_USE_TLS=true

First-Time Setup

  1. Copy the example configuration: bash cp nuggit/.env_EXAMPLE nuggit/.env

  2. Edit the .env file with your actual values

  3. Create an admin user (after starting the application): bash docker-compose exec nuggit python nuggit/scripts/setup_admin.py

  4. Access the application:

    • Frontend: http://localhost:5173
    • Register a new account or login with your admin credentials

Docker

Run Nuggit via Docker Compose (recommended):

```bash

Make sure you've configured your .env file first (see Configuration section above)

Start both frontend and API with Docker Compose

docker-compose up -d --build

Create an admin user (first time only)

docker-compose exec nuggit python nuggit/scripts/setup_admin.py

Check logs to verify everything is working

docker-compose logs ```

The application will be available at: - Frontend: http://localhost:5173 (with hot-reloading enabled) - API: http://localhost:8001

The Docker setup runs the frontend using npm run dev for development features.

User Management

Authentication System

Nuggit includes a complete authentication system with:

  • User Registration: New users can register with email verification
  • Email Verification: Users must verify their email before accessing the system
  • Password Reset: Users can reset their password via email
  • Admin Panel: Administrators can manage users and system settings

Creating Users

Admin User (First Time Setup)

```bash

Create an admin user after starting the application

docker-compose exec nuggit python nuggit/scripts/setup_admin.py ```

Regular Users

  1. Via Web Interface: Users can register at http://localhost:5173
  2. Via Admin Panel: Admins can create users through the admin interface
  3. Via Script: Use the setup script to create additional admin users

Admin Features

Admin users have access to: - User Management: View, activate/deactivate, and manage all users - System Settings: Configure application-wide settings - Repository Access: View and manage all repositories (not just their own) - User Statistics: View system usage and user activity

User Access Control

  • Repository Isolation: Users can only see and manage their own repositories
  • Admin Override: Admin users can access all repositories
  • Secure Authentication: JWT-based authentication with refresh tokens
  • Email Verification: Required for account activation

Documentation

For more detailed documentation, see:

Legacy CLI Tool

Nuggit was originally a command-line tool. The legacy CLI can still be used:

bash python3 nuggit/nuggit.py --help

``` usage: nuggit.py [-h] -r REPO [-l LOG_FILE] [-d] [-v]

Nuggit: Small bits of big insights from GitHub repositories

optional arguments: -h, --help show this help message and exit -r REPO, --repo REPO URL of the GitHub repository to analyze. -l LOGFILE, --logfile LOG_FILE Log file name (default: nuggit.log) -d, --debug Extra verbose for debugging. -v, --verbose Be verbose ```

License

This project is licensed under the GNU General Public License v2.0.

About

Nuggit was created by verovaleros in October 2024.

Owner

  • Name: Veronica Valeros
  • Login: verovaleros
  • Kind: user
  • Location: Czechia
  • Company: @stratosphereips

I'm a security researcher at the @stratosphereips laboratory, AI Center, FEE, Czech Technical University in Prague.

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Nuggit: Small bits of insights from GitHub repositories"
message: 'If you use this software, please cite it as specified below.'
url: "https://github.com/verovaleros/nuggit"
type: software
authors:
  - given-names: Veronica
    family-names: Valeros
    email: valerver@fel.cvut.cz
    affiliation: >-
      Stratosphere Laboratory, AIC, FEL, Czech
      Technical University in Prague
    orcid: 'https://orcid.org/0000-0003-2554-3231'

GitHub Events

Total
  • Issues event: 2
  • Watch event: 1
  • Delete event: 3
  • Push event: 35
  • Pull request review event: 5
  • Pull request review comment event: 15
  • Pull request event: 5
  • Fork event: 1
  • Create event: 11
Last Year
  • Issues event: 2
  • Watch event: 1
  • Delete event: 3
  • Push event: 35
  • Pull request review event: 5
  • Pull request review comment event: 15
  • Pull request event: 5
  • Fork event: 1
  • Create event: 11

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 42
  • Total Committers: 1
  • Avg Commits per committer: 42.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 42
  • Committers: 1
  • Avg Commits per committer: 42.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Veronica Valeros v****s@g****m 42

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 minutes
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • verovaleros (1)
Pull Request Authors
  • verovaleros (3)
Top Labels
Issue Labels
Pull Request Labels
enhancement (1)

Dependencies

requirements.txt pypi
  • PyGithub *
  • python-dotenv *
  • rich *
  • urllib3 ==1.26.16