This project is a Minesweeper game with a backend and frontend. The backend is built with Django, and the frontend is built with React.
- Node.js and npm
- Python and pip
- Django
-
Clone the repository:
git clone <repository-url> cd <repository-directory>/minesweeper-backend
-
Create a virtual environment:
python -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Start the backend server:
python manage.py runserver
The backend server should now be running at http://localhost:8000
.
-
Navigate to the frontend directory:
cd <repository-directory>/minesweeper-frontend
-
Install dependencies:
npm install
-
Start the frontend server:
npm start
The frontend server should now be running at http://localhost:3000
.
The backend code is located in the minesweeper-backend
directory. The main files include:
game/views/game.py
: Contains the game logic and API endpoints for the Minesweeper game.
The frontend code is located in the minesweeper-frontend
directory. The main files include:
src/App.js
: Main application component.src/GameBoard.js
: Component for rendering the game board.src/Cell.js
: Component for rendering individual cells.src/styles.css
: CSS styles for the application.
The frontend uses an environment variable for the API base URL. You can set this in a .env
file in the minesweeper-frontend
directory: