ppic:ng is a tool to make the creation of share pics easier for organizations.
With ppic:ng you can create a custom design template for sharepics, which your collegues/members/... can customize via a browser (and thanks to PWA: mobile) app with an easy-to-use interface.
This tool was initially created for the German Pirate Party. This repository does not contain designs and logos of the Pirate Party, example logos and designs are included instead. If you want to use this tool for your own organization, you have to create your own designs. I will add a tutorial to do this later (probably), until then, you can have a look into src/designs/example
and start from there.
- Works with multiple custom design templates
- Automatically fit the font size to the available space
- Use images as background or side-by-side
- Supports the selection of a logo from a list
- The app runs completely in the browser, no download necessary
- The Progressive Web App (PWA) is mobile friendly and works completely offline
- Clone this repository (make sure to include submodules)
- Create an
.env
file by renamingexample.env
and edit it (see below) - Run
npm install
in the main directory - Run
npm start
to start the development server - Visit http://localhost:3000
If you have some prepared designs ready, copy them to src/designs
. They will be recognized automatically.
If your design supports logos, you can add your logos to src/logos
. Using the png
format with transparency is recommended.
There is no forced way how to store the image files in src/logos
. However, you have to provide a file src/logos/logos.json
with information about the logos.
The logo index file in a minmal version looks like this:
{
"group1": {
"title": "Allgemein",
"logos": {
"logo1": {
"title": "Logo 1",
"default": "./group1/logo1.png"
},
"logo2": {
"title": "Logo 2",
"default": "./common/logo2.png"
}
}
}
}
This example defines a logo group group1
with the name Allgemein
. The group contains two logos, logo1
and logo2
.
You can define multiple custom groups with multiple logos in each of them.
You can also define dark and light variants for each logo. If the design supports it, the dark or the light variant will be chosen by the background behind the logo.
{
"group1": {
"title": "Allgemein",
"logos": {
"logo1": {
"title": "Logo 1",
"default": "./group1/logo1.png",
"variants": {
"dark": "./regional/logo1_dark.png",
"light": "./regional/logo1_light.png"
}
}
}
}
}
If no variants are given for a logo, the default image is used.
If you want to exclude some logo groups from specific designs, you can specify the key excludeFromDesigns
:
{
"group1": {
"title": "Allgemein",
"excludeFromDesigns": ["classic-eu", "gp2024"],
"logos": {
"logo1": {
"title": "Logo 1",
"default": "./group1/logo1.png"
}
}
}
}
You can change some options via environment variables. The recommended way is to use a file .env
. If you want to overwrite some variables for your local development server, you can user .env.local
. See the React documentation for more information.
REACT_APP_DESIGN_DEFAULT=classic
: The name of the default design. Has to be exacly the same as the folder insrc/designs
.REACT_APP_DESIGN_xyz_DISABLE=true
: Disables a specific design. Replacexyz
with the design name.REACT_APP_DESIGN_xyz_PASSWORD=passwordhash
: Enables password protection for a specific design. Replacexyz
with the design name andpasswordhash
with the sha512-hash of the password. Note: This is not secure at all! If you really want to make sure, that nobody can use this tool for a design, you should restrict the access to the tool itself!REACT_APP_MATOMO_ENABLE=true
: Enables statistic collection with matomo.REACT_APP_MATOMO_URL=mymatomoserver.com
: The matomo server.REACT_APP_MATOMO_SITEID=1
: The matomo site id.REACT_APP_INFO=text
: Text that is shown after a click on the Info button. Supports HTML.
- Change designs and logos (see below)
- Run
npm run build
- Copy the contents of the
build
folder to your server
I stopped working on this tool a few years ago. To publish it, I made some changes to the code. However, there are still a lot of old dependencies which should be updated. Since I do not use this tool at the moment, I am not actively working on this code. However, I have not abandoned it, so any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Martin Stoppler - Mastodon