Giter VIP home page Giter VIP logo

sui2's Introduction

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 :)

sui2's People

Contributors

87594589-7087-4f7c-b204-e84312ae374c avatar adamsdesk avatar akgnah avatar jeroenpardon avatar joshuaboniface avatar jrodan avatar korikori avatar n0ahmc avatar reorx avatar simonporte avatar tborychowski avatar theknarf avatar tionis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sui2's Issues

Arm machine can`t work, need help.

Hi , I build a docker image with the Dockerfile on my arm machine. But it can`t work.

error shows 'standard_init_linux.go:228: exec user process caused: exec format error'.

Do you know what`s the problem.

Thank you.

icons

I want to use another icon. What should I do? Please forgive me for using this for the first time.
Can you change it to use all iconify iconography?

How can I set all links opened in a new tab?

Hello,

I just test locally, and found some links are opened in a new tab, and others are redirected to the page directly.

Not sure if the open in new tab behavior can be configurable.

Open a group of pages with one click

Hello,

Thanks for your work.

Is there a way to open a set of pages with one click? Like I want to open all the pages under cloud section as shown below,

image

Might make the page denser?

Hi reorx!

I've been hosting sui2 on static hosting sites and it's so convenient!!

I found that the white space in default is large, so we could possibly fill them up with another bunch of columns.

Such white spaces enlarge when link titles are named in very short abbreviations like this
image

Maybe it'd be better to set up a parameter to configure the layout as "a x b"( cols x lines) ?

TY !

arm machine can`t use

Hi, I build a docker image use the Dockerfile with my arm machine, but it can not work.

the error is 'standard_init_linux.go:228: exec user process caused: exec format error'

Do you know how to solve this problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.