Skip to content

Add seasons #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 117 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
849a5d3
Updated ReadME with project title & team name
BeCoded126 Apr 19, 2025
468e5e4
Merge pull request #3 from 4GeeksAcademy/1-update-readme-BRB
Shaelyn26 Apr 19, 2025
d940f76
changed title name
Shaelyn26 Apr 23, 2025
2f22e16
changed h1 Hello Rigo to Couch Potato
lvalcin Apr 23, 2025
1eddbb2
change H1 from Hello Rigo to Couch Potato
lvalcin Apr 24, 2025
4defd69
Merge pull request #40 from 4GeeksAcademy/changehomepage
Shaelyn26 Apr 24, 2025
2a16696
changed title
Shaelyn26 Apr 24, 2025
42a2935
Merge pull request #41 from 4GeeksAcademy/ChangeTabTitle
lvalcin Apr 24, 2025
1fc47bb
Updated readme with description
BeCoded126 Apr 24, 2025
96473f2
added future updates for project
BeCoded126 Apr 24, 2025
01206d1
Merge pull request #42 from 4GeeksAcademy/update-readme
aayalapalacin Apr 24, 2025
1814a9f
Update Home.jsx
aayalapalacin Apr 24, 2025
41303da
Merge pull request #43 from 4GeeksAcademy/changehomepage
BeCoded126 Apr 24, 2025
cb01abc
created models table for signup
lvalcin Apr 25, 2025
1580c11
Merge pull request #51 from 4GeeksAcademy/create-signup-fetch-function
Shaelyn26 Apr 25, 2025
bf4d7c1
added sign up route
Shaelyn26 Apr 26, 2025
87dce10
Merge pull request #52 from 4GeeksAcademy/signup-route
lvalcin Apr 26, 2025
12d40ff
created fetch for signup
lvalcin Apr 26, 2025
415b85b
Merge pull request #53 from 4GeeksAcademy/create-signup-fetch-function
Shaelyn26 Apr 26, 2025
4e2febc
creted models for login
lvalcin Apr 28, 2025
323ffdc
created login route
Shaelyn26 Apr 28, 2025
491365c
Merge pull request #54 from 4GeeksAcademy/models-for-login-page
Shaelyn26 Apr 28, 2025
77bfbd4
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into sig…
Shaelyn26 Apr 28, 2025
badf600
fixed the login route, added jwt manager
Shaelyn26 Apr 28, 2025
9e36727
Merge pull request #55 from 4GeeksAcademy/signup-route
lvalcin Apr 29, 2025
f45342e
fetch for login created and input for signup
lvalcin Apr 29, 2025
c211bba
removed login models, not needed
lvalcin Apr 29, 2025
d588e91
done
aayalapalacin Apr 29, 2025
52aa0b1
login fetch successful
lvalcin Apr 29, 2025
ccda65c
added signup page details
Shaelyn26 Apr 29, 2025
cfb6bec
favorites and show endpoints tested
BeCoded126 Apr 29, 2025
844be6d
Merge pull request #57 from 4GeeksAcademy/signup-route
lvalcin Apr 30, 2025
5c62bcc
created profile page component, added useState & try block for error …
BeCoded126 Apr 30, 2025
5916b29
resolved merge conflict
lvalcin Apr 30, 2025
0c93182
Merge pull request #56 from 4GeeksAcademy/login-fetch-function
BeCoded126 Apr 30, 2025
dca21c4
fixed merge conflict
BeCoded126 Apr 30, 2025
9dab9a0
Merge pull request #58 from 4GeeksAcademy/favs-models-ayala
Shaelyn26 Apr 30, 2025
2ed895f
password recovery component created
lvalcin May 1, 2025
ad02354
added login again, fixed signup password hash
Shaelyn26 May 1, 2025
b1b9623
Merge pull request #62 from 4GeeksAcademy/update-signup
lvalcin May 1, 2025
931a66c
reset password pathway created and linked to forgot password link whe…
lvalcin May 1, 2025
b226f6c
Updated profile page with favs and picture
BeCoded126 May 2, 2025
cf0392c
centered text
lvalcin May 2, 2025
2155a7c
created barebones for password reset
Shaelyn26 May 2, 2025
282e926
Merge pull request #63 from 4GeeksAcademy/second-new-pw
lvalcin May 2, 2025
ed68a76
Merge pull request #64 from 4GeeksAcademy/create-password-recovery-page
Shaelyn26 May 2, 2025
c91c20e
created barebones for login page
Shaelyn26 May 2, 2025
f76ec21
Merge pull request #69 from 4GeeksAcademy/main-login-page
lvalcin May 3, 2025
eed8f66
map created
BeCoded126 May 3, 2025
937a402
saved your lives
aayalapalacin May 3, 2025
739a754
added note in readme
aayalapalacin May 3, 2025
d9490cb
Merge pull request #70 from 4GeeksAcademy/fix-backend
lvalcin May 3, 2025
d2dcf3d
resolved merge conflicts(updated)
BeCoded126 May 5, 2025
a790bd6
added get route for showlist
Shaelyn26 May 5, 2025
bfd06a8
recovery password verified w/ endpoint
aayalapalacin May 5, 2025
55cbfa3
Merge pull request #71 from 4GeeksAcademy/password-alex
Shaelyn26 May 5, 2025
1bdd98e
merged showlist route and reset password route
Shaelyn26 May 5, 2025
5b37485
Merge pull request #72 from 4GeeksAcademy/main-login-page
Shaelyn26 May 5, 2025
890aed7
added showlist mapping
BeCoded126 May 6, 2025
bfb6f13
Merge pull request #73 from 4GeeksAcademy/Profile-Page-Display
lvalcin May 6, 2025
b528dd2
created fetch request for get movies and added 'showlist' button
Shaelyn26 May 6, 2025
a99fd59
test on fav & show endpoints successful;databse issue fixed
BeCoded126 May 7, 2025
eeddd0a
made and tested get fetch, successful
Shaelyn26 May 7, 2025
76dd1f8
Merge pull request #75 from 4GeeksAcademy/Profile-Page-Display-Backup
lvalcin May 7, 2025
50671ee
Merge pull request #74 from 4GeeksAcademy/fetch-request-shows
lvalcin May 7, 2025
65210fe
added chat component
Shaelyn26 May 7, 2025
37c70da
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into fet…
Shaelyn26 May 7, 2025
304c36b
adjusted fetch url
Shaelyn26 May 7, 2025
ac37b7d
Merge pull request #76 from 4GeeksAcademy/fetch-request-shows
BeCoded126 May 8, 2025
c46a04a
fetch request for new password request with onCHnage input and onclic…
lvalcin May 8, 2025
db65bc9
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into new…
lvalcin May 8, 2025
eada335
reset database after error
lvalcin May 8, 2025
adaede5
login page pathway created and and updated login page with fetch and …
lvalcin May 9, 2025
c6b535a
password recovery fetch successful
lvalcin May 9, 2025
233faff
adding the search component
BeCoded126 May 9, 2025
97c1005
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into Sho…
BeCoded126 May 9, 2025
7d486d2
Merge pull request #77 from 4GeeksAcademy/new-password-fetch
BeCoded126 May 9, 2025
9afe6f5
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into Sho…
BeCoded126 May 9, 2025
ba6628c
edited api key/url
Shaelyn26 May 9, 2025
c324b0d
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into fet…
Shaelyn26 May 9, 2025
cfbf626
fixed signup error with env file and pipfile
Shaelyn26 May 10, 2025
70a5707
aligned password recovery page and added some padding and margins
lvalcin May 10, 2025
1a3faad
added color to background
lvalcin May 10, 2025
c8efa98
commented out showlist button
Shaelyn26 May 10, 2025
dac3cd3
Merge pull request #83 from 4GeeksAcademy/fetch-request-shows
lvalcin May 11, 2025
cbdf8b0
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into ui-…
lvalcin May 11, 2025
426cc5d
homepage compoment created and layout started
lvalcin May 11, 2025
fcec047
show fetch + search filter implemented
BeCoded126 May 11, 2025
2ffc3d4
corrected conditional for empty search state
BeCoded126 May 12, 2025
37b954b
Merge pull request #87 from 4GeeksAcademy/Show-Render-Profile
lvalcin May 12, 2025
9e1eb76
added api key for season list
lvalcin May 12, 2025
c1d02b6
started added seasons functionality
BeCoded126 May 12, 2025
5ea8664
merged with main
BeCoded126 May 12, 2025
0867bb8
updated array for title pull in search
BeCoded126 May 12, 2025
61402b4
Merge pull request #88 from 4GeeksAcademy/Show-Render-Profile
lvalcin May 12, 2025
a0d33b4
Merge pull request #89 from 4GeeksAcademy/Add-Seasons
lvalcin May 12, 2025
cb67794
undo chnages to open new branch
lvalcin May 12, 2025
4a863e0
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into ui-…
lvalcin May 12, 2025
f048a68
fixed merge conflict
lvalcin May 13, 2025
0bb89b1
started the card component
Shaelyn26 May 13, 2025
7f4c8dd
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into boo…
Shaelyn26 May 13, 2025
1bb667b
added show title, image inside card component
Shaelyn26 May 13, 2025
7838a9c
Merge pull request #90 from 4GeeksAcademy/bootstrap-cards
lvalcin May 13, 2025
ebc0453
updated fetch for episode, mad variable for api key and url
lvalcin May 13, 2025
d038016
fixed merge conflicts
lvalcin May 13, 2025
64c4e95
seasons fetch & map initialized
BeCoded126 May 13, 2025
4d237aa
Merge pull request #92 from 4GeeksAcademy/ui-pw-recovery
Shaelyn26 May 13, 2025
ea6718f
updated
BeCoded126 May 13, 2025
c319992
latest
BeCoded126 May 13, 2025
91b195e
fixing profile apprearance
Shaelyn26 May 14, 2025
af0accf
Merge branch 'main' of https://github.com/4GeeksAcademy/CoPo into boo…
Shaelyn26 May 14, 2025
32ecc38
adjusted env file
Shaelyn26 May 14, 2025
060b270
card component rendering
Shaelyn26 May 14, 2025
7cf41e3
Merge pull request #93 from 4GeeksAcademy/bootstrap-cards
BeCoded126 May 14, 2025
d1b5443
added hero
BeCoded126 May 14, 2025
cc31218
conflicts fixed
BeCoded126 May 14, 2025
c076e35
fixed search filter, seasons mapping
BeCoded126 May 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ typing-extensions = "*"
flask-jwt-extended = "==4.6.0"
wtforms = "==3.1.2"
sqlalchemy = "*"
werkzeug = "*"

