• Stars
    star
    389
  • Rank 110,500 (Top 3 %)
  • Language
    JavaScript
  • License
    The Unlicense
  • Created about 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a startpage for your server and / or new tab page

SUI2

a startpage for your server and / or new tab page

Originally forked from sui, sui2 adds new features like keyboard navigation and PWA to boost your productivity. It's a complete refactor, brings new technologies for easier development & deployment.

See how keyboard navigation works in action:

sui2.mov

Deploy to any static hosting

sui2 uses Vite to build a staic website, which means it's nothing but vanilla HTML/CSS/JavaScript that could be deployed to anywhere you want.

To build the project, simply follow the steps below.

  1. Install dependencies: npm i

  2. Create you own data.json

    sui2 get all the data it requires from data.json, you can make a copy from data.example.json, and then edit it with your own applications and bookmarks.

  3. Build the result: npm run build

    The result will be stored in the dist folder

  4. Upload to a static hosting.

    There are various hosting services like GitHub Pages, Cloudflare Pages, Netlify. Examples will be documented later on.

If you are happy with the look and functionality of sui2, it is recommended to use this project as a submodule rather than fork it. Please checkout reorx/start as an example for how to use it in another project, and how to build with GitHub Actions and deploy to Cloudflare Pages.

Deploy using Docker

Notice: to make the preview page in live editor work more predictable, Docker image does not provide PWA support

sui2 provides a Docker image that runs a NodeJS server, which not only servers the startpage directly, but also gives you an interface to edit and build the startpage lively.

SUI2 Live Editor

The image is hosted on Docker hub at: reorx/sui2

Run the following command to get started:

docker run --rm -t -p 3000:3000 -v data:/data reorx/sui2

Command explained:

  • -p 3000:3000: the server runs on port 3000, you need to specify the port on host to expose, if you want to access it from 5000, you can change the argument to -p 5000:3000
  • -v data:/data: you need to attach a volume to /data, which stores the config and static resources of the startpage

After the container is alive, open http://DOCKER_HOST:3000/ to see the initial startpage.

For the live editor, open http//DOCKER_HOST:3000/editor/, there's no link for it on the startpage.

Checkout the configuration file fly.toml as an example for how to deploy the Docker image to fly.io

Build Docker Image

Currently, the image has only amd64 and arm64 variants, if your architecture is not one of these, please build the image by yourself, simply by running:

docker buildx build -t sui2 .

Notice that BuildKit (buildx) must be used to get the TARGETARCH argument, see Automatic platform ARGs in the global scope

data.json editing

There's a full example in data.example.json, it's self explanatory so I'm not going to write too much about it, maybe a json schema will be created as a supplement in the future.

The only thing worth mentioning here is the icon attribute, it uses the MDI icon set from Iconify, you can find any icon you like in this page, and use the name after mdi: as the value for the icon attribute. For example mdi:bread-slice should be used as "icon": "bread-slice" in data.json.

Development

Developing the startpage is easy, first clone the project, then run the following:

npm install

# start vite dev server
npm run dev

Developing the live-server is a little bit tricky, live-server/ is an independent package with an express server and another vite frontend.

cd live-server
npm install

# start the express server on port 3000
npm run dev-backend

# open another shell, then start vite dev server
npm run dev

The output of npm run dev looks like this:

  ➜  Local:   http://localhost:5173/editor/

You can now open this URL to start developing live-server. The fetch requests of /api and /preview on this page will be proxied to the express server on port 3000. The default data folder is at live-server/data/.

TODO

Some other features I plan to work in the future, PRs are welcome.

  • Custom theme editor
  • Support dynamically render the page from data.json. This makes it possible to host a sui2 distribution that is changable without the building tools.
  • A chrome extension that shows sui2 in a popup.
  • Add new tab support for the chrome extension.

Donation

If you think this project is enjoyable to use, or saves some time, consider giving me a cup of coffee :)

More Repositories

1

httpstat

curl statistics made simple
Python
5,954
star
2

awesome-chatgpt-api

Curated list of apps and tools that not only use the new ChatGPT API, but also allow users to configure their own API keys, enabling free and on-demand usage of their own quota.
Python
5,900
star
3

Share-to-ChatGPT-Shortcut

An Apple Shortcut for sharing text to ChatGPT using personalized prompts
315
star
4

obsidian-paste-image-rename

Renames pasted images and all the other attachments added to the vault
TypeScript
272
star
5

jsoncv

A toolkit for building your CV with JSON and creating stylish HTML/PDF files.
JavaScript
271
star
6

cht-colors

Chinese Traditional Colors
HTML
218
star
7

ai.py

A single-file Python script that interacts with ChatGPT API in the command-line.
Python
115
star
8

python-terminal-color

Drop-in single file library for printing color in terminal
Python
71
star
9

minimal-bilibili

给你纯净的 Bilibili 视频发现体验
TypeScript
61
star
10

torext

[WORKING ON] The missing tornado mate
Python
61
star
11

xiami_exporter

Export your data from Xiami
JavaScript
59
star
12

n8n-workflows

My workflows for n8n automation
Python
44
star
13

github-toc-sidebar

Show GitHub Readme TOC as a sidebar
TypeScript
44
star
14

obsidian-telegraph-publish

Publish your Obsidian note to a Telegraph page.
TypeScript
43
star
15

