Skip to content

Commit

Permalink
feat: add .env.example and update configuration for Flask and Gemini
Browse files Browse the repository at this point in the history
  • Loading branch information
areebahmeddd committed Feb 23, 2025
1 parent 03ba0a2 commit a723452
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Flask Configuration
FLASK_APP=server/app.py
FLASK_ENV=development
FLASK_DEBUG=1
FLASK_RUN_HOST=0.0.0.0
FLASK_RUN_PORT=5000
FLASK_SECRET_KEY=your-secret-key

# Gemini Configuration
GEMINI_KEY=your-gemini-key
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Follow these steps to set up and run the Mivro Python Server on your local machi
- Create a `.env` file in the project root directory with the following template:

```ini
FLASK_KEY=your_secret_key
FLASK_SECRET_KEY=your_secret_key
GEMINI_KEY=your_GEMINI_KEY
```

Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
app:
container_name: mivro_container
build: .
env_file: .env
command: python -m flask run
ports:
- "5000:5000"
volumes:
- ".:/mivro-python"
10 changes: 0 additions & 10 deletions docker-compose.yml

This file was deleted.

Binary file modified requirements.txt
Binary file not shown.
12 changes: 6 additions & 6 deletions server/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flask import Flask, jsonify
from config import FLASK_KEY
from config import FLASK_SECRET_KEY
from auth import auth_blueprint
from search import search_blueprint
from gemini import ai_blueprint
Expand All @@ -9,7 +9,7 @@
from middleware import auth_handler, error_handler

app = Flask(__name__) # Initialize Flask application instance
app.secret_key = FLASK_KEY # Set the Flask secret key for session management
app.secret_key = FLASK_SECRET_KEY # Set the Flask secret key for session management

# Register blueprints for API routes
app.register_blueprint(auth_blueprint, url_prefix="/api/v1/auth")
Expand Down Expand Up @@ -41,7 +41,7 @@ def health():
return jsonify({"status": "ok"}), 200


if __name__ == "__main__":
app.run(
host="0.0.0.0", port=5000, debug=True
) # Run the app on localhost:5000 in debug mode
# if __name__ == "__main__":
# app.run(
# host="0.0.0.0", port=5000, debug=True
# ) # Run the app on localhost:5000 in debug mode
2 changes: 1 addition & 1 deletion server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
load_dotenv()

# Access the environment variables
FLASK_KEY = os.getenv("FLASK_KEY")
FLASK_SECRET_KEY = os.getenv("FLASK_SECRET_KEY")
GEMINI_KEY = os.getenv("GEMINI_KEY")
# FIREBASE_KEY = os.getenv('FIREBASE_KEY')

Expand Down

0 comments on commit a723452

Please sign in to comment.