[requires]
python_version = "3.13"

[scripts]
start="flask run -p 3001 -h 0.0.0.0"
init="flask db init"
migrate="flask db migrate"
local="heroku local"
upgrade="flask db upgrade"
downgrade="flask db downgrade"
insert-test-data="flask insert-test-data"
reset_db="bash ./docs/assets/reset_migrations.bash"
deploy="echo 'Please follow this 3 steps to deploy: https://github.com/4GeeksAcademy/flask-rest-hello/blob/master/README.md#deploy-your-website-to-heroku' "
start = "flask run -p 3001 -h 0.0.0.0"
init = "flask db init"
migrate = "flask db migrate"
upgrade = "flask db upgrade"
downgrade = "flask db downgrade"
insert-test-data = "flask insert-test-data"
reset_db = "bash ./docs/assets/reset_migrations.bash"
local = "heroku local"
deploy = "echo 'Please follow this 3 steps to deploy: https://github.com/4GeeksAcademy/flask-rest-hello/blob/master/README.md#deploy-your-website-to-heroku'"
3 changes: 2 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 12 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,20 @@
# WebApp boilerplate with React JS and Flask API
# Couch Potato (CoPo)
- Shaelyn Blas
- Lovnyth Valcin
- Brandon-Ray Brown

Build web applications using React.js for the front end and python/flask for your backend API.
Description:

