Skip to content

aristo-ifrn/django-memory-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Memory Game

Version License Django

🧠 A memory game integrated with Django to track and save player results in a database.


🧪 Technologies

This project was developed using the following technologies:


🧑🏻‍💻 Getting Started

Clone the project and access the root folder:

$ git clone https://github.com/aristo-ifrn/django-memory-game
$ cd django-memory-game

Setting up the environment:

  1. Install the dependencies:
$ pip install -r requirements.txt
  1. Run the migrations to set up the database:
$ python manage.py migrate
  1. Start the server:
$ python manage.py runserver

Access the application in your browser at http://127.0.0.1:8000/.


💻  Project

Resume: 🧠 A Django-powered memory game application where players' results, including flips, time, and completion status, are saved and displayed in a ranking system.

🎨  Project Structure

  • templates/: HTML templates for the frontend (index.html, game.html, ranking.html).
  • views.py: Defines the logic for handling game, ranking, and API endpoints.
  • models.py: Contains the Player model to store player data in the database.
  • urls.py: Maps application routes to views.
  • static/: Contains CSS, JavaScript, and other static assets.

🚀  Features

  • Play the memory game and track player performance.
  • Save game results (username, flips, time, and completion status) to a database.
  • View a ranking of players based on game performance.
  • Expose API endpoints for fetching and adding player data.

📚 API Endpoints

  • GET /get/

Returns a JSON response with all player results, ordered by completion status, flips, and time.

  • POST /add/

Accepts JSON data to create a new player result.

{
  "username": "JohnDoe",
  "flips_quantity": 15,
  "used_time": 120,
  "date": "2024-11-22T12:34:56",
  "has_completed": true
}

🧑🏻  Author

aristofany-herderson

Aristofany Herderson

linkedin linkedin linkedin