All Projects → ArthurHeitmann → photon-reddit

ArthurHeitmann / photon-reddit

Licence: GPL-3.0 License
Photon Reddit is a clean and modern reddit desktop client, with some cool features.

Programming Languages

typescript
32286 projects
SCSS
7915 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to photon-reddit

context-mod
an event-based, reddit moderation bot built on top of snoowrap and written in typescript
Stars: ✭ 38 (+52%)
Mutual labels:  reddit, reddit-application
reddit-comment-bot
Reddit bot that auto replies to comments on set subreddits
Stars: ✭ 59 (+136%)
Mutual labels:  reddit, reddit-application
Comet
Holochain powered distributed reddit application
Stars: ✭ 38 (+52%)
Mutual labels:  reddit
Glance
Another client for Reddit, but this time, it's not just a client. It's a different way of browsing photos, GIFs, memes and other things there!
Stars: ✭ 104 (+316%)
Mutual labels:  reddit
alfred-ask-create-share
Alfred workflow for creating web submissions (Stack Exchange, Forums and more)
Stars: ✭ 30 (+20%)
Mutual labels:  reddit
safe-search
Sets the built-in adult content filter (most often: safe search) on Google, YouTube, Bing, Yahoo, DuckDuckGo, Startpage, Dogpile, Yandex, Vimeo, Reddit, Ecosia, Dailymotion, Qwant, and Patreon.
Stars: ✭ 16 (-36%)
Mutual labels:  reddit
RepostCheckerBot
Bot for checking reposts on reddit
Stars: ✭ 36 (+44%)
Mutual labels:  reddit
cryptosub
Track 170+ cryptocurrency subreddits, view most popular coins, activity trends, most frequent words, and more
Stars: ✭ 37 (+48%)
Mutual labels:  reddit
Personal-Finance-Net-Worth-Tracker
Personal Finance (Net Worth Tracker) Wealth Management Spreadsheet
Stars: ✭ 31 (+24%)
Mutual labels:  reddit
RedditDownloaderBot
A reddit downloader telegram bot
Stars: ✭ 32 (+28%)
Mutual labels:  reddit
subreddit-css
used for /r/web_design and /r/graphic_design
Stars: ✭ 44 (+76%)
Mutual labels:  reddit
Multithreaded-Reddit-Image-Downloader
Does exactly what it says on the tin.
Stars: ✭ 38 (+52%)
Mutual labels:  reddit
reddit-hot-recorder
Records the activity (comments and karma) on the hot page of a Reddit sub and prepare an animated data visualisation.
Stars: ✭ 89 (+256%)
Mutual labels:  reddit
holo
Episode discussion bot for /r/anime.
Stars: ✭ 84 (+236%)
Mutual labels:  reddit
schmeckle bot
Reddit Bot for converting Rick & Morty Schmeckles to USD
Stars: ✭ 24 (-4%)
Mutual labels:  reddit
Reddit2YouTube
Convert reddit posts to YT videos
Stars: ✭ 17 (-32%)
Mutual labels:  reddit
ARAW
The Android Reddit API Wrapper
Stars: ✭ 75 (+200%)
Mutual labels:  reddit
sneakpeek
Reddit bot to preview and post hyperlinks as comments
Stars: ✭ 60 (+140%)
Mutual labels:  reddit
Plebeian
A simple client for Reddit created using the Flutter framework
Stars: ✭ 38 (+52%)
Mutual labels:  reddit
Updoot
A reddit client built for android
Stars: ✭ 51 (+104%)
Mutual labels:  reddit

Photon Reddit LOGO

GPLv3 License

Just replace reddit.com/... with photon-reddit.com/... to get started!

A clean and modern Reddit desktop web client.

Photon is a website to browse reddit without any distractions (no ads, no crowded sidebars, no distracting awards).

r/photon_reddit is the official subreddit.

How it looks like

preview image

Prerequisites

  • node: >= 14.x
  • npm: >= 7.5.1

Selfhosting

Commands

Download

git clone https://github.com/ArthurHeitmann/photon-reddit.git
cd photon-reddit

Install dependencies & Build

npm install
npm run build

Start

npm run start

Other commands for development

# auto restart server when js files change
npm run start-dev
# watch for Typescript & Sass file changes and auto recompile
npm run watch

Getting Login to work

These steps are optional but helpful for development (needed if you want to log in).

Go here and create your own reddit app.

  1. Name: whatever you want

  2. Select

installed app

  1. description & about url can be left empty

  2. redirect uri: [yourDomain]/redirect

Examples:

  1. Under /src/static/scripts/utils/consts.ts change AppId and redirectURI to
export const appId = "[generated app id]";
export const rediretURI = "[what you entered in step 4.]";

Environment Variables

Environment variables so far are only for the analytics system. If you use a .env file here is a template:

DB_HOST=
DB_USER=
DB_PW=
DB_PORT=
DB_DB=
analyticsPw=

DB_x is for configuring the mariaDB database. analyticsPw is for a cookie to access the analytics dashboard. More infos in analyticsQueryMiddleware() in src/serverScripts/analytics.ts.

Technical

Frontend

Esbuild is used to transpile and bundle Typescript (vanilla JS) and Scss files. No other frameworks or libraries are used.

Instead of using for example react components with jsx, a mix of the following is used:

// 1. For complex components
export default class Ph_ComponentName extends HTMLElement  {
	// ...
}
customElements.define("ph-component-name", Ph_ComponentName);

const element = new Ph_ComponentName(args);
// 2. Custom makeElement() function (similar to React.createElement)
const element = makeElement("div", { "class": "someClass", "data-tooltip": "tooltip" }, [
	// children
	makeElement("span", null, "Inner Text"),
	makeElement("img", { src: "/img/logo.svg" }),
]);
// 2.5 longer alternative
const element = document.createElement("div");
// ...
// 3. Lazy method for writing a lot of elements at once (escape untrusted string inputs with escHTML() or escADQ())
element.innerHTML = `
	<div class="${classNameVariable}">
		<span>...</span>
		...
	</div>
`;

Structure

/src/static maps to / in the browser.

/src/static/scripts/main.ts is the entry point for the frontend Javascript.

/src/static/style/main.scss is the entry point for the css.

Custom html components are under /src/static/scripts/components

If a component has a custom style its _componentName.scss file lies in the components directory and is registered under /src/static/style/_components.scss

Backend

An express server. Mostly only needed for making cross-origin request for a client that otherwise get CORS blocked (mostly some reddit api calls) and handling new version releases.

node 12.x is not supported because ES6 import {} from "lib" are used instead of require("lib").

Also used for analytics purposes with MariaDB. Except for minimal anonymized data, no user data is stored.

Naming conventions

In general camelCase. Except for custom html tag names then ph-[kebab-case]. Js component classes that extend HTMLElement Ph_PascalCase.

Contributing

I don't really know how this works :)

Basically follow the instructions from here.

Before doing any major changes, first ask me.

Contact

See here: photon-reddit.com/about

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].