- Documentation can be found here: https://4geeks.com/docs/start/react-flask-template
- Here is a video on [how to use this template](https://www.loom.com/share/f37c6838b3f1496c95111e515e83dd9b)
- Integrated with Pipenv for package managing.
- Fast deployment to Render [in just a few steps here](https://4geeks.com/docs/start/deploy-to-render-com).
- Use of .env file.
- SQLAlchemy integration for database abstraction.
Problem: Viewers not being able to experience the social aspect of binging an old show in real-time.

### 1) Installation:
Solution: An application that matches 2 or more users based off the show season & episode into a chatroom only activated when users are simultaneously viewing the same episode of a show.

> If you use Github Codespaces (recommended) or Gitpod this template will already come with Python, Node and the Posgres Database installed. If you are working locally make sure to install Python 3.10, Node

It is recomended to install the backend first, make sure you have Python 3.10, Pipenv and a database engine (Posgress recomended)
Future Updates:

1. Install the python packages: `$ pipenv install`
2. Create a .env file based on the .env.example: `$ cp .env.example .env`
3. Install your database engine and create your database, depending on your database you have to create a DATABASE_URL variable with one of the possible values, make sure you replace the valudes with your database information:
App iNtegrated with faceboook for reward system when sharing.

| Engine | DATABASE_URL |
| --------- | --------------------------------------------------- |
| SQLite | sqlite:////test.db |
| MySQL | mysql://username:password@localhost:port/example |
| Postgress | postgres://username:password@localhost:5432/example |
avoid target database error:
Dev A modifies models.py → generate migration → push PR → get merged

4. Migrate the migrations: `$ pipenv run migrate` (skip if you have not made changes to the models on the `./src/api/models.py`)
5. Run the migrations: `$ pipenv run upgrade`
6. Run the application: `$ pipenv run start`

> Note: Codespaces users can connect to psql by typing: `psql -h localhost -U gitpod example`

### Undo a migration

You are also able to undo a migration by running

```sh
$ pipenv run downgrade
```

### Backend Populate Table Users

To insert test users in the database execute the following command:

```sh
$ flask insert-test-users 5
```

And you will see the following message:

```
Creating test users
[email protected] created.
[email protected] created.
[email protected] created.
[email protected] created.
[email protected] created.
Users created successfully!
```

### **Important note for the database and the data inside it**

Every Github codespace environment will have **its own database**, so if you're working with more people eveyone will have a different database and different records inside it. This data **will be lost**, so don't spend too much time manually creating records for testing, instead, you can automate adding records to your database by editing ```commands.py``` file inside ```/src/api``` folder. Edit line 32 function ```insert_test_data``` to insert the data according to your model (use the function ```insert_test_users``` above as an example). Then, all you need to do is run ```pipenv run insert-test-data```.

### Front-End Manual Installation:

- Make sure you are using node version 20 and that you have already successfully installed and runned the backend.

1. Install the packages: `$ npm install`
2. Start coding! start the webpack dev server `$ npm run start`

## Publish your website!

This boilerplate it's 100% read to deploy with Render.com and Heroku in a matter of minutes. Please read the [official documentation about it](https://4geeks.com/docs/start/deploy-to-render-com).

### Contributors

This template was built as part of the 4Geeks Academy [Coding Bootcamp](https://4geeksacademy.com/us/coding-bootcamp) by [Alejandro Sanchez](https://twitter.com/alesanchezr) and many other contributors. Find out more about our [Full Stack Developer Course](https://4geeksacademy.com/us/coding-bootcamps/part-time-full-stack-developer), and [Data Science Bootcamp](https://4geeksacademy.com/us/coding-bootcamps/datascience-machine-learning).

You can find other templates and resources like this at the [school github page](https://github.com/4geeksacademy/).
Dev B modifies models.py → wait for Dev A → pull latest → generate migration → push PR
37 changes: 37 additions & 0 deletions docs/assets/reset_migrations.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,40 @@ createdb -h localhost -U gitpod example || true &&
psql -h localhost example -U gitpod -c 'CREATE EXTENSION unaccent;' || true &&
pipenv run migrate &&
pipenv run upgrade
!/bin/bash

Stop on first error
set -e

echo "Removing old migrations folder..."
rm -rf ./migrations

echo "Terminating existing database connections..."
psql -h localhost -U gitpod postgres -c "
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'example'
AND pid <> pg_backend_pid();" || true

echo "Dropping database..."
dropdb -h localhost -U gitpod example --if-exists

echo "Creating fresh database..."
createdb -h localhost -U gitpod example

echo "Creating unaccent extension..."
psql -h localhost example -U gitpod -c 'CREATE EXTENSION IF NOT EXISTS unaccent;'

echo "Initializing fresh migrations..."
flask db init

echo "Removing any existing migration versions..."
rm -rf ./migrations/versions/*

echo "Generating initial migration..."
flask db migrate -m "Initial migration"

echo "Applying migration..."
flask db upgrade

echo "Database reset complete!"
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<link rel="icon" type="icon" href="/4geeks.ico" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://kit.fontawesome.com/5fd42cd819.js" crossorigin="anonymous"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello Rigo</title>
<title>Couch Potato</title>
</head>
<body>
<div id="root"></div>
Expand Down
35 changes: 0 additions & 35 deletions migrations/versions/0763d677d453_.py

This file was deleted.

50 changes: 50 additions & 0 deletions migrations/versions/2c9a6269af0d_initial_migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Initial migration

Revision ID: 2c9a6269af0d
Revises:
Create Date: 2025-05-10 00:10:23.980316

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2c9a6269af0d'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('favorites',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user', sa.String(length=50), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=120), nullable=False),
sa.Column('password', sa.String(), nullable=False),
sa.Column('name', sa.String(length=120), nullable=False),
sa.Column('age', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email')
)
op.create_table('show',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('showTitle', sa.String(length=50), nullable=True),
sa.Column('favorites_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['favorites_id'], ['favorites.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('show')
op.drop_table('user')
op.drop_table('favorites')
# ### end Alembic commands ###
Loading