initial commit
This commit is contained in:
commit
6fb15b6d5c
2
.env.example
Normal file
2
.env.example
Normal file
@ -0,0 +1,2 @@
|
||||
SECRET_KEY=supersecretkey
|
||||
DATABASE_URL=sqlite:///data.db
|
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN pip install -r requirements.txt
|
||||
CMD ["flask", "run", "--host=0.0.0.0"]
|
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Plant Price Tracker
|
||||
|
||||
Initial setup for the community plant tracking app.
|
21
app/__init__.py
Normal file
21
app/__init__.py
Normal file
@ -0,0 +1,21 @@
|
||||
from flask import Flask
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_migrate import Migrate
|
||||
from flask_login import LoginManager
|
||||
|
||||
db = SQLAlchemy()
|
||||
migrate = Migrate()
|
||||
login_manager = LoginManager()
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
app.config.from_object('config.Config')
|
||||
|
||||
db.init_app(app)
|
||||
migrate.init_app(app, db)
|
||||
login_manager.init_app(app)
|
||||
|
||||
from .core.routes import core
|
||||
app.register_blueprint(core)
|
||||
|
||||
return app
|
7
app/core/routes.py
Normal file
7
app/core/routes.py
Normal file
@ -0,0 +1,7 @@
|
||||
from flask import Blueprint
|
||||
|
||||
core = Blueprint('core', __name__)
|
||||
|
||||
@core.route('/')
|
||||
def index():
|
||||
return 'Welcome to the Plant Price Tracker!'
|
6
config.py
Normal file
6
config.py
Normal file
@ -0,0 +1,6 @@
|
||||
import os
|
||||
|
||||
class Config:
|
||||
SECRET_KEY = os.getenv('SECRET_KEY', 'dev')
|
||||
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', 'sqlite:///data.db')
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@ -0,0 +1,12 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
- .:/app
|
||||
environment:
|
||||
- FLASK_APP=app
|
||||
- FLASK_ENV=development
|
||||
- DATABASE_URL=sqlite:///data.db
|
4
requirements.txt
Normal file
4
requirements.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Flask==2.3.2
|
||||
Flask-SQLAlchemy
|
||||
Flask-Migrate
|
||||
Flask-Login
|
Loading…
x
Reference in New Issue
Block a user