by boshi247
Reddit Radar
import logging
import os
import requests
import markdown
from flask import Flask, render_template, request, redirect, url_for, session, flash
from gunicorn.app.base import BaseApplication
from routes import register_routes
from models import db
from migrations.run_migrations import run_migrations
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
from models import User
from werkzeug.security import generate_password_hash
def create_app():
app = Flask(__name__, static_folder='static')
app.secret_key = 'supersecretkey'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.sqlite'
db.init_app(app)
with app.app_context():
run_migrations(app)
register_routes(app)
# Initialize Flask-Admin
Created: | Last Updated:
Here's a step-by-step guide for using the Reddit Radar template:
Introduction
The Reddit Radar template allows you to create an app that displays subreddits based on user input. It includes features like user registration, login, password management, and Reddit post searching.
Getting Started
- Click "Start with this Template" to begin using the Reddit Radar template in Lazy.
Initial Setup
To use this template, you'll need to set up a Reddit API key. Follow these steps:
- Go to https://www.reddit.com/prefs/apps
- Click "Create App" or "Create Another App"
- Fill in the details:
- Name: Reddit Radar
- App type: Script
- Description: An app that displays subreddits based on user input
- About URL: (Leave blank)
- Redirect URI: http://localhost:8080
- Click "Create app"
- Note down your Client ID (under the app name) and Client Secret
Now, set up the environment secret in Lazy:
- In the Lazy Builder, go to the "Environment Secrets" tab
- Add a new secret called
REDDIT_API_KEY
- Set the value as
your_client_id:your_client_secret
Test the App
- Click the "Test" button in Lazy to start the deployment process.
- Wait for the deployment to complete. Lazy will provide you with a server link to access your app.
Using the App
- Open the provided server link in your web browser.
- You'll see the Reddit Radar homepage.
- Register a new account or log in if you already have one.
- Once logged in, you can use the search bar to look for Reddit posts.
- Enter a search query and click the "Search" button.
- The app will display search results from Reddit, including post titles, content, and media.
- Click on a post to view its comments.
Additional Features
- Change Password: Users can change their password in the settings.
- Change Username: Users can update their username in the settings.
- Forgot Password: Users can reset their password if forgotten.
- Dark Mode: Toggle between light and dark modes for better viewing experience.
The Reddit Radar app is now set up and ready to use. You can search for Reddit posts, view comments, and manage your account settings directly through the web interface provided by Lazy.
Here are 5 key business benefits for the Reddit Radar template:
Template Benefits
-
Enhanced User Engagement: By allowing users to search and explore Reddit content directly within the app, it increases user engagement and time spent on the platform.
-
Customized Content Discovery: Users can easily find relevant subreddits and posts based on their interests, providing a personalized content discovery experience.
-
Simplified Reddit Browsing: The app offers a streamlined interface for browsing Reddit content, potentially attracting users who find the original Reddit interface overwhelming.
-
Data Insights: With user search data and engagement metrics, businesses can gain valuable insights into trending topics and user interests, informing content strategy and marketing decisions.
-
Monetization Potential: The platform could be monetized through targeted advertising based on user searches and interests, or through premium features for power users.