Skip to content

Commit

Permalink
Merge pull request #23 from jrsmth/feature/notifications/main
Browse files Browse the repository at this point in the history
Feature/notifications/main
  • Loading branch information
jrsmth authored Nov 27, 2023
2 parents 557468c + 7bf4307 commit dcd54c3
Show file tree
Hide file tree
Showing 35 changed files with 1,117 additions and 783 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# Releases
<!-- @LatestFirst -->

## [0.5.0] - 27/11/23
- UMA-30: Add the ability to display a message from the backend via message topic
- UMA-31: Implement websocket replacement throughout game flow for both game and player modes

## [0.4.1] - 18/11/23
- UMA-29: [BUG] Computer incorrectly places in already completed outer-squares (Ultimate)

Expand Down Expand Up @@ -78,4 +82,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.3.1]: https://github.com/jrsmth/ultima/compare/0.3.0...0.3.1
[0.3.2]: https://github.com/jrsmth/ultima/compare/0.3.1...0.3.2
[0.4.0]: https://github.com/jrsmth/ultima/compare/0.3.2...0.4.0
[0.4.0]: https://github.com/jrsmth/ultima/compare/0.4.0...0.4.1
[0.4.1]: https://github.com/jrsmth/ultima/compare/0.4.0...0.4.1
[0.5.0]: https://github.com/jrsmth/ultima/compare/0.4.1...0.5.0
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ COPY . /code
ENV PYTHONUNBUFFERED=0
ENV FLASK_ENV=prod
EXPOSE 8080
ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:8080", "--chdir", "src/app", "app:app"]

ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:8080", "-k", "gevent", "-w", "1", "--chdir", "src/app", "app:app"]
# Question :: when is the sass build going to happen?
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env = "dev"
# dev : ensure IP is whitelisted on render redis
# prod
make start:
export FLASK_ENV=$(env) && make build && gunicorn -b 0.0.0.0:8080 --chdir src/app app:app
export FLASK_ENV=$(env) && make build && gunicorn -b 0.0.0.0:8080 -k gevent -w 1 --chdir src/app app:app

make test:
export FLASK_ENV="prod" && python3 -m unittest discover ./src/app
Expand Down
18 changes: 10 additions & 8 deletions src/app/app.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import os

from flask import Flask
from flask_socketio import SocketIO

from src.app.config.config import Config, DevConfig, ProductionConfig
from src.app.game import game
from src.app.login import login
from src.app.socket import socket
from src.app.util.messages import Messages
from src.app.util.redis import Redis


# Initialise app
templates = os.path.abspath("../resources/templates")
statics = "../resources/static"
app = Flask(__name__, template_folder=templates, static_folder=statics)

socketio = SocketIO(app)

# Initialise config
env = os.environ.get("FLASK_ENV")
Expand All @@ -28,20 +31,19 @@
app.config.from_object(ProductionConfig())
print("Starting app in [production] mode")


# Initialise redis client
redis = Redis(app)


# Initialise message bundle
messages = Messages('../resources/messages.properties')


# Register routes
app.register_blueprint(login.construct_blueprint(redis, messages))
app.register_blueprint(game.construct_blueprint(redis, messages))
app.register_blueprint(login.construct_blueprint(messages, socketio, redis))
app.register_blueprint(game.construct_blueprint(messages, socketio, redis))

# Register events
app.register_blueprint(socket.construct_blueprint(socketio, redis))

# Let's go!
if __name__ == "__main__":
app.run()
socketio.run(app, debug=True, host='localhost', port=8080) # FixMe :: extract
Loading

0 comments on commit dcd54c3

Please sign in to comment.