Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aekmekci72 committed Aug 4, 2024
1 parent 4cc06a2 commit 5a8c622
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"homepage": "https://aekmekci72.github.io/wistemweb",

"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import reportWebVitals from './reportWebVitals';

function MainApp() {
return (
<Router>
<Router basename="/wistemweb">
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/app" element={<App />} />
Expand Down
File renamed without changes.
20 changes: 17 additions & 3 deletions server/app.py → src/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,29 @@
from firebase_admin import credentials, firestore, storage
import tempfile
import os
from dotenv import load_dotenv
load_dotenv()


# Initialize Flask app
app = Flask(__name__)
CORS(app)

# Initialize Firebase
cred = credentials.Certificate('./serviceKey.json')
cred = credentials.Certificate({
"type": "service_account",
"project_id": os.environ.get("FIREBASE_PROJECT_ID"),
"private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
"private_key": os.environ.get("FIREBASE_PRIVATE_KEY").replace('\\n', '\n'),
"client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
"client_id": os.environ.get("FIREBASE_CLIENT_ID"),
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL")
})
firebase_admin.initialize_app(cred, {
'storageBucket': 'wistemweb'
'storageBucket': os.environ.get("FIREBASE_STORAGE_BUCKET")
})
# Get Firestore client
db = firestore.client()
Expand Down Expand Up @@ -78,4 +91,5 @@ def get_events():


if __name__ == '__main__':
app.run(port=5000)
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port)
File renamed without changes.
Binary file added src/server/requirements.txt
Binary file not shown.

0 comments on commit 5a8c622

Please sign in to comment.