Skip to content

Codepoints/Codepoints.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

950be17 · Mar 17, 2025
Mar 17, 2025
Mar 11, 2025
Mar 16, 2025
Mar 16, 2025
Nov 3, 2024
Mar 16, 2025
Apr 2, 2024
Dec 18, 2022
Feb 25, 2024
Nov 21, 2022
May 3, 2024
Mar 7, 2021
Nov 3, 2024
Mar 5, 2025
Jan 1, 2023
Mar 12, 2021
Feb 28, 2025
Feb 28, 2025
Mar 15, 2024
Mar 16, 2025
Apr 17, 2024
Mar 25, 2021
Mar 16, 2025
Mar 16, 2025
Mar 8, 2021
Apr 2, 2024
Dec 8, 2022
Apr 17, 2024
Mar 7, 2024

Repository files navigation

Codepoints.net

This is the code that powers Codepoints.net.

Feel free to open issues at the bug tracker or contact us via Mastodon: @codepoints@typo.social.

See the re-use statement on codepoints.net for licensing and attribution information.

Setting up your own local instance

You need Docker Compose installed on your system.

Get the latest database dump from dumps.codepoints.net and place it in ./dev/db_init.d/. Then create in this folder (next to this README.md) a file config.ini with this content:

[db]
password=codepts
user=codepts
database=codepts
host=db

Start the Docker containers:

docker compose up

Presto! Your local copy of codepoints.net is ready under https://localhost. (You will need to click away an “untrusted certificate” error in the browser. This is expected.)

Code Flow

All requests are routed to index.php which loads init.php. The URL routes are defined in router.php. Single views have their logic stored in lib/Controller/*.php and the output generated via views/*.php.

Unicode data is processed in lib/Unicode with lib/Unicode/Codepoint.php as central class for single code points.

Static Files

If you use the Docker Compose setup a Vite container is automatically spawned that takes care of building static files as soon as you change them in src/js and src/css. The update should be picked up automatically by the server container.

There is no HMR in the frontend, though. You need to refresh the page to see effects.

We use web components with lit as framework for common tasks. This is a classic “MPA”. Interactivity is currently handled with the barba.js library but will perspectively replaced with the View Transition API.

Development Shell

To quickly experiment with some PHP code, run this command:

make shell

This starts a PHP command-line session with all required libraries autoloaded. The variable $db contains an already active PDO instance pointing to your database.