Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ljvmiranda921/sprites-as-a-service

Generate your personal 8-bit avatars using Cellular Automata, a mathematical model that simulates life, survival, and extinction
https://github.com/ljvmiranda921/sprites-as-a-service

avatar-generator cellular-automata fastapi nuxtjs pixel-art python sprites vuejs

Last synced: 29 days ago
JSON representation

Generate your personal 8-bit avatars using Cellular Automata, a mathematical model that simulates life, survival, and extinction

Awesome Lists containing this project

README

        

![](frontend/static/header.png)

[![Github Pages](https://github.com/ljvmiranda921/sprites-as-a-service/workflows/Github%20Pages/badge.svg)](https://github.com/ljvmiranda921/sprites-as-a-service/actions?query=workflow%3A%22Github+Pages%22)
[![Cloud Run](https://github.com/ljvmiranda921/sprites-as-a-service/workflows/Cloud%20Run/badge.svg)](https://github.com/ljvmiranda921/sprites-as-a-service/actions?query=workflow%3A%22Cloud+Run%22)
[![Frontend CI](https://github.com/ljvmiranda921/sprites-as-a-service/workflows/Frontend%20CI/badge.svg)](https://github.com/ljvmiranda921/sprites-as-a-service/actions?query=workflow%3A%22Frontend+CI%22)
[![Backend CI](https://github.com/ljvmiranda921/sprites-as-a-service/workflows/Backend%20CI/badge.svg)](https://github.com/ljvmiranda921/sprites-as-a-service/actions?query=workflow%3A%22Backend+CI%22)

**Try the interactive demo [here](https://ljvmiranda921.github.io/sprites-as-a-service) :sparkles::sparkles:**

**I do not authorize the use of anything generated by this project for the selling of NFTs. 🙅‍❌**

**Sprites-as-a-Service** is an open-source web application that allows you to
generate custom 8-bit sprites using Cellular Automata, particularly Conway's
Game of Life. Generate a unique sprite given a text, and control extinction and
survival rates. In addition, you can also access the generator via a REST API.
**Use it for your chat app or games!**

The frontend is made with Vue.js (with Nuxt.js) whereas the backend is done
using Python and FastAPI.

You can also read my creative process and motivation for building this app in [my blog](https://ljvmiranda921.github.io/projects/2020/03/31/cellular-sprites/)

## Running the development server

The easiest way to run Sprites-as-a-service locally is via [docker
compose](https://docs.docker.com/compose/). First, clone this repository:

```sh
git clone [email protected]:ljvmiranda921/sprites-as-a-service.git
```

then build the images:

```sh
cd sprites-as-a-service
docker-compose build
```

This will then build two images, `sprites-backend` and `sprites-frontend`, for
the backend and frontend services of the web app. You can then run them with
the command:

```sh
docker-compose -d up
```

You should be able to see the application running at
[localhost:8080](localhost:8080). Close these services using:

```sh
docker-compose down
```

## Production server and deployment

The frontend demo application is currently deployed in my website. I first
generate a static website using Nuxt's `npm run generate`, then serve it on
Github pages. To see the frontend deployment procedure, I encourage you to
check `.github/workflows/gh-pages.yml`.

On the other hand, the backend service is deployed in [Google Cloud
Run](https://cloud.google.com/run/). I first build the image found in
`./backend/Dockerfile` and deploy them to GCP. Check
`.github/workflows/cloud-run.yml` for more information.

I highly-encourage you to use the [Docker
images](https://github.com/ljvmiranda921/sprites-as-a-service/packages)
published in this repository. You might not need the frontend component itself,
but the backend can be deployed as a microservice.

```sh
docker pull docker.pkg.github.com/ljvmiranda921/sprites-as-a-service/sprites-backend:latest
```

## Notable Implementations

- [@danielgjackson](https://github.com/danielgjackson) has a pure-Javascript port for Sprites-as-a-Service. From that he made [Infinite Sprites!](https://danielgjackson.github.io/sprite/infinite.html) I encourage you to check it out and spend your hours looking at them!
- [@yurkth](https://github.com/yurkth) created [Sprator](https://github.com/yurkth/sprator), a GUI application that generates sprites using cellular automaton. Here, you can set a seed, base & background colors, and size!

## License

The content of this project itself is licensed under the [Creative Commons
Attribution 4.0 license](https://creativecommons.org/licenses/by/4.0/deed.ast), and the underlying source code used to generate the
sprites and build the website is licensed under the [MIT license](https://github.com/ljvmiranda921/sprites-as-a-service/blob/master/LICENSE).