Skip to content

jorbush/pokedex-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokedex AI

This project is a real Pokedex implementation using Weaviate (a neural network and a vector database) to recognize the Pokemon. The frontend is a React Native app which uses a Hono server to communicate with Weaviate.

pokedex-ai.MP4

Concept Design

Initial Design

Architecture

Architecture

Note

Both devices need to be connected to the same network.

Requirements

Pokemon AI App

cd pokemon-ai-app

Setup

You need to create a .env file in the root of the project with the following content:

LOCAL_IP='your_local_ip'

Note

Replace your_local_ip with your local IP address.

To get your local IP address, you can run the following command:

ipconfig getifaddr en0

Warning

This command is for macOS. If you are using another OS, you need to find the equivalent command.

Install dependencies

npm install

Run app

npm run ios

Format code

npm run format

Pokemon Engine

cd pokemon-engine

Install dependencies

bun install

Run Weaviate

To run Weaviate, you need to have Docker installed. Then, you can run the following command:

docker-compose up -d

Run server

To run Hono API Server, you can run the following command:

bun start

Testing

Run unit tests

bun test

Test Pokedex Engine

To test Weaviate, you can run the following command:

bun run tests/quick-engine-test.ts

Test Pokedex Engine Hono Server

Using Postman

You can make a POST request to http://localhost:3000/pokedex with the following body:

{
  "image": "[your_image_base64]"
}

Note

Replace [your_image_base64] with the base64 of the image you want to test.

You should have something like this:

Postman

Using curl

To test Hono API Server, you can run the following command while the server is running:

curl -X POST http://localhost:3000/pokedex \
  -H "Content-Type: application/json" \
  -d '{"image": "[your_image_base64]"}'

Note

Replace [your_image_base64] with the base64 of the image you want to test.

Format code

bun format

Linter

npx oxlint