Skip to content

Commit

Permalink
Version 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
harkerbyte committed Mar 4, 2024
1 parent 986de4d commit f2611bd
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 28 deletions.
File renamed without changes.
4 changes: 4 additions & 0 deletions .credentials/db.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
USER=
PASSWORD=
HOST=
PORT=
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ An innovative web app, seamlessly integrates **Python and JS** to create a dynam

# ChangeLog

| Version | Publicized | Changes
| Version | Publicized | What's New
----------|--------------|---------
|1.0.0 | 2024-01-19 | Initial release
|2.3.0 | 2024-03-2 | New Ui and feel, Template to upload game properties. File conversion & Download (Ts to Js & .scss to .css), S3 storage system.|
|2.4.0 | 2024-03-02 | New Ui and feel, Template to upload game properties. File conversion & Download (Ts to Js & .scss to .css), S3 storage system.|
|2.5.0 |2024-03-04 |Database Engine : PostgreSQL|


**Soft Fire** is designed for continuous improvement, with ongoing **Minor** patches delivering new features and enhanced security. Its dynamic nature ensures that development remains active, guaranteeing a cutting-edge experience for users as the software evolves over time.</br>
Expand All @@ -50,11 +51,6 @@ With that being said, feel free to report any issue, and if you have any ideas t
* To start the project. Run `py manage.py runserver` Now open `127.0.0.1:8000` on your browser.


* Login to the admin dashboard `127.0.0.1:8000/admin`
```
Username : Admin-1
Password : adminuser239
```

## Notice
* For any **html** file to be uploaded. . .It content must be similar to this:
Expand Down Expand Up @@ -84,12 +80,26 @@ Password : adminuser239
![Python](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue)
![JavaScript](https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E)

* If you intend to commit to this **project**, I'd advise you leave the debug setting default. If you turn off debug, the software would assume you're intending to deploy to production, which would require creating an S3 bucket. While configuring s3 bucket can be quite strenuous, do not worry as i have already done 80% of the job. You can just go ahead, create, and configure the server side.
* If you're committed to this project, I recommend leaving the production value as the default. Assigning ```bool(True)``` to this variable will signal the software to assume a deployment to production, necessitating the creation of an S3 bucket and an RDS.

* While configuring the S3 bucket may seem strenuous, I've already completed 80% of the job. You can proceed to create and configure the server side. Meanwhile, refer to the next section for guidance on filling in the necessary credentials.
```
'static'
'media'
```
![S3-Bucket-Objects](.images/soft-fire.png)
Fill in the correct information in an ".env" file located in the project's root directory.

* However, The API doesn't come with a command to collectmedia file for upload unto the s3 bucket. A workaround command would be available soon as the software's development proceeds.


## Production Guide
* Inside the project's folder named *.credentials*, you'll find two empty files:
* **.env** for S3 credentials
* **db** for RDS credentials

* The software's current configured database is *PostgreSQL; remember this when selecting your **database engine**.

* Once you've submitted the necessary cloud resource credentials to the aforementioned files, proceed to assign bool(True) to the *production variable*.

* Now run ```py manage.py migrate```

* **Note**: Currently, this API lacks a command to collect media files for upload to the S3 bucket. A workaround command will be available soon as the software's development progresses. I recommend manually uploading the folders to your S3 bucket. Once done, you can proceed to run the project, as the software will handle serving the media files.
Binary file modified db.sqlite3
Binary file not shown.
21 changes: 21 additions & 0 deletions games/migrations/0021_alter_game_author.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.10 on 2024-03-04 02:00

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('games', '0020_alter_game_author'),
]

operations = [
migrations.AlterField(
model_name='game',
name='author',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='games', to=settings.AUTH_USER_MODEL),
),
]
2 changes: 1 addition & 1 deletion games/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class game(BaseStorage):
author = models.ForeignKey(User,
related_name = 'games',
on_delete = models.CASCADE,
default = 3)
default = 1)

description = models.TextField(max_length= 300,
default = 'Enjoy the game 🎮')
Expand Down
39 changes: 27 additions & 12 deletions harkerbyte/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SECRET_KEY = 'django-insecure-%d4lk*zmbliye-#1vjv8$v=*y8&yiq1u9d@e=u(k$hl+7a8djx'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True

ALLOWED_HOSTS = ['*']

Expand Down Expand Up @@ -62,16 +62,31 @@

WSGI_APPLICATION = 'harkerbyte.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
#READY FOR PRODUCTION? - True / False
PRODUCTION = False

if PRODUCTION==True:
#THIS CONDITION USES POSTGRESQL ON DEFAULT
dbpath = os.path.join(BASE_DIR, '.credentials/db.config')
configdb = Config(RepositoryEnv(dbpath))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER':configdb.get('USER'),
'PASSWORD':configdb.get('PASSWORD'),
'HOST':configdb.get('HOST'),
'PORT':configdb.get('PORT')
}
}

else:
DATABASES = {
'default': {
'ENGINE':'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3'
}
}
}


# Password validation
Expand Down Expand Up @@ -120,8 +135,8 @@
DEVELOPER = ['[email protected]']


if DEBUG==False:
path = os.path.join(BASE_DIR, '.env')
if PRODUCTION==True:
path = os.path.join(BASE_DIR, '.credentials/.env')
config = Config(RepositoryEnv(path))
AWS_ACCESS_KEY_ID=config.get('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY=config.get('AWS_SECRET_ACCESS_KEY')
Expand Down
6 changes: 1 addition & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.3.7
Django==5.0.1
Django==4.2.10
django-storages==1.14.2
docker-py==1.7.2
dockerpty==0.4.1
Expand All @@ -28,14 +28,10 @@ outcome==1.3.0.post0
pathspec==0.10.1
pillow==10.2.0
pyasn1==0.5.1
pyasn1==0.5.1
pycparser==2.21
pypiwin32==223
PySocks==1.7.1
python-dateutil==2.8.2
python-decouple==3.8
pywin32==306
pywin32-ctypes==0.2.2
PyYAML==6.0.1
requests==2.31.0
rsa==4.7.2
Expand Down

0 comments on commit f2611bd

Please sign in to comment.