Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/aristo-ifrn/django-memory-game
- Owner: aristo-ifrn
- License: mit
- Created: 2024-11-21T23:55:24.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-06T00:08:07.000Z (about 2 months ago)
- Last Synced: 2024-12-06T01:20:21.785Z (about 2 months ago)
- Topics: dajngo, python, sqlite
- Language: SCSS
- Homepage:
- Size: 31.3 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
๐ง 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