Quickstart Guide
Get Crafter LoL up and running on your local machine in just a few minutes. This guide will walk you through cloning the repository, setting up the backend, and launching the frontend.Prerequisites
Before you begin, make sure you have the following installed:Java 17+
Required for running the Spring Boot backend
Maven 3.6+
Build tool for the Java backend
Node.js 16+
Required for the React frontend
You can verify your installations by running
java -version, mvn -version, and node -version in your terminal.Installation Steps
Clone the repository
Start by cloning the Crafter LoL repository to your local machine.The repository contains two main directories:
Back/crafter- Spring Boot backendFront/Crafter_League_of_Legends- React frontend
Set up and start the backend
Navigate to the backend directory and start the Spring Boot server.The backend will:
- Start on
http://localhost:5000 - Fetch League of Legends item data from the Data Dragon API
- Cache item data for fast responses
- Expose REST endpoints at
/api/game/*
Backend startup logs
Backend startup logs
You should see output similar to this:
Launch the frontend
In a new terminal window, navigate to the frontend directory and start the React app.The frontend will:
- Install all dependencies (React, Axios, Framer Motion, etc.)
- Start the Vite dev server
- Open your browser automatically to
http://localhost:5173
If your browser doesn’t open automatically, check the terminal output for the exact URL and port number.
Configuration Options
Backend Configuration
The backend uses default settings that work out of the box. If you need to customize the configuration, editBack/crafter/src/main/resources/application.properties:
Frontend Configuration
The frontend connects to the backend API. If you changed the backend port, update the frontend configuration:.env file in Front/Crafter_League_of_Legends/ if it doesn’t exist.
Verification
After completing the setup, verify everything is working:Backend health check
Backend health check
Test the backend API by fetching a random question:You should receive a JSON response with a target item and component options.
Frontend connection test
Frontend connection test
Open the browser console (F12) and check for any errors. You should see successful API calls to the backend:
Troubleshooting
Backend port already in use
Backend port already in use
If port 5000 is already in use, you can change it:
- Edit
application.propertiesand setserver.port=8081 - Update the frontend
.envfile:VITE_API_URL=http://localhost:8081/api - Restart both servers
CORS errors in browser console
CORS errors in browser console
The backend includes CORS configuration for
http://localhost:5173. If your frontend runs on a different port:- Edit
Back/crafter/src/main/java/.../config/CorsConfig.java - Add your frontend URL to the
allowedOriginslist - Restart the backend
Failed to fetch item data
Failed to fetch item data
If the backend can’t fetch Data Dragon data:
- Check your internet connection
- Verify the Data Dragon API is accessible: https://ddragon.leagueoflegends.com/
- Try updating the
ddragon.versioninapplication.propertiesto a recent patch
Frontend not connecting to backend
Frontend not connecting to backend
If the frontend can’t reach the backend:
- Verify the backend is running:
curl http://localhost:5000/api/game/question - Check the frontend console for CORS or network errors
- Ensure the
VITE_API_URLin your.envmatches the backend URL - Restart the frontend dev server after changing
.envfiles
Next Steps
Now that you have Crafter LoL running, explore these guides to learn more:How to Play
Learn the gameplay mechanics and controls
Difficulty Levels
Understand the different challenge modes
Development Setup
Set up a full development environment
API Reference
Explore the backend API endpoints