diff --git a/.gitignore b/.gitignore index aa421b1..8764a20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.db __pycache__ .venv +*.sqlite3 \ No newline at end of file diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..6a7666d --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,9 @@ +# Use an official nginx image +FROM nginx:alpine + +# Expose port 80 +EXPOSE 80 + +# Start Nginx and keep it running +CMD ["nginx", "-g", "daemon off;"] + diff --git a/client/index.html b/client/index.html new file mode 100644 index 0000000..0258952 --- /dev/null +++ b/client/index.html @@ -0,0 +1,28 @@ + + + + + + Document + + +
+ +
+
+
+

Welcome to My Website

+

This is a paragraph of text to introduce visitors to the site and inform them about what they can find here.

+
+
+ + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c4744e6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,37 @@ +version: '3.8' + +services: + web: + build: ./server + ports: + - "5000:5000" + volumes: + - ./server:/app + environment: + - DEBUG=1 + - POKEMANS_DB_URL + - PRAW_CLIENT_ID + - PRAW_CLIENT_SECRET + - PRAW_USERNAME + - PRAW_PASSWORD + - POKEMANS_WEBHOOK_URL + command: + python main.py + + db: + image: postgres:12 + environment: + POSTGRES_DB: pokemans + POSTGRES_USER: pokemans + POSTGRES_PASSWORD: pokemans + ports: + - "5432:5432" + + frontend: + build: ./client + ports: + - "3000:80" + volumes: + - ./client:/usr/share/nginx/html + depends_on: + - web diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..f79c124 --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.11 + +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +# Set the working directory in the container +WORKDIR /app + +# Install any needed packages specified in requirements.txt +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Make port 8000 available to the world outside this container +EXPOSE 8000 + +# Run python manage.py runserver 0.0.0.0:8000 when the container launches +CMD ["python", "main.py"] \ No newline at end of file diff --git a/app.py b/server/app.py similarity index 100% rename from app.py rename to server/app.py diff --git a/config.py b/server/config.py similarity index 100% rename from config.py rename to server/config.py diff --git a/main.py b/server/main.py similarity index 70% rename from main.py rename to server/main.py index a918aed..351528c 100644 --- a/main.py +++ b/server/main.py @@ -25,9 +25,19 @@ if __name__ == "__main__": reddit_monitor = RedditMonitor(client_id, client_secret, user_agent, username, password, subreddit_name) webhook_notifier = WebhookNotifier(discord_webhook_url, disable_webhook) app = Application(reddit_monitor, webhook_notifier) + print("Starting app") app.run() """ TODO: +- implement django +- basic front end (react) +- tests - Filter out canadian/uk deals +- track score and number of comments over time in db +- try to identify product, number of cards, price per card, etc +- track price over time for each product +- try to identify platform ie. costco for gift card, tiktok for coupons, etc. +- support for craigslist, ebay, etc. +- front end - vizualization, classification, lookup, etc. """ \ No newline at end of file diff --git a/models.py b/server/models.py similarity index 100% rename from models.py rename to server/models.py diff --git a/reddit_monitor.py b/server/reddit_monitor.py similarity index 100% rename from reddit_monitor.py rename to server/reddit_monitor.py diff --git a/requirements.txt b/server/requirements.txt similarity index 100% rename from requirements.txt rename to server/requirements.txt diff --git a/webhook.py b/server/webhook.py similarity index 100% rename from webhook.py rename to server/webhook.py