zenxha / P3Cowboys

GitHub Repo for the Period 3 Cowboys Team

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

P3 Cowboys Advertisement site

GitHub Repo for the Period 3 Cowboys Team

Links

Creators & Github Links

NAME GITHUB Link
William Cherres https://github.com/BillyCherres
Allen Xu https://github.com/allenyxu
Marc Humeau https://github.com/marchumeau
Tanmay Marwah https://github.com/TMarwah
Karam Alshaikh https://github.com/KaramAlshaikh

How It's Made

Theme Section (5pt)

  • Quote Page (+0.5pt User interaction, +0.5pt Technical, +1pt Fun)
    • Quote page demonstrates usage and display of online APIs
    • User can refresh the page to get a new response each time
    • Quotes add to the theme of the project by giving users inspirational quotes to help with their buisness ideas
  • Upload Page (+0.5pt User interaction, +0.5pt Technical, +1pt Fun)
    • Upload page demonstrates usage and display of user interaction
    • User can upload their websites advertisement and then it will be viewable from the "Browse" page
    • This relates to the theme as it is the main point of interaction for the advertisements to be posted
  • Database (+0.5pt User interaction, +0.5pt Technical)

Individual Section (4.5pt)

  • Blueprints (+4pt 4 labs)
    • Each folder is labled with the corresponding member to indicate their individual blueprint
  • Technicals (+1pt 2 Technicals)
    • Each minilab utilizes classes in order to pass in parameters that cause different functions to run

API Section (3pt)

  • API and Receiving (+2 Receive and API, +1 Visual)
    • API for quotes is used here and the author and quote is stored as jinja variables
    • Jinja variables are then displayed on the front end here
    • Used png of quotes to emphasize the quote and highlighted text to be easily seen, with author cited at bottom right as well

Deployment Section (5pt)

  • How It's Made section (+2pt How Its Made, +1pt Visuals)
    • Located in readme, section is labled How Its Made, is what you are currently looking at
  • Commercial (+2pt)

Code Explanations

Profile Page (Karam)

from flask import Blueprint, render_template, request

from .karamminilab import Caracal, Characters, bubblesort

Cowboys_Karam_bp = Blueprint('Cowboys_Karam', __name__,
                               template_folder='templates',
                               static_folder='static', static_url_path='assets')
@Cowboys_Karam_bp.route("/")
def upload():
    return render_template ("homepage2.html")

@Cowboys_Karam_bp.route("/karamminilab")
def minilab():
    caracals= [Caracal("skinny", "beige"), Caracal("fat", "brown")]
    return render_template("karamminilab.html", caracals=caracals)


@Cowboys_Karam_bp.route("/karambubblesort.html", methods=["POST", "GET"])
def qaracters():
    if request.method == 'POST':
        string = request.form.get('word')
        word = str(string)
        return render_template("karambubblesort.html", characters=Characters(word).characters)
    return render_template("karambubblesort.html")


@Cowboys_Karam_bp.route("/otherubblesort", methods=["POST", "GET"])
def minilabs():
    if request.method == 'POST':
        bubble = request.form.get('character')
        return render_template("otherubblesort.html", output = bubblesort(bubble).bubblesort)

    return render_template("otherubblesort.html")


@Cowboys_Karam_bp.route("/Dashboard")
def model():
    return render_template("/Dashboard.html", model=model)

Login Page (Tanmay)

from flask import Blueprint
from flask import render_template, request
from Cowboys.Tanmay.tanmayminilab import  Counters

Cowboys_Tanmay_bp = Blueprint('Cowboys_Tanmay', __name__,
                              template_folder='templates',
                              static_folder='static', static_url_path='assets')

class LoginForm(FlaskForm):
    username = StringField('Username', validators=[DataRequired()])
    password = PasswordField('Password', validators=[DataRequired()])
    submit = SubmitField('Login')

@Cowboys_Tanmay_bp.route('/login', methods=["POST", "GET"])
def login_route():
    logform = LoginForm()
    if logform.validate_on_submit():
        user = User.query.filter_by(username=logform.username.data).first()
        if user is None or not user.check_password(logform.password.data):
            flash("Login Failed")
            return redirect("/login")
        login_user(user)
        flash("Login Successful!")
        if logform.username.data == "secret":
            return redirect("/secret")
        nextpage = request.args.get("next")
        if not nextpage or url_parse(nextpage).netloc != '':
            return redirect('/')
        return redirect(nextpage)
    else:
        return render_template("login.html", form = logform)

@Cowboys_Tanmay_bp.route('/minilab', methods=["POST", "GET"])
def minilab():
    if(request.method == 'POST'):
        sentence = request.form.get('sentence')
        sentencesort = request.form.get('sentencesort')
        input = sentence
        input2 = sentencesort
        return render_template("tanmayminilab.html",wordcount = Counters(input).wordcount(),
                               lettercount = Counters(input).lettercount(), sorted = Counters(input2).bubblesort())

    return render_template("tanmayminilab.html",wordcount = Counters(2).wordcount(),
                           lettercount = Counters(2).lettercount(), sorted = Counters(2).bubblesort())

Database (Marc)

@Cowboys_minilab1_bp.route('/cowboys/minilab1/browse')
def browse():
    backgrounds = ["https://cdn.discordapp.com/attachments/784178874303905792/818606015494094868/812382.png"]
    review_query = Review.query.all()
    reviews = []

    for review in review_query:
        websiteurl = url_for('get_img', id=review.id)

        review_dict = {
            'id': review.id,
            'username': review.username,
            'content': review.content,
            'image':  websiteurl
        }
        reviews.append(review_dict)
    return render_template("browse.html", reviews=reviews, background=random.choice(backgrounds))
    
