From 1c68f4542261654d5415d1759e78dbfecceb56e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20=C5=BBenta=C5=82a?= Date: Sun, 17 Dec 2023 20:17:24 +0100 Subject: [PATCH] Add fixtures with example games and game categories --- .github/workflows/django.yml | 29 +++-- .vscode/task_check_environment.sh | 0 Pipfile | 2 +- README.md | 38 ++++--- app/fixtures/categories_fixtures.json | 65 +++++++++++ app/fixtures/games_fixtures.json | 152 ++++++++++++++++++++++++++ app/migrations/0001_initial.py | 106 +++++++----------- app/migrations/0002_game_desc.py | 19 ---- app/models.py | 24 +++- app/templates/base.html | 6 +- app/templates/index.html | 8 +- deploy/README.md | 3 - game_player_nick_finder/settings.py | 5 +- games_categories.json | 37 ------- games_list.json | 92 ---------------- server/README.md | 120 -------------------- 16 files changed, 323 insertions(+), 383 deletions(-) mode change 100644 => 100755 .vscode/task_check_environment.sh create mode 100644 app/fixtures/categories_fixtures.json create mode 100644 app/fixtures/games_fixtures.json delete mode 100644 app/migrations/0002_game_desc.py delete mode 100644 deploy/README.md delete mode 100755 games_categories.json delete mode 100755 games_list.json delete mode 100644 server/README.md diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index dc6aa80..a75dd55 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -16,14 +16,14 @@ jobs: python-version: [3.7, 3.8, 3.9] steps: - + - uses: actions/checkout@v3 - + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - + - name: Install Dependencies run: | python -m pip install --upgrade pip @@ -34,15 +34,14 @@ jobs: # python manage.py test - name: Upload a Build Artifact - uses: actions/upload-artifact@v3.1.3 - with: - # Artifact name - name: # optional, default is artifact - # A file, directory or wildcard pattern that describes what to upload - path: - # The desired behavior if no files are found using the provided path - error: "" - - if-no-files-found: # optional, default is warn - - retention-days: # optiona + uses: actions/upload-artifact@v3.1.3 + with: + # Artifact name + # name: # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + # path: + # The desired behavior if no files are found using the provided path + error: "" + + # if-no-files-found: # optional, default is warn + # retention-days: # optiona diff --git a/.vscode/task_check_environment.sh b/.vscode/task_check_environment.sh old mode 100644 new mode 100755 diff --git a/Pipfile b/Pipfile index 583d62a..6463f05 100644 --- a/Pipfile +++ b/Pipfile @@ -17,4 +17,4 @@ django-allauth = "*" [dev-packages] [requires] -python_version = "3.8" +python_version = "3.10" diff --git a/README.md b/README.md index 6cecfde..1e36d14 100644 --- a/README.md +++ b/README.md @@ -46,13 +46,13 @@ Contribute to the "Game Player Nick Finder" project by: Your input helps us evolve and improve the platform for the benefit of all gamers. -## Installation and Running the Application Locally +### Installation and Running the Application Locally Before you proceed, ensure that your system has the following installed: * Python (version 3.6 or newer) * pip (Python package management tool) [sudo apt install python3-pip] * pipenv (Python packaging tool for virtual environments) [pip install pipenv] -### Step 1: Clone the Repository +#### Step 1: Clone the Repository Clone the repository to your local computer using the following git command: ```bash @@ -60,7 +60,7 @@ git clone https://github.com/zentala/game_player_nick_finder cd game_player_nick_finder ``` -### Step 2: Setup pipenv +#### Step 2: Setup pipenv To set up the pipenv environment and install dependencies, run the following command: ```bash @@ -69,29 +69,35 @@ pipenv install This will create a `Pipfile` and `Pipfile.lock` if they don't exist and install all required dependencies. -### Step 3: Activate pipenv Environment +#### Step 3: Activate pipenv Environment To activate the pipenv environment, use: ```bash pipenv shell ``` -### Step 4: Configure the Database +#### Step 4: Configure the Database The application uses SQLite as the default database, so there is no need to set up an additional database. You can simply perform the database migration: ```bash python manage.py migrate ``` -### Step 5: Create admin user +#### Step 5: Create admin user ```bash python manage.py createsuperuser ``` -### Step 6: .env Configuration +#### Step 6: Apply fixtures +```bash +python manage.py loaddata app/fixtures/categories_fixtures.json +python manage.py loaddata app/fixtures/games_fixtures.json +``` + +#### Step 7: .env Configuration Before using certain features, such as email notifications, you need to configure the environment variables. First, make a copy of the `.env.example` file and rename it to `.env`. Then, update the values with the correct configurations for your environment. -### Step 7: Run the Server +#### Step 8: Run the Server To start the Django development server, run the following command: ```bash @@ -100,17 +106,17 @@ python manage.py runserver The application should now be accessible at http://localhost:8000/ -## Intallation and Deamonizing Application on Server +### Intallation and Deamonizing Application on Server 1) Follow all steps for local installation and startup. Verify that the application is running at http://localhost:8000/. 2) Copy `ecosystem.config.js.manage` or `ecosystem.config.js.wsgi` (recommended) into `ecosystem.config.js` and adjust paths in the configuration file. 3) Daemonize the server using the command `pm2 start ecosystem.config.js`. Ensure you have PM2 installed. If not, you can install it using the command `npm install pm2 -g`. 4) Configure the nginx server to handle requests under a specific domain and add an SSL Certificate. You can use Let's Encrypt for a free SSL certificate. Keep in mind that nginx configuration may vary depending on your operating system and specific requirements. -## Options in manage.py +### Options in manage.py `manage.py` is a script file in Django that allows you to manage the application and execute various commands. Here are several useful options provided by `manage.py`: -### `flush` +#### `flush` The `flush` command removes all data from the database while leaving the tables intact. This is useful during testing when you want to clear the database and start tests from a clean state. @@ -119,7 +125,7 @@ Example usage: python manage.py flush ``` -### `migrate` +#### `migrate` The `migrate` command executes database migrations. Migrations are a way to keep the database structure in sync with the data model in the application. It allows creating, modifying, and deleting tables and fields in the database based on changes in the models. @@ -128,7 +134,7 @@ Example usage: python manage.py migrate ``` -### `makemigrations` +#### `makemigrations` The `makemigrations` command is used to generate new migration files based on changes in the application's models. After making changes to the models, use this command to prepare new migrations before applying them with `migrate`. @@ -137,7 +143,7 @@ Example usage: python manage.py makemigrations ``` -### `shell` +#### `shell` The `shell` command runs an interactive Python console with all Django models loaded. This allows for interactive data analysis and experimentation with database operations. @@ -146,7 +152,7 @@ Example usage: python manage.py shell ``` -### `createsuperuser` +#### `createsuperuser` The `createsuperuser` command allows you to create a new superuser for the application. The superuser can log in to the Django admin panel and manage the application data. @@ -155,7 +161,7 @@ Example usage: python manage.py createsuperuser ``` -### Other Commands +#### Other Commands In addition to the ones mentioned above, there are many other commands available in `manage.py` that you can use for various purposes, such as managing users, generating reports, running tests, etc. To see a full list of commands and their descriptions, you can use the `help` command: diff --git a/app/fixtures/categories_fixtures.json b/app/fixtures/categories_fixtures.json new file mode 100644 index 0000000..9ef1e2f --- /dev/null +++ b/app/fixtures/categories_fixtures.json @@ -0,0 +1,65 @@ +[ + { + "model": "app.gamecategory", + "pk": 1, + "fields": { + "title": "MMORPGs", + "slug": "mmorpgs", + "description": "Massively multiplayer online role-playing games where players can explore vast worlds, complete quests, and connect with a large community of gamers." + } + }, + { + "model": "app.gamecategory", + "pk": 2, + "fields": { + "title": "Action and Shooters", + "slug": "action-shooters", + "description": "Fast-paced action and shooter games that offer intense gameplay, strategic team play, and competitive multiplayer experiences." + } + }, + { + "model": "app.gamecategory", + "pk": 3, + "fields": { + "title": "Survival and Sandbox", + "slug": "survival-sandbox", + "description": "Survival and sandbox games that challenge players to explore, build, and survive in open-world environments, often with multiplayer support." + } + }, + { + "model": "app.gamecategory", + "pk": 4, + "fields": { + "title": "Strategy and MOBA", + "slug": "strategy-moba", + "description": "Strategic and multiplayer online battle arena games that require tactical thinking, team coordination, and in-depth game knowledge." + } + }, + { + "model": "app.gamecategory", + "pk": 5, + "fields": { + "title": "Adventure and Social", + "slug": "adventure-social", + "description": "Adventure and social games that focus on storytelling, exploration, and building connections with other players." + } + }, + { + "model": "app.gamecategory", + "pk": 6, + "fields": { + "title": "Sports and Racing", + "slug": "sports-racing", + "description": "Competitive sports and racing games that simulate real-world sports, offering both single-player and multiplayer experiences." + } + }, + { + "model": "app.gamecategory", + "pk": 7, + "fields": { + "title": "Card and Board Games", + "slug": "card-board-games", + "description": "Digital card and board games that recreate the magic of tabletop gaming in an online environment." + } + } +] diff --git a/app/fixtures/games_fixtures.json b/app/fixtures/games_fixtures.json new file mode 100644 index 0000000..50406fd --- /dev/null +++ b/app/fixtures/games_fixtures.json @@ -0,0 +1,152 @@ +[ + { + "model": "app.game", + "pk": 1, + "fields": { + "name": "World of Warcraft", + "desc": "A leading MMORPG known for its rich lore and expansive world, offering players endless adventures.", + "slug": "world-of-warcraft", + "category": 1 + } + }, + { + "model": "app.game", + "pk": 2, + "fields": { + "name": "Final Fantasy XIV", + "desc": "A fantasy MMORPG with a focus on storytelling and community, offering a deeply engaging world.", + "slug": "final-fantasy-xiv", + "category": 1 + } + }, + { + "model": "app.game", + "pk": 3, + "fields": { + "name": "The Elder Scrolls Online", + "desc": "An MMORPG set in the Elder Scrolls universe, featuring a vast world and freedom in gameplay.", + "slug": "the-elder-scrolls-online", + "category": 1 + } + }, + { + "model": "app.game", + "pk": 4, + "fields": { + "name": "Fortnite", + "desc": "A popular battle royale game that combines fast-paced action with strategic building elements.", + "slug": "fortnite", + "category": 2 + } + }, + { + "model": "app.game", + "pk": 5, + "fields": { + "name": "Apex Legends", + "desc": "A high-adrenaline battle royale set in the Titanfall universe, known for its dynamic gameplay and unique characters.", + "slug": "apex-legends", + "category": 2 + } + }, + { + "model": "app.game", + "pk": 6, + "fields": { + "name": "Minecraft", + "desc": "A sandbox game that revolutionized gaming with its creative and building aspects, appealing to all ages.", + "slug": "minecraft", + "category": 3 + } + }, + { + "model": "app.game", + "pk": 7, + "fields": { + "name": "ARK: Survival Evolved", + "desc": "A survival game where players tame dinosaurs, build bases, and explore a mysterious island.", + "slug": "ark-survival-evolved", + "category": 3 + } + }, + { + "model": "app.game", + "pk": 8, + "fields": { + "name": "League of Legends", + "desc": "One of the most popular MOBAs, known for its competitive gameplay and diverse champion roster.", + "slug": "league-of-legends", + "category": 4 + } + }, + { + "model": "app.game", + "pk": 9, + "fields": { + "name": "Dota 2", + "desc": "A complex and strategic MOBA with deep mechanics and a high skill ceiling, offering intense team battles.", + "slug": "dota-2", + "category": 4 + } + }, + { + "model": "app.game", + "pk": 10, + "fields": { + "name": "Among Us", + "desc": "A social deduction game where players work together while trying to identify the impostors among them.", + "slug": "among-us", + "category": 5 + } + }, + { + "model": "app.game", + "pk": 11, + "fields": { + "name": "Roblox", + "desc": "A platform that allows users to create and play games designed by other users, fostering a strong creative community.", + "slug": "roblox", + "category": 5 + } + }, + { + "model": "app.game", + "pk": 12, + "fields": { + "name": "FIFA 21", + "desc": "The latest in the FIFA series, offering realistic soccer simulation with various teams and leagues.", + "slug": "fifa-21", + "category": 6 + } + }, + { + "model": "app.game", + "pk": 13, + "fields": { + "name": "Rocket League", + "desc": "A unique sports game that combines soccer with cars, known for its fast-paced and exciting gameplay.", + "slug": "rocket-league", + "category": 6 + } + }, + { + "model": "app.game", + "pk": 14, + "fields": { + "name": "Magic: The Gathering Arena", + "desc": "A digital version of the popular card game, offering the same depth and strategy as the physical game.", + "slug": "magic-the-gathering-arena", + "category": 7 + } + }, + { + "model": "app.game", + "pk": 15, + "fields": { + "name": "Tabletop Simulator", + "desc": "A sandbox that allows players to create and play tabletop games in a virtual environment.", + "slug": "tabletop-simulator", + "category": 7 + } + } +] diff --git a/app/migrations/0001_initial.py b/app/migrations/0001_initial.py index 0936ee7..79064e6 100644 --- a/app/migrations/0001_initial.py +++ b/app/migrations/0001_initial.py @@ -1,41 +1,9 @@ -# Generated by Django 3.2.20 on 2023-07-22 22:48 +# Generated by Django 5.0 on 2023-12-17 19:01 -from django.conf import settings import django.core.validators -from django.db import migrations, models import django.db.models.deletion -from django.utils.text import slugify - -def generate_unique_slug(model, value, separator='-'): - slug = slugify(value) - unique_slug = slug - num = 1 - while model.objects.filter(slug=unique_slug).exists(): - unique_slug = f"{slug}{separator}{num}" - num += 1 - return unique_slug - -def seed_data(apps, schema_editor): - print('seeding user admin:pswd123') - User = apps.get_model('auth', 'User') - Account = apps.get_model('app', 'Account') - user = User.objects.create_user(username='admin', password='password123') - account = Account.objects.create(user=user) - - print('Seed data for Game model') - Game = apps.get_model('app', 'Game') - games_to_create = [ - {'name': 'Cossacks IV'}, - {'name': 'WoW'}, - {'name': 'Tibia'}, - {'name': 'Sims 4'}, - {'name': 'Civilization V'}, - ] - - for game_data in games_to_create: - game_name = game_data['name'] - unique_slug = generate_unique_slug(Game, game_name) - game = Game.objects.create(name=game_name, slug=unique_slug) +from django.conf import settings +from django.db import migrations, models class Migration(migrations.Migration): @@ -47,6 +15,15 @@ class Migration(migrations.Migration): ] operations = [ + migrations.CreateModel( + name='GameCategory', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100, unique=True)), + ('slug', models.SlugField(max_length=100, unique=True)), + ('description', models.TextField(blank=True, validators=[django.core.validators.MaxLengthValidator(1000)])), + ], + ), migrations.CreateModel( name='Account', fields=[ @@ -65,36 +42,25 @@ class Migration(migrations.Migration): ('nickname', models.TextField(validators=[django.core.validators.MaxLengthValidator(100)])), ('description', models.TextField(blank=True, validators=[django.core.validators.MaxLengthValidator(1000)])), ('visibility', models.BooleanField()), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( - name='Game', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100, unique=True)), - ('slug', models.SlugField(max_length=100, unique=True)), - ('icon', models.ImageField(blank=True, upload_to='icons/')), - ], - ), - migrations.CreateModel( - name='Message', + name='EmailNotification', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('subject', models.CharField(max_length=200)), ('content', models.TextField()), ('sent_date', models.DateTimeField(auto_now_add=True)), - ('receiver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='received_messages', to='app.account')), - ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_messages', to='app.account')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.account')), ], ), migrations.CreateModel( - name='GamePlayed', + name='Friend', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('year_started', models.PositiveIntegerField(blank=True, help_text='Started year in format YYYY.', null=True, validators=[django.core.validators.MinValueValidator(1900), django.core.validators.MaxValueValidator(2099)])), - ('year_ended', models.PositiveIntegerField(blank=True, help_text='Ended year in format YYYY.', null=True, validators=[django.core.validators.MinValueValidator(1900), django.core.validators.MaxValueValidator(2099)])), - ('character', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.character')), - ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.game')), + ('friend', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friend_of', to='app.account')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friends', to='app.account')), ], ), migrations.CreateModel( @@ -107,32 +73,40 @@ class Migration(migrations.Migration): ], ), migrations.CreateModel( - name='Friend', + name='Game', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('friend', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friend_of', to='app.account')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='friends', to='app.account')), + ('name', models.CharField(max_length=100, unique=True)), + ('slug', models.SlugField(max_length=100, unique=True)), + ('icon', models.ImageField(blank=True, upload_to='icons/')), + ('desc', models.TextField(blank=True, validators=[django.core.validators.MaxLengthValidator(1000)])), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='games', to='app.gamecategory')), ], ), migrations.CreateModel( - name='EmailNotification', + name='GamePlayed', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('subject', models.CharField(max_length=200)), - ('content', models.TextField()), - ('sent_date', models.DateTimeField(auto_now_add=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.account')), + ('year_started', models.PositiveIntegerField(blank=True, help_text='Started year in format YYYY.', null=True, validators=[django.core.validators.MinValueValidator(1900), django.core.validators.MaxValueValidator(2099)])), + ('year_ended', models.PositiveIntegerField(blank=True, help_text='Ended year in format YYYY.', null=True, validators=[django.core.validators.MinValueValidator(1900), django.core.validators.MaxValueValidator(2099)])), + ('character', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.character')), + ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.game')), ], ), migrations.AddField( model_name='character', name='games', - field=models.ManyToManyField(through='app.GamePlayed', to='app.Game'), + field=models.ManyToManyField(through='app.GamePlayed', to='app.game'), ), - migrations.AddField( - model_name='character', - name='user', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + migrations.CreateModel( + name='Message', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('subject', models.CharField(max_length=200)), + ('content', models.TextField()), + ('sent_date', models.DateTimeField(auto_now_add=True)), + ('receiver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='received_messages', to='app.account')), + ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_messages', to='app.account')), + ], ), - migrations.RunPython(seed_data, migrations.RunPython.noop) ] diff --git a/app/migrations/0002_game_desc.py b/app/migrations/0002_game_desc.py deleted file mode 100644 index 40efbe6..0000000 --- a/app/migrations/0002_game_desc.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-24 13:12 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('app', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='game', - name='desc', - field=models.TextField(blank=True, validators=[django.core.validators.MaxLengthValidator(1000)]), - ), - ] diff --git a/app/models.py b/app/models.py index 2c7c4fb..57d6ada 100644 --- a/app/models.py +++ b/app/models.py @@ -6,12 +6,26 @@ from django.dispatch import receiver from django.utils.text import slugify +class GameCategory(models.Model): + title = models.CharField(max_length=100, unique=True) + slug = models.SlugField(max_length=100, unique=True) + description = models.TextField(blank=True, validators=[MaxLengthValidator(1000)]) + + def save(self, *args, **kwargs): + if not self.slug: + self.slug = slugify(self.title) + super().save(*args, **kwargs) + + def __str__(self): + return self.title + class Game(models.Model): # slug = models.SlugField(max_length=100) name = models.CharField(max_length=100, unique=True) slug = models.SlugField(max_length=100, unique=True) icon = models.ImageField(upload_to='icons/', blank=True) desc = models.TextField(blank=True, validators=[MaxLengthValidator(1000)]) + category = models.ForeignKey(GameCategory, on_delete=models.CASCADE, related_name='games') def save(self, *args, **kwargs): @@ -29,7 +43,7 @@ class Account(models.Model): facebook = models.URLField(blank=True) twitch = models.URLField(blank=True) gender = models.CharField( - max_length=6, + max_length=6, choices=[('MALE', 'MALE'),('FEMALE', 'FEMALE')] ) @@ -62,7 +76,7 @@ def get_games_info(self): def __str__(self): return f"{self.user} - {self.nickname}" - + class GamePlayed(models.Model): character = models.ForeignKey(Character, on_delete=models.CASCADE) @@ -100,7 +114,7 @@ class Friend(models.Model): def __str__(self): return f"{self.user.username} - {self.friend.username}" - + class FriendRequest(models.Model): sender = models.ForeignKey(Account, on_delete=models.CASCADE, related_name='sent_friend_requests') receiver = models.ForeignKey(Account, on_delete=models.CASCADE, related_name='received_friend_requests') @@ -118,7 +132,7 @@ class Message(models.Model): def __str__(self): return self.subject - + class EmailNotification(models.Model): user = models.ForeignKey(Account, on_delete=models.CASCADE) subject = models.CharField(max_length=200) @@ -126,4 +140,4 @@ class EmailNotification(models.Model): sent_date = models.DateTimeField(auto_now_add=True) def __str__(self): - return self.subject \ No newline at end of file + return self.subject diff --git a/app/templates/base.html b/app/templates/base.html index 79164ae..82fc726 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -126,8 +126,8 @@ integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"> - @@ -143,4 +143,4 @@ - \ No newline at end of file + diff --git a/app/templates/index.html b/app/templates/index.html index 4f2da7b..2a6a1d1 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -6,7 +6,7 @@
-
+

