- Project Overview
- Setup Instructions
- Backend Setup
- Frontend Setup
- Running the Application
- Testing Instructions
- QA Checklist
- Troubleshooting Guide
The Runes Recognition project is a web application that allows users to upload, manage, and recognize rune images. It consists of a FastAPI backend and a React frontend.
Key Features:
- User registration and authentication
- Rune image upload and management
- Rune recognition using image processing techniques
- Admin functionality for user management
The Runes Recognition project consists of two separate applications:
- Backend API (FastAPI)
- Frontend Web Application (React)
-
Clone the backend repository:
git clone <backend_repo_url> cd runes_recognition_backend -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` -
Install dependencies:
pip install -r requirements.txt -
Set up the database:
alembic upgrade head -
Start the backend server:
uvicorn main:app --reload
The backend will be available at http://localhost:8000.
-
Clone the frontend repository:
git clone <frontend_repo_url> cd runes_recognition_frontend -
Install dependencies:
npm install -
Start the development server:
npm start
The frontend will be available at http://localhost:3000.
cd runes_recognition_backend
pytest
cd runes_recognition_frontend
npm test
Use the Postman collection provided to test backend endpoints. For frontend testing, follow the QA checklist below.
- User can register with a unique username and email
- User can log in with correct credentials
- User cannot log in with incorrect credentials
- User can log out
- Authenticated user can access protected routes
- Unauthenticated user is redirected to login page for protected routes
- User can view a list of their runes
- User can create a new rune by uploading an image and providing a linked URL
- User can edit the linked URL of an existing rune
- User can delete their own rune
- Pagination works correctly in the rune list
- Rune list displays correct total count
- Admin can view a list of all users
- Admin can change a user's role
- Admin can view and manage all runes
- System correctly processes uploaded rune images
- System can match a rune image to existing runes in the database
- System returns appropriate similarity scores for matched runes
- Appropriate error messages are displayed for invalid inputs
- Server errors are handled gracefully and informative messages are shown to the user
- Pages load within acceptable time limits
- Rune recognition process completes within acceptable time limits
- Application is usable on desktop browsers
- Application is usable on mobile devices (especially iPhone 12)
-
Database connection errors
- Ensure the database URL in
database.pyis correct - Check if the database server is running
- Ensure the database URL in
-
Missing dependencies
- Run
pip install -r requirements.txtto ensure all dependencies are installed
- Run
-
Alembic migration errors
- Ensure you've run
alembic upgrade head - Check alembic version table in the database
- Ensure you've run
-
npm install fails
- Clear npm cache:
npm cache clean --force - Delete
node_modulesfolder andpackage-lock.json, then runnpm installagain
- Clear npm cache:
-
API calls failing
- Check if the backend server is running
- Ensure the API base URL in the frontend code is correct
-
Authentication issues
- Check if the JWT token is being stored correctly in localStorage
- Ensure the token is being sent with API requests
-
Recognition accuracy is low
- Review the feature extraction process in
hog_extractor.py - Consider adjusting parameters or trying different feature extraction methods
- Review the feature extraction process in
-
Image processing errors
- Ensure uploaded images are in supported formats (PNG, JPEG)
- Check if the image processing library (OpenCV) is correctly installed
If issues persist, please check the application logs for more detailed error messages.