@Cowboys_minilab1_bp.route('/cowboys/minilab1/upload', methods=["POST", 'GET'])
def upload():
    background = random.choice(backgrounds)
    if request.method == "POST":
        name = request.form["username"]
        content = request.form["content"]
        image = request.files.get('img')
        if not image:
            return 'bad news ur image did not make it to our servers :((((', 400

        filename = secure_filename(image.filename)
        mimetype = image.mimetype
        if not filename or not mimetype:
            return 'Bad upload', 400

        review = Review(username=name, content=content, img=image.read(), filename=filename, mimetype=mimetype)
        db.session.add(review)
        db.session.commit()
        return redirect(url_for("browse.html"))
    return render_template("upload.html", background=background)
    

Feedback Page (Billy)

@Cowboys_William_bp.route("/feedback", methods=["POST", "GET"])
def feedback():
    if request.method == 'POST':
        name = request.form.get('name')
        comment = request.form.get('comment')
        input1 = name
        input2 = comment
        return render_template("response.html", name=name, comment=comment, input1=input1, input2=input2)
    return render_template("feedback.html")

Pre Final Project Team Checkpoint

NAME Accomplishment
William Cherres I worked on the UI with Karam and was able to make the feedback page look more proffesional. I then was able to reconnect the Feedback Page back to the Response Page as it was disconnected when Karam and I re-did the whole Feedback Page. Ticketin Progress Ticket In review
Allen Xu Contineud work on the database and started to look into how to create our own API. We also have future plans to work with the P4 KPOP group and utlize their API onto our website. Ticket in Progress (browse page) Ticket in Review (API and database)
Marc Humeau I worked on the browse page and was able to create a page that will be used for displaying business posts from the upload page in the future. I worked on this with Allen as he worked on the upload page with the form submission. Ticket in Progress, Ticket in Review
Tanmay Marwah I finished the login UI and have started to work on establishing the database for the username and password storage Ticket in Progress (database) Ticket in Review (UI and Login fields)
Karam Alshaikh I worked on the UI with Billy and mainly focused on improving the functionality of the feedback and login/sign up page, creating a more professional look for the website Ticketin Progress and Ticket In review

Final Umbrella Progress tickets

This is the groups current progess/plans for the final project

  • This video link shows the groups progress and plans for the final project described in the table below.
NAME Plans/Roles
William Cherres Ticket in progress Ticket in Review Work on a Feedback and Response page. It is still being debated whether or not the feedback would be stored in a data base or not. But the Plan is to have a functional feedback and rerturn page that is connected through Get and Post.
Allen Xu .Ticket in progress Ticket in Review Create table for storing the required elements the user uploads in the model.py file. This will be our database, which we can later add on to with thing such as the feedback page
Marc Humeau .Ticket in progress Ticket in Review Work on database that stores user inputted information about business, and then display it onto a browse page that is style similarly like Instagram. This will work in tandom with the user input field developed by Allen
Tanmay Marwah .Ticket in progress Ticket in Review Create user login page that checks for credentials stored in the database, as well as locks the user out from accessing the rest of the site until they have authenticated.
Karam Alshaikh .Ticket in progress Ticket in Review Work on deployment material; creating website domain and adding a user profile page where the user can post feedback and see their following, etc.

Mini Lab

Note:

  • Minilab commits for each person can be viewed in each individual directory under Cowboys
NAME Goal Accomplished
William Cherres Create blue print Blue Print
Allen Xu Create blue print Blue Print
Marc Humeau Create blue print Blue Print
Tanmay Marwah Create blue print Blue Print
Karam Alshaikh Create blue print Blue Print

Crossover review

Individual Completed Tickets:

NAME Assingment What was Finshed
William Cherres Home Page Ticket I was able to create a home page. The idea was to make a simple easy page where the user can easily navigate through in order to get to the their desired destination. Here is the code for the Home page Code/Blueprint
Allen Xu Upload Page Ticket(Back End) Front end for upload page can be seen here. Currently using template from Trish as a baseline for our upload form, though back end isn't fully functioning yet
Marc Humeau Upload Page Ticket (Front End) Created a base page that will be used to contain the browse page in the future. Will work with the uploading database to pull data and display it in a Instagram like post.
Tanmay Marwah Sign up page Ticket Created sign up and login page Link. This allows the user to create an account from which they can upload advertisements. Registered users are the only people that can upload ads, but anyone can view them on the main page.
Karam Alshaik deployment/ profile page Ticket Website link

Project Plan:

Link to full project plan

Project Idea

  • A website where you can upload advertisements for your business. (Instagram styled)
  • Ability to create accounts
  • Once logged in, able to share advertisments with captions
  • Explore tab has advertisements from all authorized users
  • If not signed in, will see posts from official Cowboys account
  • Able to explore other peoples work through the Browse page
  • Code is formatted through Blueprints

College Board Requirements

  • Instructions for input from one of the following:
    • the user (including user actions that trigger events)
    • a device
    • an online data stream
    • a file
  • Use of at least one list (or other collection type) to represent a collection of data that is stored and used to manage program complexity and help fulfill the program’s purpose
  • At least one procedure that contributes to the program’s intended purpose, where you have defined:
    • the procedure’s name
    • the return type (if necessary)
    • one or more parameters
  • An algorithm that includes sequencing, selection, and iteration that is in the body of the selected procedure
  • Calls to your student-developed procedure
  • Instructions for output (tactile, audible, visual, or textual) based on input and program functionality

About

GitHub Repo for the Period 3 Cowboys Team


Languages

Language:HTML 70.0%Language:Python 27.8%Language:CSS 2.2%