Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aristo-ifrn/django-memory-game

๐Ÿง  A memory game integrated with Django
https://github.com/aristo-ifrn/django-memory-game

dajngo python sqlite

Last synced: about 1 month ago
JSON representation

๐Ÿง  A memory game integrated with Django

Awesome Lists containing this project

README

        




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:

- [Python 3.8+](https://www.python.org/)
- [Django 4.0+](https://www.djangoproject.com/)
- [SQLite](https://www.sqlite.org/index.html)


## ๐Ÿง‘๐Ÿปโ€๐Ÿ’ป Getting Started

#### Clone the project and access the root folder:

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

#### Setting up the environment:

1. Install the dependencies:

```bash
$ pip install -r requirements.txt
```

2. Run the migrations to set up the database:
```bash
$ python manage.py migrate
```

3. Start the server:

```bash
$ 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

- [x] Play the memory game and track player performance.
- [x] Save game results (username, flips, time, and completion status) to a database.
- [x] View a ranking of players based on game performance.
- [x] 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.

```json
{
"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