Skip to content

Repository files navigation

Sortling Reddit App (sorts-me/reddit)

License TypeScript Reddit Devvit REST API

Universal Reddit Devvit application for the Sortling campus guide ecosystem. Enabling students to take interactive club matching quizzes and browse verified campus directories directly within Reddit Custom Posts.

Sortling Reddit App brings interactive campus club discovery to Reddit. Built with Reddit's Devvit SDK, webroot HTML5 webviews, and asynchronous REST API fallback handlers, it streams quiz questions and club recommendations inside subreddit feeds.


Note

REDDIT DEVVIT ARCHITECTURE

This repository contains the TypeScript Devvit application and HTML5 webview entrypoint (devvit/webroot/index.html). It connects to the central Sortling REST API (https://sortling-bot.onrender.com/api/) to execute recommendation queries.


🏛️ Devvit App Architecture

graph TD
    A[Reddit User] -->|Open Custom Post| B(Devvit Webview index.html)
    B -->|POST /api/sessions/start| C[Sortling Central REST API]
    C -->|Return Question JSON| B
    B -->|Render Webview Quiz| A
    A -->|Select Option| B
    B -->|POST /api/sessions/answer| C
    C -->|Calculate Matches| D[DeterministicRecommendationEngine]
    D -->|Return Top 3 Recommendations| B
    B -->|Render Results Card| A
Loading

🌟 Key Features

  • 📱 Native Reddit Custom Posts: Embeds interactive custom posts automatically on AppInstall or AppUpgrade events.
  • High-Speed HTML5 Webview: Clean, responsive UI styled with Sortling brand tokens (#000543 background, #ffffff controls).
  • 🔄 Resilient REST API Fallback: Connects to the central Sortling backend with graceful fallback handling for continuous uptime.
  • 🎯 Full Feature Parity: Supports interactive multi-step matching quizzes, club detail lookups, and hackathon registries.
  • 🛡️ Devvit Menu Actions: Subreddit moderator menu shortcut (Create Sortling Campus Guide Post) to generate custom posts on demand.

📂 Codebase Structure

  • Devvit Entrypoint (main.ts): Configures Reddit API triggers, installs custom post handlers, and defines moderator menu items.
  • Webview Application (index.html): Single-page web app rendering Home, Quiz, Results, and Directory views with asynchronous fetch controllers.
  • Configuration (devvit.json): Manifest specifying app permissions (Reddit API, HTTP), webroot entrypoints, and target subreddits.

🛠️ CLI Development & Deployment

  1. Clone the repository and install dependencies:

    git clone https://github.com/sorts-me/Reddit.git
    cd Reddit/devvit
    npm install
  2. Playtest locally on Reddit:

    npx @devvit/cli playtest r/sortling_dev
  3. View live app logs:

    npx @devvit/cli logs r/sortling_dev --since 1h
  4. Upload and publish new version to Reddit:

    npx @devvit/cli upload

📜 License

Licensed under the Apache License 2.0.

About

Universal Reddit Devvit app for interactive campus guide custom posts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages