I built a full-stack web application that can accurately guess in real time what digit the user draws on a canvas. I used two different methods:
- Writing a Pytorch model trained on MNIST
- Sending the image to Gemini API
Technologies Used:
- Frontend: React, Vite
- Backend: Node.js, Express.js, FastAPI
- Machine Learning: Python, PyTorch
- AI API: Google Gemini API
- Node.js
- Python
If you want to use the Gemini API version of this project, you must create your own API key.
-
Go to Google AI Studio and generate an API key.
-
Inside .env in backend/gemini-made-model:
GEMINI_API_KEY=your_api_key_here-
Clone the Repository
git clone <your-repo-url> cd Digit-Guesser
-
Install Dependencies
npm install # in frontend folder pip install torch torchvision uvicorn fastapi # in backend folder
-
Start the Development Server
To use the model I wrote:
cd frontend/self-made-model-frontend npm run devTo use the Gemini API:
cd frontend/gemini-made-model-frontend npm run dev -
Start the Backend
To use the model I wrote:
cd backend/self-made-model uvicorn server:app --reloadTo use the Gemini API:
cd backend/gemini-made-model node server.js