Skip to content

rnium/poridhi-lab-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poridhi Lab Tracker

Poridhi Lab Tracker is a productivity tool designed to help users efficiently track their progress on labs and modules within the poridhi.io platform. It consists of a browser user script and a Cloudflare Worker backend, making it easy to mark labs as complete/incomplete, sync progress, and manage your workflow seamlessly.

Features

  • Mark Labs/Modules as Done or Incomplete:
    • Instantly mark any lab or module as completed or not directly from the poridhi.io UI.
  • Progress Syncing:
    • Your progress is securely synced to a Cloudflare Worker backend, so you can access your status from any device.
  • Tampermonkey Integration:
    • Simple user script installation for Chrome, Firefox, Edge, and more.
  • Secure API Key Authentication:
    • All API requests require a user-generated API key for security.
  • Customizable Backend:
    • Easily deploy your own Cloudflare Worker and control your data.
  • User-Friendly Configuration:
    • Set your API endpoint and key from the Tampermonkey menu.
  • Open Source:
    • Fully open for customization and self-hosting.

Setup Guide

This project consists of two main components:

  • Poridhi Lab Tracker User Script (for use with Tampermonkey)
  • Cloudflare Worker API (backend service)

Follow the instructions below to set up both components for a seamless experience.


1. Tampermonkey User Script Setup

Prerequisites

  • Tampermonkey extension installed in your browser (Chrome, Firefox, Edge, etc.)
  • The poridhi_tracker.user.js script file from this repository

Installation Steps

  1. Open Tampermonkey Dashboard in your browser.
  2. Click the "+" (Create a new script) button.
  3. Copy the contents of poridhi_tracker.user.js and paste it into the new script editor.
  4. Save the script.

Configuration

  • API_HOST: Set this to the URL of your deployed Cloudflare Worker (see below for deployment instructions).
  • API Key: After installing the script, go to poridhi.io, click the Tampermonkey icon, select the Poridhi Lab Tracker script, and use the menu to set your API key (generated in the Cloudflare Worker setup).

How to set API_HOST and API Key:

  • Open the Tampermonkey dashboard.
  • Find the Poridhi Lab Tracker script and click on it.
  • Look for the script menu or settings (usually accessible via the script's menu icon or by right-clicking the script name).
  • Enter your Cloudflare Worker URL as API_HOST and paste your API key.

2. Cloudflare Worker Setup

Prerequisites

Steps

1. Clone the Repository

git clone <this-repo-url>
cd poridhi-lab-tracker/worker

2. Install Dependencies

npm install

3. Generate an API Key

Use openssl to generate a secure API key:

openssl rand -hex 32

Copy the generated key. You will use this in both the worker and the user script.

4. Set the API Key as an Environment Variable

Set the API key in your environment (replace <your-api-key> with the key you generated):

wrangler secret put API_KEY

You will be prompted to enter the value. Paste your API key and press Enter.

5. Configure the Worker

  • Edit wrangler.jsonc if needed to set your account and project details.

6. Deploy the Worker

npx wrangler deploy

After deployment, note the worker URL (e.g., https://your-worker-name.your-account.workers.dev).


3. Connecting the Script and Worker

  • In the Tampermonkey script, set API_HOST to your deployed worker URL.
  • Set the API key in the script menu as described above.

Troubleshooting

  • CORS Issues: Tampermonkey will prompt you to allow cross-origin requests. Make sure to allow them for the worker URL.
  • Invalid API Key: Double-check that the API key in Tampermonkey matches the one set in the worker.
  • Deployment Errors: Check your Cloudflare account and wrangler configuration.

Security Notes

  • Keep your API key secret. Do not share it publicly.
  • Update your API key regularly to maintain security.

Resources


Enjoy!

About

A userscript with Cloudflare Worker backend for tracking lab progress in Poridhi.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors