SkillAgentSearch skills...

Avatary

Generate Avatars using Initials, Bears or Kittens (coming soon)

Install / Use

/learn @prettifystudio/Avatary
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<!-- *** Thanks for checking out the Best-README-Template. If you have a suggestion *** that would make this better, please fork the repo and create a pull request *** or simply open an issue with the tag "enhancement". *** Thanks again! Now go create something AMAZING! :D ***HelloWorld --> <!-- PROJECT SHIELDS --> <!-- *** I'm using markdown "reference style" links for readability. *** Reference links are enclosed in brackets [ ] instead of parentheses ( ). *** See the bottom of this document for the declaration of the reference variables *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use. *** https://www.markdownguide.org/basic-syntax/#reference-style-links -->

Contributors Forks Stargazers Issues MIT License

<!-- PROJECT LOGO --> <br /> <p align="center"> <h2 align="center">Avatary</h2> <p align="center"> Simple avatar generator <br /> <a href="https://github.com/prettifystudio/avatary"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="https://avatary.prettify.studio/">View Demo</a> · <a href="https://github.com/prettifystudio/avatary/issues">Report Bug</a> · <a href="https://github.com/prettifystudio/avatary/issues">Request Feature</a> </p> </p> <!-- TABLE OF CONTENTS --> <details open="open"> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#built-with">Built With</a></li> </ul> </li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#prerequisites">Prerequisites</a></li> <li><a href="#installation">Installation</a></li> </ul> </li> <li><a href="#usage">Usage</a></li> <li><a href="#roadmap">Roadmap</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> </ol> </details> <!-- ABOUT THE PROJECT -->

About The Project

It's just a simple project to generate avatars using names. For the moment it supports only english and arabic names.

Built With

This project is made with the awesome frameworks/packages

And this awesome Readme is made possible with :

<!-- GETTING STARTED -->

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

Since Avatary is built using Laravel 8, so the prerequisites are the same as the framework

  • PHP >= 8.0
  • BCMath PHP Extension
  • Ctype PHP Extension
  • Fileinfo PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • GD PHP Extension

Installation

  1. Clone the repo

    git clone https://github.com/prettifystudio/avatary.git
    
  2. Install Composer packages

    composer install
    
  3. Copy the environment file & edit it accordingly

    cp .env.example .env
    
  4. Generate application key

    php artisan key:generate
    
  5. Linking Storage folder to public

    php artisan storage:link
    
  6. Serve the application

    php artisan serve
    
<!-- USAGE EXAMPLES -->

Usage

Using the API is simple, all you have to do is hit the Initials API. Without any parameter, the endpoint will generate an image with random background color.

But you can customize it as you need.

Name

If you want to customize the name, you can hit the endpoint with the query param name .

The default value is "John Doe"

GET https://avatary.prettify.studio/api/initials?name=Koussay Fridhi

Background Color

Background colors, are generated randomly, but you can speacify it as follows:

The Background color must be in hexadecimal form, otherwise the system will throw an exception

GET https://avatary.prettify.studio/api/initials?bgcolor=f43f43

Size

The default size of the generated image is 260px, but you can specify a custom size

GET https://avatary.prettify.studio/api/initials?size=75

This will generate a 75*75 px image. Generally you may want to use a smaller size so the request is handled quickly.

Text Color

You may want also to specify the text color, inside the image.

The default value is <pre>#fafafa</pre>

The text color must be in hexadecimal form, otherwise the system will throw an exception

GET https://avatary.prettify.studio/api/initials?color=fafafa

Shape

The API will generate 2 shapes, a circle or a square. The default one is the circle, but you can get a square shape

GET https://avatary.prettify.studio/api/initials?shape=square

Full request

GET https://avatary.prettify.studio/api/initials?name=Koussay%20Fridhi&bgcolor=f44336&shape=circle&color=fafafa&size=250

This request will generate the following image

<section align="center"> <img src="https://avatary.prettify.studio/api/initials?name=Koussay%20Fridhi&bgcolor=f44336&shape=circle&color=fafafa&size=120"> </section>

You can use any param you want, for example you want only the name and the size,

GET https://avatary.prettify.studio/api/initials?name=Koussay%20Fridhi&size=125

Testing

This application is using PestPHP for testing. In order to run the test suite

./vendor/bin/pest
<!-- ROADMAP -->

Roadmap

See the open issues for a list of proposed features (and known issues).

<!-- CONTRIBUTING -->

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request
<!-- LICENSE -->

License

Distributed under the MIT License. See LICENSE for more information.

<!-- CONTACT -->

Contact

Your Name - @PrettifyStudio - hey@prettify.studio

Project Link: https://github.com/prettifystudio/avatary

<!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

Related Skills

View on GitHub
GitHub Stars39
CategoryDevelopment
Updated1y ago
Forks11

Languages

PHP

Security Score

80/100

Audited on Jan 4, 2025

No findings