Skip to content

Single Page Application handling photos, stories, maps, charts. Minimalist first.

License

Notifications You must be signed in to change notification settings

coffeacloudberry/galleria

Repository files navigation

Galleria

Static Analysis DeepSource Quality Gate Status Uptime Robot ratio (30 days)

ExploreWilder logo

Minimalist Blog With Photos, Stories, Maps

Why This Website?

Because:

  • I like seeing and sharing content ads-free, with no subscription or paywall or trackers,
  • I want a minimalist / fully-featured / privacy-friendly / user-friendly website,
  • I want both the interface and the content lightweight by design, fast to load, and secure,
  • I want it translated,
  • I want it bug-free,
  • I like receiving feedback without forcing you to sign in a specific social platform.

I could not find anything cheap complying to the above requirements, and I was interested in learning great web development tools. Therefore, I designed a Single Page Application using the Mithril framework, the TypeScript language, and some awesome libraries. It is deployed as a serverless application thanks to Vercel and connects to some 3rd parties to create a real interactivity. To sum up the features:

  • Interactive 3D maps,
  • Interactive charts,
  • Home-made track format including elevation profile,
  • Fully translated in English, Finnish, and French,
  • Privacy by design,
  • Humane by design,
  • Ethical by design,
  • No cookie, no Local Storage, no IndexedDB,
  • Photo viewer with dynamic image optimization,
  • Mobile-friendly,
  • Lazy-loading heavy scripts (with dynamic import expressions).

The project was not created to be a template or a flexible CMS, but for my own use. Feel free to take whatever inspiration from it that you want.

Usage

Install Dependencies

Clone this repo, install Node.js 20, and run npm i. For dev, run make update.

Add Content

Tracks and photos are transformed with command line tools written in Python 3.11. The list of stories and photo metadata fetched by the website are statically generated at build time thanks to a custom Webpack plugin and utilities. Rebuild or rerun the local server to apply the changes.

Running

Run the development server locally
npm start

You can view the development server at localhost:8080.

To run the debug session from an IntelliJ-based IDE, configure the browser to be Chrome-based (File > Settings... > search for browser), and start the local server as usual but press Ctrl+Shift+Click on the local URL.

Run the production build
npm run build

Note: Install http-server globally to deploy a simple server locally.

npm i --location=global http-server

You can view the deployment by creating a server in public.

cd public
http-server

Testing

Unit testing

Run make js-test and make py-test

For running specific tests on PyCharm Professional, the Node.js plugin has to be installed.

End-to-end testing

The test uses Robot Framework with the SeleniumLibrary. Run npm start in one shell and make e2e-test on another one. The tests do not use fake fixtures but the actual website content. The most recent photo should have a story or some tests may fail. An HTML report should have been generated.

Analysing

Bundle size analysis

Run npm bundle-analysis to generate the prod bundle and start a local server with a page displaying the bundle analysis, you can check that no extra libraries are bundled.

Updating

The dependencies
# run `npm i npm-check-updates --location=global` only once
# optionally run `ncu --version` beforehand to see if there is any update of the tool itself
ncu -u
npm install

Also update the lazy-loaded scripts listed in the configuration file.

The logo

From a new SVG file:

  • Generate PNG files of different sizes and generate the .ico with Gimp: File > Open as Layers, File > Export As...,
  • Generate an apple-touch-icon file (PNG, 192x192, without alpha channel).
The font

The main SASS file should point to the font file.

For editing the font, adding glyphs, ligatures, exotic characters, etc. Have a look at this README file.

The map styles

The Mapbox Studio styles are public:

In the above links, replace YOURTOKEN with your token. Use a Mapbox token with the styles:read and fonts:read scopes.

Real Deployment

The frontend can be deployed on any server, just install dependencies with npm ci. Some third party connections require an account. The good news is that most third parties are cost- and maintenance-free, so that you can focus on what really matters: photos, stories, adventures!

Thanks

Thanks to the visitors who shared feedback. 🤗


JetBrains logo

Project sponsored by JetBrains