2024-09-26 01:13:22 -05:00
|
|
|
# Avatars API
|
|
|
|
|
|
|
|
A self-hosted avatars API using some of the [DiceBear](https://www.dicebear.com/) CC0 styles
|
|
|
|
|
2024-09-26 20:07:47 -05:00
|
|
|
You can take a look at my own self-hosted version here: https://avatars.jusemon.com
|
2024-09-26 01:13:22 -05:00
|
|
|
|
2024-09-26 20:07:47 -05:00
|
|
|
The following endpoints are available:
|
|
|
|
|
|
|
|
- https://avatars.jusemon.com/list
|
|
|
|
- https://avatars.jusemon.com/random
|
|
|
|
- https://avatars.jusemon.com/:seed
|
|
|
|
|
|
|
|
The size of the image and the style can be changed with the following query params:
|
|
|
|
|
|
|
|
- `size`: any number between `16` and `512`
|
|
|
|
- `style`: see the list endpoint, the valid values are defined by the property `key`
|
|
|
|
|
|
|
|
## Example:
|
|
|
|
|
|
|
|
https://avatars.jusemon.com/jusemon?size=512&style=open-peeps where jusemon is the :seed
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
### Development
|
2024-09-26 19:00:29 -05:00
|
|
|
|
2024-09-26 01:13:22 -05:00
|
|
|
For run locally it needs a `.env` file with the environment variables defined in the `.env.example`
|
|
|
|
|
|
|
|
ALLOWED_ORIGINS includes a comma separated list for the allowed CORS sites.
|
|
|
|
|
|
|
|
Install dependencies `npm install` or `yarn`
|
|
|
|
To start the project run `npm run dev` or `yarn dev`
|
|
|
|
|
2024-09-26 20:07:47 -05:00
|
|
|
### Production
|
2024-09-26 19:00:29 -05:00
|
|
|
|
|
|
|
For run it in docker just run `docker compose up`
|
|
|
|
|
2024-09-26 01:13:22 -05:00
|
|
|
## Libraries Used
|
|
|
|
|
|
|
|
- DiceBear (for avatar generation)
|
|
|
|
- sharp (for png exportation)
|
|
|
|
- uuid (for random seeds)
|
|
|
|
|
|
|
|
## Credits
|
|
|
|
|
|
|
|
- Created by Juan Sebastián Montoya
|
|
|
|
|
2024-09-26 20:07:47 -05:00
|
|
|
### Credits for Styles:
|
2024-09-26 01:13:22 -05:00
|
|
|
|
|
|
|
| Title | Creator | Source | Homepage | License |
|
|
|
|
| ---------- | ------------- | -------------------------------------------------------- | -------------------------------- | ------- |
|
|
|
|
| Open Peeps | Pablo Stanley | https://www.openpeeps.com/ | https://twitter.com/pablostanley | CC0 1.0 |
|
|
|
|
| Pixel Art | DiceBear | https://www.figma.com/community/file/1198754108850888330 | https://www.dicebear.com | CC0 1.0 |
|
|
|
|
| Thumbs | DiceBear | https://www.dicebear.com | https://www.dicebear.com | CC0 1.0 |
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
|