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