Reconnect with Old Gaming Buddies!

Are you missing those unforgettable gaming sessions with your old buddies? Look no further! Our platform is here to help you revive the good old days by reuniting you with your gaming companions. Whether you used to conquer virtual realms together or embark on epic adventures, we bring back the camaraderie and thrill of gaming.

@@ -14,8 +14,8 @@

Reconnect with Old Gaming {% trans "Explore" %}

-
- +
+
@@ -127,4 +127,4 @@

Centered hero

--> -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/deploy/README.md b/deploy/README.md deleted file mode 100644 index a917872..0000000 --- a/deploy/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Game Player Nick Finder Build & Deployment - -TODO \ No newline at end of file diff --git a/game_player_nick_finder/settings.py b/game_player_nick_finder/settings.py index ebe47c5..1f50dbd 100644 --- a/game_player_nick_finder/settings.py +++ b/game_player_nick_finder/settings.py @@ -57,6 +57,7 @@ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'allauth.account.middleware.AccountMiddleware' ] # Define the URLConf for your application (e.g., your_app_name.urls) @@ -152,8 +153,8 @@ AUTHENTICATION_BACKENDS = ( #used for default signin such as loggin into admin panel - 'django.contrib.auth.backends.ModelBackend', - + 'django.contrib.auth.backends.ModelBackend', + #used for social authentications 'allauth.account.auth_backends.AuthenticationBackend', ) diff --git a/games_categories.json b/games_categories.json deleted file mode 100755 index ac8eb72..0000000 --- a/games_categories.json +++ /dev/null @@ -1,37 +0,0 @@ -[ - { - "title": "MMORPGs", - "slug": "mmorpgs", - "description": "Massively multiplayer online role-playing games where players can explore vast worlds, complete quests, and connect with a large community of gamers." - }, - { - "title": "Action and Shooters", - "slug": "action-shooters", - "description": "Fast-paced action and shooter games that offer intense gameplay, strategic team play, and competitive multiplayer experiences." - }, - { - "title": "Survival and Sandbox", - "slug": "survival-sandbox", - "description": "Survival and sandbox games that challenge players to explore, build, and survive in open-world environments, often with multiplayer support." - }, - { - "title": "Strategy and MOBA", - "slug": "strategy-moba", - "description": "Strategic and multiplayer online battle arena games that require tactical thinking, team coordination, and in-depth game knowledge." - }, - { - "title": "Adventure and Social", - "slug": "adventure-social", - "description": "Adventure and social games that focus on storytelling, exploration, and building connections with other players." - }, - { - "title": "Sports and Racing", - "slug": "sports-racing", - "description": "Competitive sports and racing games that simulate real-world sports, offering both single-player and multiplayer experiences." - }, - { - "title": "Card and Board Games", - "slug": "card-board-games", - "description": "Digital card and board games that recreate the magic of tabletop gaming in an online environment." - } -] diff --git a/games_list.json b/games_list.json deleted file mode 100755 index 24edd44..0000000 --- a/games_list.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "title": "World of Warcraft", - "desc": "A leading MMORPG known for its rich lore and expansive world, offering players endless adventures.", - "slug": "world-of-warcraft", - "category": "mmorpgs" - }, - { - "title": "Final Fantasy XIV", - "desc": "A fantasy MMORPG with a focus on storytelling and community, offering a deeply engaging world.", - "slug": "final-fantasy-xiv", - "category": "mmorpgs" - }, - { - "title": "The Elder Scrolls Online", - "desc": "An MMORPG set in the Elder Scrolls universe, featuring a vast world and freedom in gameplay.", - "slug": "the-elder-scrolls-online", - "category": "mmorpgs" - }, - { - "title": "Fortnite", - "desc": "A popular battle royale game that combines fast-paced action with strategic building elements.", - "slug": "fortnite", - "category": "action-shooters" - }, - { - "title": "Apex Legends", - "desc": "A high-adrenaline battle royale set in the Titanfall universe, known for its dynamic gameplay and unique characters.", - "slug": "apex-legends", - "category": "action-shooters" - }, - { - "title": "Minecraft", - "desc": "A sandbox game that revolutionized gaming with its creative and building aspects, appealing to all ages.", - "slug": "minecraft", - "category": "survival-sandbox" - }, - { - "title": "ARK: Survival Evolved", - "desc": "A survival game where players tame dinosaurs, build bases, and explore a mysterious island.", - "slug": "ark-survival-evolved", - "category": "survival-sandbox" - }, - { - "title": "League of Legends", - "desc": "One of the most popular MOBAs, known for its competitive gameplay and diverse champion roster.", - "slug": "league-of-legends", - "category": "strategy-moba" - }, - { - "title": "Dota 2", - "desc": "A complex and strategic MOBA with deep mechanics and a high skill ceiling, offering intense team battles.", - "slug": "dota-2", - "category": "strategy-moba" - }, - { - "title": "Among Us", - "desc": "A social deduction game where players work together while trying to identify the impostors among them.", - "slug": "among-us", - "category": "adventure-social" - }, - { - "title": "Roblox", - "desc": "A platform that allows users to create and play games designed by other users, fostering a strong creative community.", - "slug": "roblox", - "category": "adventure-social" - }, - { - "title": "FIFA 21", - "desc": "The latest in the FIFA series, offering realistic soccer simulation with various teams and leagues.", - "slug": "fifa-21", - "category": "sports-racing" - }, - { - "title": "Rocket League", - "desc": "A unique sports game that combines soccer with cars, known for its fast-paced and exciting gameplay.", - "slug": "rocket-league", - "category": "sports-racing" - }, - { - "title": "Magic: The Gathering Arena", - "desc": "A digital version of the popular card game, offering the same depth and strategy as the physical game.", - "slug": "magic-the-gathering-arena", - "category": "card-board-games" - }, - { - "title": "Tabletop Simulator", - "desc": "A sandbox that allows players to create and play tabletop games in a virtual environment.", - "slug": "tabletop-simulator", - "category": "card-board-games" - } -] diff --git a/server/README.md b/server/README.md deleted file mode 100644 index 64ac8a1..0000000 --- a/server/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# Game Player Nick Finder Django Server - -## Installation and Running the Application Locally -Before you proceed, ensure that your system has the following installed: -* Python (version 3.6 or newer) -* pip (Python package management tool) [sudo apt install python3-pip] -* pipenv (Python packaging tool for virtual environments) [pip install pipenv] - -### Step 1: Clone the Repository -Clone the repository to your local computer using the following git command: - -```bash -git clone https://github.com/zentala/game_player_nick_finder -cd game_player_nick_finder -``` - -### Step 2: Setup pipenv -To set up the pipenv environment and install dependencies, run the following command: - -```bash -pipenv install -``` - -This will create a `Pipfile` and `Pipfile.lock` if they don't exist and install all required dependencies. - -### Step 3: Activate pipenv Environment -To activate the pipenv environment, use: - -```bash -pipenv shell -``` - -### Step 4: Configure the Database -The application uses SQLite as the default database, so there is no need to set up an additional database. You can simply perform the database migration: - -```bash -python manage.py migrate -``` - -### Step 5: Create admin user -```bash -python manage.py createsuperuser -``` - -### Step 6: .env Configuration -Before using certain features, such as email notifications, you need to configure the environment variables. First, make a copy of the `.env.example` file and rename it to `.env`. Then, update the values with the correct configurations for your environment. - -### Step 7: Run the Server -To start the Django development server, run the following command: - -```bash -python manage.py runserver -``` - -The application should now be accessible at http://localhost:8000/ - -## Intallation and Deamonizing Application on Server -1) Follow all steps for local installation and startup. Verify that the application is running at http://localhost:8000/. -2) Copy `ecosystem.config.js.manage` or `ecosystem.config.js.wsgi` (recommended) into `ecosystem.config.js` and adjust paths in the configuration file. -3) Daemonize the server using the command `pm2 start ecosystem.config.js`. Ensure you have PM2 installed. If not, you can install it using the command `npm install pm2 -g`. -4) Configure the nginx server to handle requests under a specific domain and add an SSL Certificate. You can use Let's Encrypt for a free SSL certificate. Keep in mind that nginx configuration may vary depending on your operating system and specific requirements. - -## Options in manage.py - -`manage.py` is a script file in Django that allows you to manage the application and execute various commands. Here are several useful options provided by `manage.py`: - -### `flush` - -The `flush` command removes all data from the database while leaving the tables intact. This is useful during testing when you want to clear the database and start tests from a clean state. - -Example usage: -```bash -python manage.py flush -``` - -### `migrate` - -The `migrate` command executes database migrations. Migrations are a way to keep the database structure in sync with the data model in the application. It allows creating, modifying, and deleting tables and fields in the database based on changes in the models. - -Example usage: -```bash -python manage.py migrate -``` - -### `makemigrations` - -The `makemigrations` command is used to generate new migration files based on changes in the application's models. After making changes to the models, use this command to prepare new migrations before applying them with `migrate`. - -Example usage: -```bash -python manage.py makemigrations -``` - -### `shell` - -The `shell` command runs an interactive Python console with all Django models loaded. This allows for interactive data analysis and experimentation with database operations. - -Example usage: -```bash -python manage.py shell -``` - -### `createsuperuser` - -The `createsuperuser` command allows you to create a new superuser for the application. The superuser can log in to the Django admin panel and manage the application data. - -Example usage: -```bash -python manage.py createsuperuser -``` - -### Other Commands - -In addition to the ones mentioned above, there are many other commands available in `manage.py` that you can use for various purposes, such as managing users, generating reports, running tests, etc. To see a full list of commands and their descriptions, you can use the `help` command: - -```bash -python manage.py help -``` - -Using this, you can get insights into the various options available in `manage.py` and how to use them to manage your Django application.