From 043effb6db55d81b996303677a6de19bb0749919 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Tue, 21 Jan 2025 00:29:07 +0000 Subject: [PATCH] Reorganised the webservers (temp for now) and docker-compose.yml now works --- .flaskenv | 2 - database/__pycache__/database.cpython-310.pyc | Bin 1236 -> 0 bytes database/__pycache__/database.cpython-312.pyc | Bin 1804 -> 0 bytes database/__pycache__/database.cpython-313.pyc | Bin 1876 -> 0 bytes docker-compose.yml | 3 +- nginx/Dockerfile | 27 +------ nginx/nginx.conf | 37 ++++++++- web_server/.flaskenv | 2 + {core => web_server}/Dockerfile | 10 ++- .../__pycache__/app.cpython-310.pyc | Bin .../__pycache__/app.cpython-313.pyc | Bin .../__pycache__/database.cpython-310.pyc | Bin .../__pycache__/forms.cpython-310.pyc | Bin web_server/__pycache__/forms.cpython-311.pyc | Bin 0 -> 1727 bytes .../__pycache__/forms.cpython-312.pyc | Bin .../__pycache__/forms.cpython-313.pyc | Bin {core => web_server}/blueprints/__init__.py | 10 +-- .../__pycache__/__init__.cpython-310.pyc | Bin .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 1673 bytes .../__pycache__/__init__.cpython-312.pyc | Bin .../__pycache__/app.cpython-310.pyc | Bin .../authentication.cpython-310.pyc | Bin .../authentication.cpython-311.pyc | Bin 0 -> 5120 bytes .../authentication.cpython-312.pyc | Bin .../__pycache__/main.cpython-310.pyc | Bin .../__pycache__/main.cpython-311.pyc | Bin 0 -> 800 bytes .../__pycache__/main.cpython-312.pyc | Bin .../__pycache__/stripe.cpython-311.pyc | Bin 0 -> 2457 bytes .../__pycache__/stripe.cpython-312.pyc | Bin .../__pycache__/utils.cpython-310.pyc | Bin .../__pycache__/utils.cpython-311.pyc | Bin 0 -> 2018 bytes .../__pycache__/utils.cpython-312.pyc | Bin .../blueprints/authentication.py | 4 +- {core => web_server}/blueprints/main.py | 0 {core => web_server}/blueprints/stripe.py | 74 +++++++++--------- {core => web_server}/blueprints/utils.py | 0 .../__pycache__/database.cpython-311.pyc | Bin 0 -> 2082 bytes {database => web_server/database}/app.db | Bin {database => web_server/database}/database.py | 0 .../database}/requirements.txt | 0 {database => web_server/database}/schema.sql | 0 .../2029240f6d1128be89ddc32729463129 | Bin .../bd9d4040a2dcd9c9d4ed85d3dc2d6ba7 | Bin {core => web_server}/forms.py | 0 .../react-flask}/.gitignore | 0 .../react-flask}/README.md | 0 .../react-flask}/package-lock.json | 0 .../react-flask}/package.json | 0 .../react-flask}/public/favicon.ico | Bin .../react-flask}/public/index.html | 0 .../react-flask}/public/logo192.png | Bin .../react-flask}/public/logo512.png | Bin .../react-flask}/public/manifest.json | 0 .../react-flask}/public/robots.txt | 0 .../react-flask}/src/App.css | 0 .../react-flask}/src/App.js | 0 .../react-flask}/src/App.test.js | 0 .../react-flask}/src/index.css | 0 .../react-flask}/src/index.js | 0 .../react-flask}/src/logo.svg | 0 .../react-flask}/src/reportWebVitals.js | 0 .../react-flask}/src/setupTests.js | 0 .../requirements.txt | 40 +++++----- {ui => web_server/ui}/static/checkout.js | 40 +++++----- {ui => web_server/ui}/static/styles.css | 0 {ui => web_server/ui}/templates/base.html | 0 {ui => web_server/ui}/templates/checkout.html | 28 +++---- {ui => web_server/ui}/templates/index.html | 0 {ui => web_server/ui}/templates/login.html | 0 {ui => web_server/ui}/templates/signup.html | 0 {ui => web_server/ui}/templates/video.html | 0 71 files changed, 147 insertions(+), 130 deletions(-) delete mode 100644 .flaskenv delete mode 100644 database/__pycache__/database.cpython-310.pyc delete mode 100644 database/__pycache__/database.cpython-312.pyc delete mode 100644 database/__pycache__/database.cpython-313.pyc create mode 100644 web_server/.flaskenv rename {core => web_server}/Dockerfile (54%) rename {core => web_server}/__pycache__/app.cpython-310.pyc (100%) rename {core => web_server}/__pycache__/app.cpython-313.pyc (100%) rename {core => web_server}/__pycache__/database.cpython-310.pyc (100%) rename {core => web_server}/__pycache__/forms.cpython-310.pyc (100%) create mode 100644 web_server/__pycache__/forms.cpython-311.pyc rename {core => web_server}/__pycache__/forms.cpython-312.pyc (100%) rename {core => web_server}/__pycache__/forms.cpython-313.pyc (100%) rename {core => web_server}/blueprints/__init__.py (57%) rename {core => web_server}/blueprints/__pycache__/__init__.cpython-310.pyc (100%) create mode 100644 web_server/blueprints/__pycache__/__init__.cpython-311.pyc rename {core => web_server}/blueprints/__pycache__/__init__.cpython-312.pyc (100%) rename {core => web_server}/blueprints/__pycache__/app.cpython-310.pyc (100%) rename {core => web_server}/blueprints/__pycache__/authentication.cpython-310.pyc (100%) create mode 100644 web_server/blueprints/__pycache__/authentication.cpython-311.pyc rename {core => web_server}/blueprints/__pycache__/authentication.cpython-312.pyc (100%) rename {core => web_server}/blueprints/__pycache__/main.cpython-310.pyc (100%) create mode 100644 web_server/blueprints/__pycache__/main.cpython-311.pyc rename {core => web_server}/blueprints/__pycache__/main.cpython-312.pyc (100%) create mode 100644 web_server/blueprints/__pycache__/stripe.cpython-311.pyc rename {core => web_server}/blueprints/__pycache__/stripe.cpython-312.pyc (100%) rename {core => web_server}/blueprints/__pycache__/utils.cpython-310.pyc (100%) create mode 100644 web_server/blueprints/__pycache__/utils.cpython-311.pyc rename {core => web_server}/blueprints/__pycache__/utils.cpython-312.pyc (100%) rename {core => web_server}/blueprints/authentication.py (97%) rename {core => web_server}/blueprints/main.py (100%) rename {core => web_server}/blueprints/stripe.py (97%) rename {core => web_server}/blueprints/utils.py (100%) create mode 100644 web_server/database/__pycache__/database.cpython-311.pyc rename {database => web_server/database}/app.db (100%) rename {database => web_server/database}/database.py (100%) rename {database => web_server/database}/requirements.txt (100%) rename {database => web_server/database}/schema.sql (100%) rename {flask_session => web_server/flask_session}/2029240f6d1128be89ddc32729463129 (100%) rename {flask_session => web_server/flask_session}/bd9d4040a2dcd9c9d4ed85d3dc2d6ba7 (100%) rename {core => web_server}/forms.py (100%) rename {react-flask => web_server/react-flask}/.gitignore (100%) rename {react-flask => web_server/react-flask}/README.md (100%) rename {react-flask => web_server/react-flask}/package-lock.json (100%) rename {react-flask => web_server/react-flask}/package.json (100%) rename {react-flask => web_server/react-flask}/public/favicon.ico (100%) rename {react-flask => web_server/react-flask}/public/index.html (100%) rename {react-flask => web_server/react-flask}/public/logo192.png (100%) rename {react-flask => web_server/react-flask}/public/logo512.png (100%) rename {react-flask => web_server/react-flask}/public/manifest.json (100%) rename {react-flask => web_server/react-flask}/public/robots.txt (100%) rename {react-flask => web_server/react-flask}/src/App.css (100%) rename {react-flask => web_server/react-flask}/src/App.js (100%) rename {react-flask => web_server/react-flask}/src/App.test.js (100%) rename {react-flask => web_server/react-flask}/src/index.css (100%) rename {react-flask => web_server/react-flask}/src/index.js (100%) rename {react-flask => web_server/react-flask}/src/logo.svg (100%) rename {react-flask => web_server/react-flask}/src/reportWebVitals.js (100%) rename {react-flask => web_server/react-flask}/src/setupTests.js (100%) rename requirements.txt => web_server/requirements.txt (94%) rename {ui => web_server/ui}/static/checkout.js (96%) rename {ui => web_server/ui}/static/styles.css (100%) rename {ui => web_server/ui}/templates/base.html (100%) rename {ui => web_server/ui}/templates/checkout.html (96%) rename {ui => web_server/ui}/templates/index.html (100%) rename {ui => web_server/ui}/templates/login.html (100%) rename {ui => web_server/ui}/templates/signup.html (100%) rename {ui => web_server/ui}/templates/video.html (100%) diff --git a/.flaskenv b/.flaskenv deleted file mode 100644 index d85c341..0000000 --- a/.flaskenv +++ /dev/null @@ -1,2 +0,0 @@ -FLASK_APP=core.blueprints.__init__ -FLASK_DEBUG=True \ No newline at end of file diff --git a/database/__pycache__/database.cpython-310.pyc b/database/__pycache__/database.cpython-310.pyc deleted file mode 100644 index 18301511219fc48c2049afc8aafb76e7caea8440..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1236 zcmZWo&ubGw6rMM`+1(~-OtltN#3Dt=rI%hrL<*^Rkst;w4S`{^GqD?!-E?+BY)C|C zPx?xT^CUql&daGCWa|j&x7mmLoyA zy+W7Eg7k3hNnZx1tmR|IiY#IzkQ}R*^I$JDVJFN~?rCL4I%!0(bPxGH&N|L)3yont zIOEnj*1D!JhdD@?^C=UaWLTCrCSEukZp%*1&v}~V?l3fmx!X(QB=^HkW|zK?BsrwCJFYX zNh&SpeL8NHbUGH@Ffyq=&I^JPaxWU`EY&qfmoYDQDX7=cwY)4$g?82=twN*hDJ&bO zNr2&us+S=E52p*0hgZ=4OTU4Un4qH;<1RXr01+b2IRmzjT5U3y8Gif(*bIP8N(ND% zptsKsaCZh@QH#wBZwzCmt5~Gw>U;P>Q0ZV0n|$T}Ue1*U;o% z-AX`jP~;Jr$7JZgSTcl16FL{CefEGAq3Q&F#j|mg5S7!kZv#t*Z7nOK;N_y9S439k Kp$S+3clkfPk{hW2 diff --git a/database/__pycache__/database.cpython-312.pyc b/database/__pycache__/database.cpython-312.pyc deleted file mode 100644 index 33db197dbad33f262dfd7c3d923a62edcafe97da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1804 zcmbVM-)kdP6h3!;WF~FeG`pLnZ7jxBVWU{O7OmLQ2VJrDp@^%(hQct-Of(_MWbaH# zQ&P7`A5v6m@gXiKYe6ifPYa9t5BMPZwA5w8Y~OtHtu%sCAM~7=%=CxCf){e;+;h)& za_{$@dw=fh>j50izd!k4LIC)cCc%)pPUkW@Eik}fCCK_;mSqCG35Ku+hPaDJ8d;&v zGSYA4&gIAkqq`2B*D%ro6SB;}Y(p``H7P3^%#@1WJ_3OM%?pNv>k&gle4%7&nk#C?!VYsK+brd6`nUAa%a3sz-$IOP3bYbxO<(4YYEiyJrBZ+_|AUb?lk7r)$;_EVQ`Pu`krO24Rs z?c`8X`n0E=NVZa&sV_#Fk#;=U?BnMUdrAf3#Z#eyP79)dOrv*p6e;J-2v}lJho`{_ z8GZ(M5)}z=QiBCLF}RM8%nJL6)w|ystHF|Z9cqkU!15W158(&Nv&!Xy<3`_D%9&MS z#g(hPP;oMXPbV{Ny6*vty?(w%9ld1#tu%z}XwAI)~&w9^8b@0AA z_&^=@ngEHUOE8y-(v7D#1>ce$O)Fc*qW7-EH0{QsUh-FX0&_XlbR(~Oea)Ys$R#q* zqS*njs<%&0o!}XAY|2@Kj=<#i*+E2>FMczzJ-s#E0dx=hB{}(fjL9hM-cr(I>%CnfX0LU0|jbgH2?qr diff --git a/database/__pycache__/database.cpython-313.pyc b/database/__pycache__/database.cpython-313.pyc deleted file mode 100644 index a0c5df999d92af92f6a58aab079ddc9886be3740..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1876 zcmbVM&ube;6n?Wmv@2P*>?Cp>sg4!XLUgFH>l(L>YA9*Jb&Duk6ap43>(xr#RNhr) z*VyTyF+CK!q`0OSH_(zA3dYAk!T&%GrMKXQh>dSO@-XrF4IJsdR>vRs5(B#f*=R>*%5G3xcP@?cGw*v#3}4+@`is z%3I5sid!pNv}AgdljBow_?EFaF;ObF`R;(R`fc3Wc5I(*JrL$&EHojX-kVIV!r}Sk z_VniTc5XBGi?FNgD7%TB#IM4>@<7>7JV-oL55_+_$jtpVdvLzECVi_m@vmPQaK7mD1@bqTeT%5)*;8z)FC$X0w|JNC;CQzty369Qt0h^g=ne`9HA(@274sW zlA?IGYPN4p28!uAj%E6^k9h@R!Cek|sJpCJ4AXb%?LgMiA&8hu)N^T8r2Xh8p^?7I zpof>vWHNLB?E@yY4Bz50Y*X8Hf>ek1|E#GPkEde^NDOY=`R2|K{{5AED+h@yYtmtQ z^#0X*SJ$LJ)S*W5;@wzdAi161On*PT7HK4sYrXUWi#(A7zoO9r;!60*$DX(^!3 zDG52sKou^-e1}~Hj3fZdN2isFB+OCq93l9R-LmV*QxFJS)oNIu{><}kj0*szm63hTT7@G)j3yiL z{*AfyxhL`ANAcmu@sYm{6GKfP(d1!#;JeEkv+J|}9EoiDw}GBqspQ=sq3C^__nDVzEACiCExONeGm9a_}wVh z4_64hQKr6z7Xp#5lcR_%5B@y8JF_$M0vLSWC&|f|aU!Q%;TXWW4F6BDKU!N&Ai{cY kQK#lwmzkmXd?BYEGQ?6$$W!Qh3elI+Ig)-3O!2UP0Y&3$+yDRo diff --git a/docker-compose.yml b/docker-compose.yml index de39df5..d4c57b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,7 @@ services: context: ./nginx ports: - "1935:1935" # RTMP + - "8080:8080" depends_on: - flask networks: @@ -12,7 +13,7 @@ services: flask: build: - context: ./core + context: ./web_server ports: - "5000:5000" networks: diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 5e276d2..7830c79 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -1,26 +1,7 @@ -FROM ubuntu:22.04 +FROM tiangolo/nginx-rtmp -# Install dependencies -RUN apt-get update && apt-get install -y \ - build-essential \ - libpcre3 libpcre3-dev \ - libssl-dev \ - zlib1g-dev \ - wget git - -# Download and build NGINX with RTMP -RUN wget http://nginx.org/download/nginx-1.25.2.tar.gz && \ - tar -xzvf nginx-1.25.2.tar.gz && \ - git clone https://github.com/arut/nginx-rtmp-module.git && \ - cd nginx-1.25.2 && \ - ./configure --add-module=../nginx-rtmp-module --with-http_ssl_module && \ - make && make install - -# Copy custom NGINX configuration COPY nginx.conf /etc/nginx/nginx.conf +EXPOSE 1935 8080 -# Expose RTMP and HTTP ports -EXPOSE 1935 - -# Start NGINX -CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"] +# Start the Nginx server +CMD [ "nginx", "-g", "daemon off;" ] diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 80f8cfd..029e39a 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,12 +1,43 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + rtmp { + server { - listen 1935; - chunk_size 4096; + listen 1935; # RTMP listen port application live { live on; - record off; + + # HLS Configuration (optional) + hls on; # Enable HLS conversion + hls_path /tmp/hls; # Path to store HLS files (use an absolute path) + hls_nested on; + hls_fragment 5s; # Duration of each HLS segment + hls_playlist_length 30s; # Length of HLS playlist (total duration) } } } +http { + # Enable HLS + server { + listen 8080; + + location /hls/ { + types { + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + } + + root /tmp; + add_header Cache-Control no-cache; + add_header Access-Control-Allow-Origin *; + + autoindex on; # Enable directory indexing + } + } +} diff --git a/web_server/.flaskenv b/web_server/.flaskenv new file mode 100644 index 0000000..0664964 --- /dev/null +++ b/web_server/.flaskenv @@ -0,0 +1,2 @@ +FLASK_APP=blueprints.__init__ +FLASK_DEBUG=True \ No newline at end of file diff --git a/core/Dockerfile b/web_server/Dockerfile similarity index 54% rename from core/Dockerfile rename to web_server/Dockerfile index 83a7577..a63ac40 100644 --- a/core/Dockerfile +++ b/web_server/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.10 -# Set working directory -WORKDIR /core +# Set the working directory +WORKDIR /web_server # Install dependencies COPY requirements.txt requirements.txt @@ -10,8 +10,12 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . +# Set environment variables +ENV FLASK_APP=blueprints.__init__ +ENV FLASK_DEBUG=True + # Expose Flask's port EXPOSE 5000 # Start the Flask app -CMD ["python", "app.py"] +CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"] diff --git a/core/__pycache__/app.cpython-310.pyc b/web_server/__pycache__/app.cpython-310.pyc similarity index 100% rename from core/__pycache__/app.cpython-310.pyc rename to web_server/__pycache__/app.cpython-310.pyc diff --git a/core/__pycache__/app.cpython-313.pyc b/web_server/__pycache__/app.cpython-313.pyc similarity index 100% rename from core/__pycache__/app.cpython-313.pyc rename to web_server/__pycache__/app.cpython-313.pyc diff --git a/core/__pycache__/database.cpython-310.pyc b/web_server/__pycache__/database.cpython-310.pyc similarity index 100% rename from core/__pycache__/database.cpython-310.pyc rename to web_server/__pycache__/database.cpython-310.pyc diff --git a/core/__pycache__/forms.cpython-310.pyc b/web_server/__pycache__/forms.cpython-310.pyc similarity index 100% rename from core/__pycache__/forms.cpython-310.pyc rename to web_server/__pycache__/forms.cpython-310.pyc diff --git a/web_server/__pycache__/forms.cpython-311.pyc b/web_server/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b43734c79d2380e2e073738a468e55af504676ee GIT binary patch literal 1727 zcmcgs&u`OK9DjBa$4+A$V4%Xrma$VLKrLM_h2_#F8QW;1g$-tmEI02ZGT3o=w%5T{ zkwXvNtv7nzrK2i`R^q^<{Sl6oL*(l&aF|q7PCfCycG9X8SWkO?@00JZ*x#S;Pg%|& zwu(!?H~-}k`UjZdN)3n|%817ZBg|RI=2VUYnzwj6p(gC4nzU1D$`({1k|(UREvlj| zsS<~HR6#hogm8**YYBul*ol{#iF5+fr4Q*wuvkL{=_QyJxKJuvhI_BSAGsL~;Ic;rj-ZinwR6iQN^*(u?DDUxS2nM2Uf-H~HWy6H1WKu^lzK|3^L0Oadik4`U!L4~a%WwC zss|Uo3bMs+w%E%SJEgwz$@1dr?M-{r-g2Hf!DKm5DqW@0Q!4DAxpOOW@ag#T#pjEE zJ^K4mP`wHJ)_k{G?^WwT5eGTa&5>S?bguQ~(dFB#qh0xYPd?u%!$Z#weLgT5dso44 zO#OdN##`Mg;S{?Rgi!jID^?jhMoZCB)~@id#y!J0lVKx&^dGz z;0!<%`o}<>8v=a5y~*IHh5KM_-j{Cp+-xBmN)5Q@^aZa$;hqfBjDlW@T09N|Mk0zJ zJTXvS+Mm&Aexmt^TQ3UZU}(GI)p!7l^mFzqxHH@>2HOdaB)Lbu0mvhhar}1=82=P({^x1F8qG9smFU literal 0 HcmV?d00001 diff --git a/core/__pycache__/forms.cpython-312.pyc b/web_server/__pycache__/forms.cpython-312.pyc similarity index 100% rename from core/__pycache__/forms.cpython-312.pyc rename to web_server/__pycache__/forms.cpython-312.pyc diff --git a/core/__pycache__/forms.cpython-313.pyc b/web_server/__pycache__/forms.cpython-313.pyc similarity index 100% rename from core/__pycache__/forms.cpython-313.pyc rename to web_server/__pycache__/forms.cpython-313.pyc diff --git a/core/blueprints/__init__.py b/web_server/blueprints/__init__.py similarity index 57% rename from core/blueprints/__init__.py rename to web_server/blueprints/__init__.py index 320dcde..544c8b3 100644 --- a/core/blueprints/__init__.py +++ b/web_server/blueprints/__init__.py @@ -1,9 +1,9 @@ from flask import Flask from flask_session import Session -from core.blueprints.utils import logged_in_user +from blueprints.utils import logged_in_user def create_app(): - app = Flask(__name__, template_folder="../../ui/templates/", static_folder="../../ui/static") + app = Flask(__name__, template_folder="../ui/templates/", static_folder="../ui/static/") app.config["SECRET_KEY"] = "" app.config["SESSION_PERMANENT"] = False app.config["SESSION_TYPE"] = "filesystem" @@ -12,9 +12,9 @@ def create_app(): app.before_request(logged_in_user) with app.app_context(): - from core.blueprints.authentication import auth_bp - from core.blueprints.main import main_bp - from core.blueprints.stripe import stripe_bp + from blueprints.authentication import auth_bp + from blueprints.main import main_bp + from blueprints.stripe import stripe_bp app.register_blueprint(auth_bp) app.register_blueprint(main_bp) diff --git a/core/blueprints/__pycache__/__init__.cpython-310.pyc b/web_server/blueprints/__pycache__/__init__.cpython-310.pyc similarity index 100% rename from core/blueprints/__pycache__/__init__.cpython-310.pyc rename to web_server/blueprints/__pycache__/__init__.cpython-310.pyc diff --git a/web_server/blueprints/__pycache__/__init__.cpython-311.pyc b/web_server/blueprints/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f61cd3ce5c724b12be2ecd45d26c14b2374e2eb1 GIT binary patch literal 1673 zcma)6&ube;6rPn<(rWd~c4^wW#g-eeQA{Met`9Ay5M&vexVDMZg3Q9Q(vH+kcD3rv zsEUJKRPZ76(4Inb?8&9Le?SkVP;%*U6$Dup0)f&)Zz}G=G}IQwr0UoCSB2pjg#XFU z0x!!z4}}dW0iX+d;K$$*WFGTuUk-r4KDsl?(nD*2>)|mh;$zYn7UdX=3|8TKA00v6 z<56t^knhB^_?gB01`hm7=J4ITBu9W8kI+>Fjg$458L^}T-dtIan^8+X2>5owj9Kvm zXf!ZLj3%8k_JvF8UY;5F-Y^spO@IB_e zQ88P%NsI=gSzZe_U~{lRyFrpXIdv}136K;=C(oe+E@Xn^Qv}xy*bPxf2^rA~LP38u zf3lxRIlVN~qRRT7sWsB;IK83S2E)oargxd$RJJSB&EWM** zy*1#dtPnk2#u`cIZ@s&;tmKO;D@&{C64tDA(XO$!MsRwE*mrQ1DOJjY*BJztmz6fI zs8IHEOq3Bj8zim6R(v_8- ztaS43>|7^*c=N%2SA5HzU*xuvdb=xLb?2`8fiJq^%pYRxLH^6l!_Cg7D@LA*SDuJh z9ztNgC(b+K{PSr1o7t~syV2=hbh?isp=-W!rB!EqxYD9CK3pm1jF0D1?5Q;KM4EZj z?n(BYmWgIEfPYrAP1peYw{vPo;V|KwhJw3gE4BROcPjzn6SD=Nz zuH2Z)PX-@PiuqR~k6#x+Z)GB0sK!6GgWH_&Z8#qPt2?;L6KAKCZ85{7{$=(L<_B~F z>mo7@>V>ps*?P;wACNh4`Dc)pK=p%yAh_r?XMDJ5&KVyrT6D%oUz`$Bee|*-X;}Cl D_4}R8 literal 0 HcmV?d00001 diff --git a/core/blueprints/__pycache__/__init__.cpython-312.pyc b/web_server/blueprints/__pycache__/__init__.cpython-312.pyc similarity index 100% rename from core/blueprints/__pycache__/__init__.cpython-312.pyc rename to web_server/blueprints/__pycache__/__init__.cpython-312.pyc diff --git a/core/blueprints/__pycache__/app.cpython-310.pyc b/web_server/blueprints/__pycache__/app.cpython-310.pyc similarity index 100% rename from core/blueprints/__pycache__/app.cpython-310.pyc rename to web_server/blueprints/__pycache__/app.cpython-310.pyc diff --git a/core/blueprints/__pycache__/authentication.cpython-310.pyc b/web_server/blueprints/__pycache__/authentication.cpython-310.pyc similarity index 100% rename from core/blueprints/__pycache__/authentication.cpython-310.pyc rename to web_server/blueprints/__pycache__/authentication.cpython-310.pyc diff --git a/web_server/blueprints/__pycache__/authentication.cpython-311.pyc b/web_server/blueprints/__pycache__/authentication.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b2c39f68d847b3c3af027a0be1507352843e561 GIT binary patch literal 5120 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 Ly*y#gn%4a<3cX2I literal 0 HcmV?d00001 diff --git a/core/blueprints/__pycache__/authentication.cpython-312.pyc b/web_server/blueprints/__pycache__/authentication.cpython-312.pyc similarity index 100% rename from core/blueprints/__pycache__/authentication.cpython-312.pyc rename to web_server/blueprints/__pycache__/authentication.cpython-312.pyc diff --git a/core/blueprints/__pycache__/main.cpython-310.pyc b/web_server/blueprints/__pycache__/main.cpython-310.pyc similarity index 100% rename from core/blueprints/__pycache__/main.cpython-310.pyc rename to web_server/blueprints/__pycache__/main.cpython-310.pyc diff --git a/web_server/blueprints/__pycache__/main.cpython-311.pyc b/web_server/blueprints/__pycache__/main.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8984fc6db7f7349f59609993e1b02a3a8bc17eea GIT binary patch literal 800 zcmZuv&1(}u6rb76N4vFFtT!plp@#%CHdaBTcrd95f(lW=u&_>cU)pVVcb1u1wLO(0 z*n^6<_UNf1`DYr)LG~ng@)ikRa`NpqDHeR}d;8{n%+NU^iWTwU4X)u;&k=z-!qR9p@(`ZUf~@% zMz=Q&kao!{wn(+~D~nW(bU{Mofpj#4alkdCv-g7pV(CXZHF+G5=?(X+869(?BZkf) z(PvNush^8h$e)Yk!qua-{#<1+S2-zEeIymT^t%ES{)KJzfEFXITy*pIfK7pGt6-S literal 0 HcmV?d00001 diff --git a/core/blueprints/__pycache__/main.cpython-312.pyc b/web_server/blueprints/__pycache__/main.cpython-312.pyc similarity index 100% rename from core/blueprints/__pycache__/main.cpython-312.pyc rename to web_server/blueprints/__pycache__/main.cpython-312.pyc diff --git a/web_server/blueprints/__pycache__/stripe.cpython-311.pyc b/web_server/blueprints/__pycache__/stripe.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6cda2eb6088a243d0f65e85331c4b6790c84a17d GIT binary patch literal 2457 zcmbVN-%k@s9G}_k(%+!<HqMXJ@dCeBJVYbet zgs8wF!YMqdTjLN~hiN-$^ zQ*nJngL|I__kkKbAJyR9r@^Ce<0w%7idhw~nGKYr6+%UWXxWrx5Yzc}Do3(ZO&g}2 zk{daq!z7_+(&|ip)U4ADs%D9q)RQ2h8)8rRs+t^54JUi^xny^4;H;J#8o81fnVX!C zN2j9d$l&zV0UEt_UA`DeclFN2jc{^eu_r$nnMx+RuU$>0i~$-SxUNOCuAmz_y?~N91HCX9RVk>uM%#+OCX^PXw@O*N8EfQFOT) zYna%f^U&Y?4delGA_K-sOF&&%Em6&PfpPC^3RbvTtni9W5gxHwonqf`tU<-CL$}%z zO82xNqgp8lokp~E2^;PT2ST^-8l1UaJr^Uxd+@HzO+$4q;oEq8cU-^==q5jn7O>Iq zfgDOyPu+0Vo&b4vjhYUk#fhR2#k9#1Rm^5cu1rLhx6#49y!C3)nQlcJdBqG2aHddZ zGaWZ_Qrb|Byy?+%ab1S&8!Yldn#>a#5KMbc6}5~)%uljXUL$Ekv~nRD`7F^*S4vG2 zQHAo-ON{1>GR z*c!V)^rVr=#>V2hs;ICPk#Z>`7U~j-l9MH7Z>*at{%Imn|KO!Fp>S+)yt_Np&6}TEo{1Ho!TfTe)6-xv zyL)tYqb#G6twCsf;cNP#v*-&v_l2JMLfei0?NhCVrcxbh?%(#GED8K!UkNe73r+PU z5Ayl9KW{G`MMuJ~k^6}2FGg1EEB1G9n~>*d32{Q>9(m#Lu1NPB_Z=&a7Y)AE@V)u_ z^DExH-#cg}0YqSY>p-3(1$)uov+3^La`zV9y_>dP{TP^frz4DhaSgQazkN2)%s*|y zFn!uA09|b8+;uLf8m?)MEOx-syDdW2La&7kD9JsuSHb>l)-&k_Pt)t=|)C_i2V;Y10X?FhB@YgX_M$IL~IronJ2WBEgq^WQHTLrbW^ajVR{nwb%ty|ZDFkS6)UXs zX(uc;GoB$J%jl)YcYmztX?gBxf97fbd1@o}Jb3O|@Z7Jdt>C3%@Y0s&a?x{n`HPp% zLl5nb>YpqW`^JiWlbg=SmNQaxMmD*~8&HH6ot>3ZuE{LRYB{rhm_TN$mm-3Px;E+% zHEwj#TT#<7XK1MarcC-LL_;u?J+eZ@;>Dn%9|8hyxQ{(NzvXT#y4yBwZDr9y=*qXNa|OqiCs6bRmYq9?Z!g!~ zt>3|}?@rt~v3a=d$;^}M%O|#Qe-ZbWI3MmSAt0}L#GS9Mv?9)Jv7dT8`FNPIpDE%q uC632a814w5OrU3P&9y7Bdc2S;%rb$FBJL=07`K-Y5XRnFvr=9zhu|OSh*{$R literal 0 HcmV?d00001 diff --git a/core/blueprints/__pycache__/stripe.cpython-312.pyc b/web_server/blueprints/__pycache__/stripe.cpython-312.pyc similarity index 100% rename from core/blueprints/__pycache__/stripe.cpython-312.pyc rename to web_server/blueprints/__pycache__/stripe.cpython-312.pyc diff --git a/core/blueprints/__pycache__/utils.cpython-310.pyc b/web_server/blueprints/__pycache__/utils.cpython-310.pyc similarity index 100% rename from core/blueprints/__pycache__/utils.cpython-310.pyc rename to web_server/blueprints/__pycache__/utils.cpython-310.pyc diff --git a/web_server/blueprints/__pycache__/utils.cpython-311.pyc b/web_server/blueprints/__pycache__/utils.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac5bb2eafd260fbf8f51f37ce04b30fb7b49476c GIT binary patch literal 2018 zcmcIk%}*pn6tC)!nc-u=U0g*Mv=Z?HSP2Mz#1L>7vK%yM0&e2a$=Gz&jJ@w2$VzgO?~ z>RvY6N?>%}`m*?rNyyLmk__WiIDQL+yMz-?15%BfC%Fu_09&{X*veCLq(A*Dy6d;2j1=6L!qZW@Dua9>lu=rWkE=rIh!&%?5=!}D zd6!1^vUDrT!+puHK!7;O@hyP6MAJk;$n}QIDJMG+{a%s*(YWt)&by1s=RT;exz#{B!>{B8uX?VALvcnWXCDYxvZ=SnhDV&KxzW+#SJ}L9 zOKdJI=w(+5_MQx{!|^(vLgmXElp`aK7fRtQ231j!epxH0s{KF>Rc=NdL0Bvbp7+an z3|F3qC^1QO31E#JWgp*M*m`<f>b3&EKV*`i=4Nin~S@2=+osl3D|&RCyk;eWge@C^kj!JLc- zR9bsU+sP^+8tZ#HIMta%2J$tmzBihw*PP@WG01IWmH1?pen-E;)Xdq)hG>ByG_uO# zhVD*NiMz7FCp5f_lSjed3E{g_ex1$#ZDej;&LHs-kM8 zFZQ3uE`!eFL*qf{xq+G(`m+^Y1PTlF`x^PBt$p*gjftbKi{H*{&;0n}4}-OyiT$35 z1Hi7ygRaS1`{ZF~*M`0`U+e7Kx(0wxrZ47z#Dm#2WDiWT7u{kbe#lNjL%spml3*lO z0XH0v0pPdo){U{x7S8*Q_W1U*28$Ti(U3{b_(%f0Gjv~S9zr`K8;3Y|C(l9 zxc3UcDa~HLQ~ar|x7ODCU&tn(L9b0LYmP-e2L{*~k|E$tHQV17*@eJWOAj^KN%zH9 zc}t;M_H-BqO19uWyc=V}#{Ohy;wxtM{mghN%Rc}CLBJ3I literal 0 HcmV?d00001 diff --git a/core/blueprints/__pycache__/utils.cpython-312.pyc b/web_server/blueprints/__pycache__/utils.cpython-312.pyc similarity index 100% rename from core/blueprints/__pycache__/utils.cpython-312.pyc rename to web_server/blueprints/__pycache__/utils.cpython-312.pyc diff --git a/core/blueprints/authentication.py b/web_server/blueprints/authentication.py similarity index 97% rename from core/blueprints/authentication.py rename to web_server/blueprints/authentication.py index fc2677f..b661021 100644 --- a/core/blueprints/authentication.py +++ b/web_server/blueprints/authentication.py @@ -1,8 +1,8 @@ from flask import Blueprint, render_template, session, request, url_for, redirect, g from werkzeug.security import generate_password_hash, check_password_hash -from core.forms import SignupForm, LoginForm +from forms import SignupForm, LoginForm from database.database import Database -from core.blueprints.utils import login_required +from blueprints.utils import login_required auth_bp = Blueprint("auth", __name__) diff --git a/core/blueprints/main.py b/web_server/blueprints/main.py similarity index 100% rename from core/blueprints/main.py rename to web_server/blueprints/main.py diff --git a/core/blueprints/stripe.py b/web_server/blueprints/stripe.py similarity index 97% rename from core/blueprints/stripe.py rename to web_server/blueprints/stripe.py index 07a8cde..a3bcf71 100644 --- a/core/blueprints/stripe.py +++ b/web_server/blueprints/stripe.py @@ -1,38 +1,38 @@ -from flask import render_template, Blueprint, request, jsonify - -import stripe - -stripe_bp = Blueprint("stripe", __name__) - -stripe.api_key = 'sk_test_51QikGlGk6yuk3uA8muEMPjMhUvbZWZiMCYQArZRXcFVn26hbt1kTz5yUVWkk3RQlltArbAXmVmkfEHU2z1Ch5Obv00Y03oT127' - -@stripe_bp.route('/create-checkout-session', methods=['POST']) -def create_checkout_session(): - try: - session = stripe.checkout.Session.create( - ui_mode = 'embedded', - payment_method_types=['card'], - line_items=[ - { - 'price': 'price_1QikNCGk6yuk3uA86mZf3dmM', #Subscription ID - 'quantity': 1, - }, - ], - mode='subscription', - redirect_on_completion = 'never' - ) - except Exception as e: - print(e) - return str(e) - - return jsonify(clientSecret=session.client_secret) - -@stripe_bp.route('/session-status', methods=['GET']) # check for payment status -def session_status(): - session = stripe.checkout.Session.retrieve(request.args.get('session_id')) - - return jsonify(status=session.status, customer_email=session.customer_details.email) - -@stripe_bp.route('/checkout', methods=['GET']) -def checkout(): +from flask import render_template, Blueprint, request, jsonify + +import stripe + +stripe_bp = Blueprint("stripe", __name__) + +stripe.api_key = 'sk_test_51QikGlGk6yuk3uA8muEMPjMhUvbZWZiMCYQArZRXcFVn26hbt1kTz5yUVWkk3RQlltArbAXmVmkfEHU2z1Ch5Obv00Y03oT127' + +@stripe_bp.route('/create-checkout-session', methods=['POST']) +def create_checkout_session(): + try: + session = stripe.checkout.Session.create( + ui_mode = 'embedded', + payment_method_types=['card'], + line_items=[ + { + 'price': 'price_1QikNCGk6yuk3uA86mZf3dmM', #Subscription ID + 'quantity': 1, + }, + ], + mode='subscription', + redirect_on_completion = 'never' + ) + except Exception as e: + print(e) + return str(e) + + return jsonify(clientSecret=session.client_secret) + +@stripe_bp.route('/session-status', methods=['GET']) # check for payment status +def session_status(): + session = stripe.checkout.Session.retrieve(request.args.get('session_id')) + + return jsonify(status=session.status, customer_email=session.customer_details.email) + +@stripe_bp.route('/checkout', methods=['GET']) +def checkout(): return render_template("checkout.html") \ No newline at end of file diff --git a/core/blueprints/utils.py b/web_server/blueprints/utils.py similarity index 100% rename from core/blueprints/utils.py rename to web_server/blueprints/utils.py diff --git a/web_server/database/__pycache__/database.cpython-311.pyc b/web_server/database/__pycache__/database.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b96531b83bacdea0ac85a6c9f12ddd79ee9ca615 GIT binary patch literal 2082 zcmbVMO>7%Q6rR~1d!0Jjq^Ya?5Opaa)gU5=0EH4&LJ5!*6c8aru`I3DyA#;pc-`4G zP9g`aDhDG4sZk2s4t^bRt(4P@}!5V;4R z-?E&6=TKVsn@wl+L#sCgJ_naz+CT(lv4OxpZtxpImNzgFmc$@nkuwCa#td--W#ixz zgPCM-u(#w&Q<|gYHJi9GN}Mt+&gwV_gfR{u58uI`AR5R48MLL)Z!1VASn|dv__Ezj zv?urmz(xEW4`|=C4LR(Ec|>Ohj>1_*YAo2uK=9|e*|nHfDvcWXbll}E+Z9Th^QkK= zS!U6VYkAw7#toAewPoT;s=8ub^vE1a` z_;}_O1AqLG|f|)`3cNOhd{MidWxdZUS{vpDbXC_#lWUe*0rG!@)K(k zi+>daU@xED{PH{J_DWN}(2_6Ih5h04x8JA>Eoq>g8U(1j+I^|U@Xg_GMsAJNV{JKA z@200AGy*(>#{<3&N&_VjfDD@7wvLq{uptzM2*Z0chn_)B2sA>^B02;mVUNIJtKw+E zFj|1Pb^HaqKXZp#1y|4tzkn*3o`JBmKnGy}9IfSL({U4Tt>~o00CL3=HH%J~^O42G zX0!+ZJ>~nWjMr;tj-d2*@vN*K_QxP5nLO7@p1T|T9_-5l z9fT99Be9?CyYci_)0@-vNPhsW!-FS`HbeRP;0XG@>rKq>$P@f;A}A5uS;ijjuYuC| zpQ!sdaXwC>Ua;Uw_rQMssxsb*bvIWt6?QE~%>5%38r+p?%;>+3s#^(z_LuokGtu z@f?U<l3)V$tCiJI3t!f6aA Po)rHu+rN)l@Q(Tqa$37B literal 0 HcmV?d00001 diff --git a/database/app.db b/web_server/database/app.db similarity index 100% rename from database/app.db rename to web_server/database/app.db diff --git a/database/database.py b/web_server/database/database.py similarity index 100% rename from database/database.py rename to web_server/database/database.py diff --git a/database/requirements.txt b/web_server/database/requirements.txt similarity index 100% rename from database/requirements.txt rename to web_server/database/requirements.txt diff --git a/database/schema.sql b/web_server/database/schema.sql similarity index 100% rename from database/schema.sql rename to web_server/database/schema.sql diff --git a/flask_session/2029240f6d1128be89ddc32729463129 b/web_server/flask_session/2029240f6d1128be89ddc32729463129 similarity index 100% rename from flask_session/2029240f6d1128be89ddc32729463129 rename to web_server/flask_session/2029240f6d1128be89ddc32729463129 diff --git a/flask_session/bd9d4040a2dcd9c9d4ed85d3dc2d6ba7 b/web_server/flask_session/bd9d4040a2dcd9c9d4ed85d3dc2d6ba7 similarity index 100% rename from flask_session/bd9d4040a2dcd9c9d4ed85d3dc2d6ba7 rename to web_server/flask_session/bd9d4040a2dcd9c9d4ed85d3dc2d6ba7 diff --git a/core/forms.py b/web_server/forms.py similarity index 100% rename from core/forms.py rename to web_server/forms.py diff --git a/react-flask/.gitignore b/web_server/react-flask/.gitignore similarity index 100% rename from react-flask/.gitignore rename to web_server/react-flask/.gitignore diff --git a/react-flask/README.md b/web_server/react-flask/README.md similarity index 100% rename from react-flask/README.md rename to web_server/react-flask/README.md diff --git a/react-flask/package-lock.json b/web_server/react-flask/package-lock.json similarity index 100% rename from react-flask/package-lock.json rename to web_server/react-flask/package-lock.json diff --git a/react-flask/package.json b/web_server/react-flask/package.json similarity index 100% rename from react-flask/package.json rename to web_server/react-flask/package.json diff --git a/react-flask/public/favicon.ico b/web_server/react-flask/public/favicon.ico similarity index 100% rename from react-flask/public/favicon.ico rename to web_server/react-flask/public/favicon.ico diff --git a/react-flask/public/index.html b/web_server/react-flask/public/index.html similarity index 100% rename from react-flask/public/index.html rename to web_server/react-flask/public/index.html diff --git a/react-flask/public/logo192.png b/web_server/react-flask/public/logo192.png similarity index 100% rename from react-flask/public/logo192.png rename to web_server/react-flask/public/logo192.png diff --git a/react-flask/public/logo512.png b/web_server/react-flask/public/logo512.png similarity index 100% rename from react-flask/public/logo512.png rename to web_server/react-flask/public/logo512.png diff --git a/react-flask/public/manifest.json b/web_server/react-flask/public/manifest.json similarity index 100% rename from react-flask/public/manifest.json rename to web_server/react-flask/public/manifest.json diff --git a/react-flask/public/robots.txt b/web_server/react-flask/public/robots.txt similarity index 100% rename from react-flask/public/robots.txt rename to web_server/react-flask/public/robots.txt diff --git a/react-flask/src/App.css b/web_server/react-flask/src/App.css similarity index 100% rename from react-flask/src/App.css rename to web_server/react-flask/src/App.css diff --git a/react-flask/src/App.js b/web_server/react-flask/src/App.js similarity index 100% rename from react-flask/src/App.js rename to web_server/react-flask/src/App.js diff --git a/react-flask/src/App.test.js b/web_server/react-flask/src/App.test.js similarity index 100% rename from react-flask/src/App.test.js rename to web_server/react-flask/src/App.test.js diff --git a/react-flask/src/index.css b/web_server/react-flask/src/index.css similarity index 100% rename from react-flask/src/index.css rename to web_server/react-flask/src/index.css diff --git a/react-flask/src/index.js b/web_server/react-flask/src/index.js similarity index 100% rename from react-flask/src/index.js rename to web_server/react-flask/src/index.js diff --git a/react-flask/src/logo.svg b/web_server/react-flask/src/logo.svg similarity index 100% rename from react-flask/src/logo.svg rename to web_server/react-flask/src/logo.svg diff --git a/react-flask/src/reportWebVitals.js b/web_server/react-flask/src/reportWebVitals.js similarity index 100% rename from react-flask/src/reportWebVitals.js rename to web_server/react-flask/src/reportWebVitals.js diff --git a/react-flask/src/setupTests.js b/web_server/react-flask/src/setupTests.js similarity index 100% rename from react-flask/src/setupTests.js rename to web_server/react-flask/src/setupTests.js diff --git a/requirements.txt b/web_server/requirements.txt similarity index 94% rename from requirements.txt rename to web_server/requirements.txt index a7785f5..853ebd4 100644 --- a/requirements.txt +++ b/web_server/requirements.txt @@ -1,20 +1,20 @@ -blinker==1.9.0 -cachelib==0.13.0 -certifi==2024.12.14 -charset-normalizer==3.4.1 -click==8.1.8 -colorama==0.4.6 -Flask==3.1.0 -Flask-Session==0.8.0 -Flask-WTF==1.2.2 -idna==3.10 -itsdangerous==2.2.0 -Jinja2==3.1.5 -MarkupSafe==3.0.2 -msgspec==0.19.0 -requests==2.32.3 -stripe==11.4.1 -typing_extensions==4.12.2 -urllib3==2.3.0 -Werkzeug==3.1.3 -WTForms==3.2.1 +blinker==1.9.0 +cachelib==0.13.0 +certifi==2024.12.14 +charset-normalizer==3.4.1 +click==8.1.8 +colorama==0.4.6 +Flask==3.1.0 +Flask-Session==0.8.0 +Flask-WTF==1.2.2 +idna==3.10 +itsdangerous==2.2.0 +Jinja2==3.1.5 +MarkupSafe==3.0.2 +msgspec==0.19.0 +requests==2.32.3 +stripe==11.4.1 +typing_extensions==4.12.2 +urllib3==2.3.0 +Werkzeug==3.1.3 +WTForms==3.2.1 diff --git a/ui/static/checkout.js b/web_server/ui/static/checkout.js similarity index 96% rename from ui/static/checkout.js rename to web_server/ui/static/checkout.js index ea934a2..4060c64 100644 --- a/ui/static/checkout.js +++ b/web_server/ui/static/checkout.js @@ -1,21 +1,21 @@ -const stripe = Stripe("pk_test_51QikGlGk6yuk3uA8MT3uQrPMpUqJlKzkxfbrfrd34yXolWSbJYEFWm674s2aUydZyjjS0W2oByEJTV0LXMs1pWTk002ioHxQl6"); - -initialize(); - -// Create a Checkout Session -async function initialize() { - const fetchClientSecret = async () => { - const response = await fetch("/create-checkout-session", { - method: "POST", - }); - const { clientSecret } = await response.json(); - return clientSecret; - }; - - const checkout = await stripe.initEmbeddedCheckout({ - fetchClientSecret, - }); - - // Mount Checkout - checkout.mount('#checkout'); +const stripe = Stripe("pk_test_51QikGlGk6yuk3uA8MT3uQrPMpUqJlKzkxfbrfrd34yXolWSbJYEFWm674s2aUydZyjjS0W2oByEJTV0LXMs1pWTk002ioHxQl6"); + +initialize(); + +// Create a Checkout Session +async function initialize() { + const fetchClientSecret = async () => { + const response = await fetch("/create-checkout-session", { + method: "POST", + }); + const { clientSecret } = await response.json(); + return clientSecret; + }; + + const checkout = await stripe.initEmbeddedCheckout({ + fetchClientSecret, + }); + + // Mount Checkout + checkout.mount('#checkout'); } \ No newline at end of file diff --git a/ui/static/styles.css b/web_server/ui/static/styles.css similarity index 100% rename from ui/static/styles.css rename to web_server/ui/static/styles.css diff --git a/ui/templates/base.html b/web_server/ui/templates/base.html similarity index 100% rename from ui/templates/base.html rename to web_server/ui/templates/base.html diff --git a/ui/templates/checkout.html b/web_server/ui/templates/checkout.html similarity index 96% rename from ui/templates/checkout.html rename to web_server/ui/templates/checkout.html index d878fa9..a706835 100644 --- a/ui/templates/checkout.html +++ b/web_server/ui/templates/checkout.html @@ -1,15 +1,15 @@ -{% extends "base.html" %} - -{% block header_config %} - - - - -{% endblock %} - -{% block main_content %} - -
- -
+{% extends "base.html" %} + +{% block header_config %} + + + + +{% endblock %} + +{% block main_content %} + +
+ +
{% endblock %} \ No newline at end of file diff --git a/ui/templates/index.html b/web_server/ui/templates/index.html similarity index 100% rename from ui/templates/index.html rename to web_server/ui/templates/index.html diff --git a/ui/templates/login.html b/web_server/ui/templates/login.html similarity index 100% rename from ui/templates/login.html rename to web_server/ui/templates/login.html diff --git a/ui/templates/signup.html b/web_server/ui/templates/signup.html similarity index 100% rename from ui/templates/signup.html rename to web_server/ui/templates/signup.html diff --git a/ui/templates/video.html b/web_server/ui/templates/video.html similarity index 100% rename from ui/templates/video.html rename to web_server/ui/templates/video.html