Skip to content

anveshr1/minesweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper Game

This project is a Minesweeper game with a backend and frontend. The backend is built with Django, and the frontend is built with React.

Prerequisites

  • Node.js and npm
  • Python and pip
  • Django

Backend Setup

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>/minesweeper-backend
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run migrations:

    python manage.py migrate
  5. Start the backend server:

    python manage.py runserver

The backend server should now be running at http://localhost:8000.

Frontend Setup

  1. Navigate to the frontend directory:

    cd <repository-directory>/minesweeper-frontend
  2. Install dependencies:

    npm install
  3. Start the frontend server:

    npm start

The frontend server should now be running at http://localhost:3000.

Project Structure

Backend

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.

Frontend

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.

Environment Variables

The frontend uses an environment variable for the API base URL. You can set this in a .env file in the minesweeper-frontend directory:

About

Minesweeper Game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages