Skip to content

Instantly share code, notes, and snippets.

View oakinogundeji's full-sized avatar

'Muyiwa Akin-Ogundeji oakinogundeji

View GitHub Profile
@oakinogundeji
oakinogundeji / main.py
Created January 30, 2025 08:24
main file for briefcase build for windows
from annhaliszt.app import main
if __name__ == "__main__":
main()
@oakinogundeji
oakinogundeji / app.py
Created January 30, 2025 08:23
briefcase pywebview entry point file
import webview
import threading
import sys
from annhaliszt.be.start import startUp, create_app
def start_flask():
try:
# Run the startup sequence
startUp()
@oakinogundeji
oakinogundeji / ci.yml
Created January 30, 2025 08:22
github actions file for building windows MSI with briefcase
name: Build Windows Executables
on:
push:
branches: [ ci ] # change this to windows when ready
jobs:
ci:
name: Test and Package (Windows)
runs-on: windows-latest
@oakinogundeji
oakinogundeji / pyproject.toml
Created January 30, 2025 08:21
briefcase config file for ubuntu and windows platforms
# This project was generated with 0.3.20 using template: https://github.com/beeware/briefcase-template@v0.3.20
[tool.briefcase]
project_name = "Ann Haliszt"
bundle = "toplevel.domain"
version = "1.0.0"
url = "https://domain.toplevel/annhaliszt"
license.file = "LICENSE"
author = "your name here"
author_email = "someone@provider.com"
@oakinogundeji
oakinogundeji / start.py
Created January 27, 2025 13:03
Flask entry point for a flask server which renders the UI for a pywebview app
from flask import (
Flask,
send_from_directory,
render_template,
)
from flask_cors import CORS
chat_history = {}
@oakinogundeji
oakinogundeji / app.py
Created January 27, 2025 12:32
pywebview entrypoint script for a flask server which serves the UI at the root endpoint
import webview
import threading
import sys
from be.start import startUp, create_app
def start_flask():
try:
# Run the startup sequence
startUp()
@oakinogundeji
oakinogundeji / start.py
Created January 27, 2025 11:55
the flask server used to coordinate with pywebview
from flask import Flask
from flask_cors import CORS
def startUp():
print("Starting backend initialization...")
def create_app():
app = Flask(__name__)
@oakinogundeji
oakinogundeji / app.py
Created January 27, 2025 11:32
entrypoint pywebview script for coordinating flask server and custom UI in separate threads
import webview
import threading
import os
import sys
from be.start import startUp, create_app
def start_flask(ready_event):
try:
# Run the startup sequence
@oakinogundeji
oakinogundeji / connection.js
Created April 13, 2023 11:14
a reliable and robust pattern for connecting to mongodb before starting the app
'use strict';
if(process.env.NODE_ENV != 'production') {
require('dotenv').config();
}
/**
* Module Dependencies
*/
const
Http = require('http'),
Mongoose = require('mongoose'),
0xE56a5289757db606C317342eB1F92C23E650443F