Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frncsdrk/avatar
Self-hosted service for creating random avatars
https://github.com/frncsdrk/avatar
avatar expressjs generator nodejs random self-hosted service
Last synced: 3 days ago
JSON representation
Self-hosted service for creating random avatars
- Host: GitHub
- URL: https://github.com/frncsdrk/avatar
- Owner: frncsdrk
- License: mit
- Created: 2018-04-25T17:18:17.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T23:40:49.000Z (3 months ago)
- Last Synced: 2024-10-24T13:14:39.577Z (3 months ago)
- Topics: avatar, expressjs, generator, nodejs, random, self-hosted, service
- Language: JavaScript
- Homepage: https://frncsdrk.github.io/avatar
- Size: 1.53 MB
- Stars: 109
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# avatar
[![build](https://github.com/frncsdrk/avatar/actions/workflows/build.yml/badge.svg)](https://github.com/frncsdrk/avatar/actions/workflows/build.yml)
Self-hosted service for creating random avatars
Inspired by github default avatars
## Examples
### Random
![random squares](./img/random-0.png "squares")
![random circles](./img/random-1.png "circles")
![random triangles](./img/random-2.png "triangles")### Initials
![initials AV](./img/initials-0.png "initials")
## Usage
Default **Port**: `9000`
### Download
Either download a release from the [Releases page](https://github.com/frncsdrk/avatar/tags) or clone the repo.
Then follow the steps under [Development Setup](https://github.com/frncsdrk/avatar#setup).### Docker
There is a container image available on [Docker Hub](https://hub.docker.com/r/frncsdrk/avatar)
and there is a Docker-Compose file in the repo.
Both are provided for convenience and as a starting point for a production setup.```
docker|podman run -p 9000:9000/tcp docker.io/frncsdrk/avatar
```### Configuration
You can put config files into `./config/`. See [file load order](https://github.com/node-config/node-config/wiki/Configuration-Files#file-load-order) for configuration names and there priority.
**Mount configuration into container**
*Generally mounting a custom configuration shouldn't be necessary, except if you want to set a custom port*
Using another name than `prod.yml` will lead to a warning when using the container image from this repository.
The warning is irrelevant as long as you follow the configuration naming conventions.```
docker|podman run -p :/tcp -v ./vol:/app/config docker.io/frncsdrk/avatar
```## API
See [API Docs](https://frncsdrk.github.io/avatar)
## Logs
The service uses a preconfigured log directory and logs into a combined log with all messages and an error log.
For the development environment the default directory is `./log` and for production it is `/var/log/avatar`.
Additionally, if the service is not running in production mode all messages get logged to the console.## Development
### Setup
#### Prerequisites
- Node.js installation
- Libraries for image editing
- apiDoc installation, if editing docs#### Steps
- Run `brew install node` or similar to install Node.js
- Run `brew install pkg-config cairo pango libpng jpeg giflib librsvg` or similar to install libraries for image editing
- Run `npm install -g apidoc` to install apiDoc globally### Usage
- Run `npm start` to start service
- Run `npm run dev` to start service with nodemon
- Run `npm run generate:docs` to generate API docs from source code## Contributions
See [CONTRIBUTING](https://github.com/frncsdrk/avatar/blob/main/CONTRIBUTING.md)
## Credits
See [CREDITS](https://github.com/frncsdrk/avatar/blob/main/CREDITS)
## License
[MIT](https://github.com/frncsdrk/avatar/blob/main/LICENSE) (c) 2018 - 2024 frncsdrk and contributors