Skip to content
/ badgify Public

πŸŒ€ Badgify is an easy-to-use API for generating online custom GitHub badges

License

Notifications You must be signed in to change notification settings

siloxa/badgify

Repository files navigation

badgify

badgify

Badgify

Is an easy-to-use API for generating online custom badges and GitHub profiles' summaries and repositories' reports as SVG.

If you like this project, please buy a cup of coffee for me=))β˜•

&

What Is In V1.4.0

  • JHipsetrize it! =))

Contents

Install and Run

Requirements

Having at least java-11 on your machine installed would be best.

Build

Packaging as jar

To build the final jar and optimize the Badgify for production, run:

./mvnw -Pprod clean verify

This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files. To ensure everything worked, run:

java -jar target/*.jar

Packaging as war

To package Badgify as a war in order to deploy it to an application server, run:

./mvnw -Pprod,war clean verify

Test

To launch Badgify's tests, run:

./mvnw verify

Then navigate to http://localhost:8080 in your browser.

Code quality

Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with:

docker-compose -f src/main/docker/sonar.yml up -d

Note: I have turned off authentication in src/main/docker/sonar.yml for out of the box experience while trying out SonarQube, for real use cases turn it back on.

You can run a Sonar analysis with using the sonar-scanner or by using the maven plugin.

Then, run a Sonar analysis:

./mvnw -Pprod clean verify sonar:sonar

If you need to re-run the Sonar phase, please be sure to specify at least the initialize phase since Sonar properties are loaded from the sonar-project.properties file.

./mvnw initialize sonar:sonar

Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the src/main/docker folder to launch required third party services.

For example, to start a mysql database in a docker container, run:

docker-compose -f src/main/docker/mysql.yml up -d

To stop it and remove the container, run:

docker-compose -f src/main/docker/mysql.yml down

You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running:

npm run java:docker

Or build a arm64 docker image when using an arm64 processor os like MacOS with M1 processor family running:

npm run java:docker:arm64

Then run:

docker-compose -f src/main/docker/app.yml up -d

When running Docker Desktop on MacOS Big Sur or later, consider enabling experimental Use the new Virtualization framework for better processing performance (disk access performance is worse).

For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (jhipster docker-compose), which is able to generate docker configurations for one or several JHipster applications.

APIs

Label Badge

GET http://localhost:8080/api/badge/lable

OPTIONS

πŸ‘€ Example
http://localhost:8080/api/badge/label?text=Badgify&fontColor=lavender&size=l&theme=simple&backgroundColor=indigo&icon=github

image

Icon Badge

GET http://localhost:8080/api/badge/icon

OPTIONS

πŸ‘€ Example
http://localhost:8080/api/badge/icon?fontColor=lavender&size=l&theme=simple&backgroundColor=indigo&icon=github

image

Text Badge

GET http://localhost:8080/api/badge/text

OPTIONS

πŸ‘€ Example
http://localhost:8080/api/badge/text?fontColor=lavender&size=l&theme=simple&backgroundColor=indigo&text=Badgify

image

Counter Badge

for repository

GET http://localhost:8080/api/badge/counter

OPTIONS

  • id: String (required)
  • type: repository (required)
  • text: String
  • fontColor: Color
  • backgroundColor: Color
  • size: Size
  • theme: Theme
πŸ‘€ Example
http://localhost:8080/api/badge/counter?fontColor=lavender&size=l&theme=simple&backgroundColor=indigo&type=repository&icon=github&id=Badgify

image

Social Badge

GET http://localhost:8080/api/badge/{social}/{id}

OPTIONS

πŸ‘€ Example
http://localhost:8080/api/badge/twitter/shuoros

image

Supported Socials

app-store

http://localhost:8080/api/badge/app_store/{id}

image

behance

http://localhost:8080/api/badge/behance/{id}

image

discord

http://localhost:8080/api/badge/discord/{id}

image

dockerhub

http://localhost:8080/api/badge/dockerhub/{id}

image

dribbble

http://localhost:8080/api/badge/dribbble/{id}

image

dropbox

http://localhost:8080/api/badge/dropbox/{id}

image

facebook

http://localhost:8080/api/badge/facebook/{id}

image

github

http://localhost:8080/api/badge/github/{id}

image

gitlab

http://localhost:8080/api/badge/gitlab/{id}

image

goodreads

http://localhost:8080/api/badge/goodreads/{id}

image

google-drive

http://localhost:8080/api/badge/google_drive/{id}

image

google-play

http://localhost:8080/api/badge/google_play/{id}

image

instagram

http://localhost:8080/api/badge/instagram/{id}

image

kaggle

http://localhost:8080/api/badge/kaggle/{id}

image

kickstarter

http://localhost:8080/api/badge/kickstarter/{id}

image

linkedin

http://localhost:8080/api/badge/linkedin/{id}

image

medium

http://localhost:8080/api/badge/medium/{id}

image

paypal

http://localhost:8080/api/badge/paypal/{id}

image

pinterest

http://localhost:8080/api/badge/pinterest/{id}

image

quora

http://localhost:8080/api/badge/quora/{id}

image

reddit

http://localhost:8080/api/badge/reddit/{id}

image

skype

http://localhost:8080/api/badge/skype/{id}

image

slack

http://localhost:8080/api/badge/slack/{id}

image

snapchat

http://localhost:8080/api/badge/snapchat/{id}

image

spotify

http://localhost:8080/api/badge/spotify/{id}

image

stack-exchange

http://localhost:8080/api/badge/stackexchange/{id}

image

stackoverflow

http://localhost:8080/api/badge/stackoverflow/{id}

image

steam

http://localhost:8080/api/badge/app_store/{id}

telegram

http://localhost:8080/api/badge/telegram/{id}

image

tiktok

http://localhost:8080/api/badge/tiktok/{id}

image

twitch

http://localhost:8080/api/badge/twitch/{id}

image

twitter

http://localhost:8080/api/badge/twitter/{id}

image

yahoo-mail

http://localhost:8080/api/badge/yahoo_mail/{id}

image

youtube

http://localhost:8080/api/badge/youtube/{id}

image

If there is a missed social media please let me now by creating a new Issue

Options

Here are quick examples of how to use APIs. For more information, please visit the badgify website or read the /docs.

Default Colors

Instead of passing colors as hex you can use our pre-defined default colors names:

badgify.thex.solutions/api/badge/title?title=color&bg=<COLOR_NAME>

Colors names aren't case-sensitive!

Thinking of a new cool color? Please let us know<3.

Random Colors

For generating random colors you can use the following api with a random param as bg or color :

badgify.thex.solutions/api/badge/title?title=random&bg=random

We strongly recommend you to do not use random colors for badge's text color! Because the produced random color may not match the background color in contrast and make it difficult to see your text in the badge.

Themes

You can choose one of the available themes for your badge.

Simple

Simple is default theme of badges. If you want to use this theme, you do not need to pass it in parameters.

badgify.thex.solutions/api/badge/link?title=Simple&icon=github

badgify.thex.solutions/api/badge/title?title=Simple

badgify.thex.solutions/api/badge/icon?icon=github

Sharp

To use this theme in your badges, you must pass theme=sharp parameter in your request.

badgify.thex.solutions/api/badge/link?title=Sharp&icon=github&theme=sharp

badgify.thex.solutions/api/badge/title?title=Sharp&theme=sharp

badgify.thex.solutions/api/badge/icon?icon=github&theme=sharp

Edge

To use this theme in your badges, you must pass theme=edge parameter in your request.

badgify.thex.solutions/api/badge/link?title=Edge&icon=github&theme=edge

badgify.thex.solutions/api/badge/title?title=Edge&theme=edge

badgify.thex.solutions/api/badge/icon?icon=github&theme=edge

Any idea about new themes? Feel free to tell us<3

Sizes

There are three renderable sizes for badges. Small, medium and large that you can choose any of these sizes for your badge.

Small

Small is default size of badges. If you want to use this size, you do not need to pass it in parameters.

badgify.thex.solutions/api/badge/link?title=Small&icon=github

badgify.thex.solutions/api/badge/title?title=Small

badgify.thex.solutions/api/badge/icon?icon=github

Medium

To use medium size for your badges, you must pass size=m parameter in your request.

badgify.thex.solutions/api/badge/link?title=Medium&icon=github&size=m

badgify.thex.solutions/api/badge/title?title=Medium&size=m

badgify.thex.solutions/api/badge/icon?icon=github&size=m

Large

To use large size for your badges, you must pass size=l parameter in your request.

badgify.thex.solutions/api/badge/link?title=Large&icon=github&size=l

badgify.thex.solutions/api/badge/title?title=Large&size=l

badgify.thex.solutions/api/badge/icon?icon=github&size=l

Inline Query Params

Instead of passing the params as query params you can use inline params to just pass a string as design:

badgify.thex.solutions/api/badge/inline/<BADGE>/<SOME_DESIGN>

Or want to pass less params? You can use short inline:

badgify.thex.solutions/api/badge/inline/<BADGE>/<SOME_SHORT_DESIGN>

Params Splitters

You can use underscore, hyphen or space as a param splitter.

param1 param2 param3...

param1_param2_param3...

param1-param2-param3...

Please take a look at each badge's examples to see how to use inline params.

Authors

badgify is developed by Soroush Shemshadi and contributors.

Contribution

If you want to contribute on this project, Please read the contribution guide.

Releases

To see the changes in different versions of badgify, you can read the release notes.

Issues

If you encounter a bug or vulnerability, please read the issue policy.

Documentation

To learn how to work with badgify, please take a look at the /docs folder.

Acknowledgement

A great thanks to @sarahrajabi for designing the icon.

And thanks to all the contributors, the people who reported the bugs and all those who made it possible for us to provide this great software.