obsidian-people-link

Easily create links to people within your documents.
TypeScript
38
star
16

refgen

JavaScript
34
star
17

flomo-to-obsidian

JavaScript
31
star
18

cx-extractor

Automatically exported from code.google.com/p/cx-extractor
HTML
29
star
19

autotagger

Tag .mp3 and .m4a audio files from iTunes data automatically.
Python
29
star
20

obsidian-daily-notes-opener

Easily open daily notes and periodic notes in new pane; customize periodic notes background; quick append new line to daily notes.
TypeScript
25
star
21

substance

Extract substance from the web
HTML
23
star
22

project_sketch

A nerd's boilerplate for your Python project.
Python
20
star
23

readability

html main body extractor
HTML
17
star
24

dotfiles

my rcs
Vim Script
15
star
25

deptest

dependent testing framework
Python
15
star
26

chatroom

simple chatroom using tornado long polling feature
JavaScript
14
star
27

rdl

Redis dump & load tool.
Python
12
star
28

squared

JavaScript
11
star
29

tako

A simple task manager in Django
Python
10
star
30

simplemongo

A Simple & Clear MongoDB ORM
Python
9
star
31

ts

Twitter Search CLI
Python
9
star
32

xiamifav

xiami html5 client
JavaScript
7
star
33

miniflux-on-railway

miniflux deployed on railway.app
Python
7
star
34

drawtable

Draw ASCII art box with text.
Python
7
star
35

getenv

Environment variable definition with type
Python
7
star
36

userscripts

My UserScripts
JavaScript
7
star
37

blog

HTML
6
star
38

params

A Python package that does better in request parameters validation than django.forms, wtforms, web_args or so.
Python
6
star
39

n8n-on-railway

Shell
6
star
40

eurasia

Automatically exported from code.google.com/p/eurasia
Python
5
star
41

things-to-ticktick

Export tasks from Things.app to TickTick format
Shell
5
star
42

pyconv

Text file code conversion tool
Python
4
star
43

cv

My CV site.
JavaScript
4
star
44

dbflip

flip reading for douban note
JavaScript
4
star
45

beatles

Data and tools to enjoy The Beatles better.
Python
4
star
46

feishu-exporter

Export Feishu docs with ease
JavaScript
4
star
47

rss-filter

Modify and regenerate RSS source piped in
TypeScript
4
star
48

papermodx-example

HTML
3
star
49

V2EXWitch

Chrome Extension - V2EX Account Switcher & Notifier
JavaScript
3
star
50

python-playground

Python
3
star
51

scripts

miscellaneous scripts I use
Python
3
star
52

litekv

Simple kv store for Python
Python
3
star
53

window-opener

TypeScript
3
star
54

pex_uwsgi_demo

Python
3
star
55

json_include

An extension for JSON to support file including
Python
3
star
56

fuload

Automatically exported from code.google.com/p/fuload
C++
2
star
57

gouken

Go microservice framework built on top of grpc
Go
2
star
58

django_starter_pack

My personal starter pack for Django projects
Python
2
star
59

minireact

A minimal react project boilerplate
JavaScript
2
star
60

stexplorer

Download songs from SongTaste
Python
2
star
61

learn_applescript

Notes & code pieces recorded during my exploration to AppleScript.
AppleScript
2
star
62

gopkg_opml

Python
1
star
63

qdan-archives

my archives on qdan.me
CSS
1
star
64

rime_dict

Tools for manipulating userdict of rime input method
Python
1
star
65

pinback

Pinboard backup tool
Python
1
star
66

apibox

[WORKING ON] Building blocks for HTTP API development
Python
1
star
67

learn_spider

Practicing code to learn to write a spider
Python
1
star
68

whuspec

My graduation project.
HTML
1
star
69

obsidian-chatgpt

TypeScript
1
star
70

go-to-douban

I am Xiao Meng, and I want to work in Douban, I create this repository for announcing and yelling
1
star
71

start

Shell
1
star
72

python-installer

Shell
1
star
73

printable-css

HTML
1
star
74

kindle_ebook_template

for publishing kindle ebook - specially for chinese
1
star
75

quiverweb

Web service for Quiver note app
Python
1
star
76

pinyindep

essentials for implement pinyin transforming capability in your projects with python
Python
1
star
77

gatsby-starter-netlify-cms

JavaScript
1
star
78

webpack-chrome-boilerplate

A boilerplate for building Chrome extensions with Webpack
TypeScript
1
star
79

alfred-workflows

my alfred workflows
Python
1
star
80

awesome-javascript-editors

A collection of awesome javascript editors
1
star
81

torext-admin

Python
1
star
82

html-cutter

A Chrome extension to cut out HTML fragments from a page.
JavaScript
1
star
83

aima-python

Automatically exported from code.google.com/p/aima-python
Python
1
star
84

simplate

Created with CodeSandbox
JavaScript
1
star
85

tomorrow

A new task scheduler, aimed at quick, clean, and clear
1
star
86

SMU-MScCDA-ProgrammingTest-2023

Python
1
star
87

n8n-on-fly

1
star
88

proto-typist

generate proto code from proto code
Python
1
star
89

project-nowhere

Automatically exported from code.google.com/p/project-nowhere
PHP
1
star
90

nasdaqtrader-rss

Python
1
star