# Artwork Battle
A tiny app that makes the [Art Institute of Chicago®](https://www.artic.edu/) art pieces battle against each other and ranks them using an [ELO rating system](https://en.wikipedia.org/wiki/Elo_rating_system).
Please have a look at the [live demo here](https://art-battle.netlify.app)
Made possible thanks to the open [API](https://api.artic.edu) of the Art Institute of Chicago®
---
## What it looks like

---
## 💻 Run locally
Clone or fork this repository and install dependencies locally.
### Prerequisites
Requires Node 18.20.3 or higher, and npm 9.1.1 or higher.
To run the project locally, you'll need a running SQL database and a table with the correct models.
1. Set up a database
It can be remote (I used [CockroachDB](https://www.cockroachlabs.com/) myself), but if you prefer to run it locally, here's a [step-by-step guide on how to do it with PostgreSQL on Windows, Linux, and Mac.](https://www.prisma.io/dataguide/postgresql/setting-up-a-local-postgresql-database)
2. Add your connection string to the env
create the file `api/.env` and set the `DATABASE_URL` variable with your database url value:
`DATABASE_URL=`
3. Create the score table
For this step, you need to run the following command:
`npx prisma migrate dev`
4. Optional: populate your database with some data
Optionally, you can populate your database with some fake data by running this command:
`npx prisma seed`
With your database running and your score table created, it's now time to run the App!
### Installation
Install the project dependencies by running:
`yarn install`
Starting the application in development
This project uses netlify and netlify functions, to start the development server, just run:
`yarn start`
If everything went well, you should now have an app running at http://localhost:8888
---
#### Happy battling! 🎨