Skip to content

91 create logged out page view #57

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 100 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
6133072
chamged name of website
Wdrew232 Apr 23, 2025
ac7f746
done
XxDrancerxX Apr 23, 2025
3858e4c
Merge pull request #31 from 4GeeksAcademy/change-home
XxDrancerxX Apr 23, 2025
65bcdff
changed web name
Wdrew232 Apr 23, 2025
aad9bc0
Readme test
Jackbringas Apr 24, 2025
149676c
Merge pull request #32 from 4GeeksAcademy/30-update-readme
Wdrew232 Apr 24, 2025
07d54d1
Merge branch 'main' into 27-change-web-name
Wdrew232 Apr 24, 2025
ac470b2
Merge pull request #35 from 4GeeksAcademy/27-change-web-name
Wdrew232 Apr 24, 2025
b1646a2
building first endpoint
XxDrancerxX Apr 26, 2025
1d74b23
signup done as the figma draft
Jackbringas Apr 26, 2025
f90db72
Merge pull request #42 from 4GeeksAcademy/sign-up-page
Wdrew232 Apr 28, 2025
6c56dbd
rendering Search page
Wdrew232 Apr 28, 2025
960fa6e
sign in done as figma draft
Jackbringas Apr 28, 2025
60d8116
craeted ground work fir search
Wdrew232 Apr 29, 2025
40fd3a5
endpoint built
XxDrancerxX Apr 29, 2025
9776288
continue working on the api
XxDrancerxX Apr 29, 2025
34da9da
checking 3 endpoints
XxDrancerxX Apr 30, 2025
5f6f27d
built endpoints
XxDrancerxX Apr 30, 2025
6505ca6
Merge pull request #46 from 4GeeksAcademy/Sign-in-page
Jackbringas Apr 30, 2025
1d763ed
Merge pull request #51 from 4GeeksAcademy/12-set-up-the-google-api-to…
Jackbringas Apr 30, 2025
2556aee
Merge branch 'main' into 17-ingredients-search
Jackbringas Apr 30, 2025
ed6d7fc
Merge pull request #45 from 4GeeksAcademy/17-ingredients-search
Jackbringas Apr 30, 2025
bdd5613
Add requests, flask-cors, python-dotenv deps
XxDrancerxX Apr 30, 2025
096932a
password recovery view added
Jackbringas Apr 30, 2025
331459a
ground floor of custom drinks
Wdrew232 Apr 30, 2025
add2fb4
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
Wdrew232 Apr 30, 2025
e83e89c
basic layout
XxDrancerxX May 1, 2025
3267d8d
added styling
Wdrew232 May 1, 2025
32f5993
removed models not being used and added readme note for requests
aayalapalacin May 1, 2025
63dde3f
Merge pull request #54 from 4GeeksAcademy/password-recovery-view
aayalapalacin May 1, 2025
aa71e99
Merge branch 'main' into 53-add-pictures-to-all-of-the-ingredients
XxDrancerxX May 1, 2025
f2f13a6
Merge pull request #56 from 4GeeksAcademy/53-add-pictures-to-all-of-t…
XxDrancerxX May 1, 2025
cfd5594
Merge pull request #55 from 4GeeksAcademy/18-ingredients-customization
XxDrancerxX May 1, 2025
dc35aa0
main page added as figma draft
Jackbringas May 1, 2025
13b78a7
Fix merge issues and stage changes
XxDrancerxX May 1, 2025
9b91f70
displaying selectedplace
XxDrancerxX May 1, 2025
c7922c8
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
Jackbringas May 2, 2025
55400ea
Merge pull request #57 from 4GeeksAcademy/main-page
XxDrancerxX May 2, 2025
bafc316
fixed search code
Wdrew232 May 2, 2025
f9f0ff2
Sign Up working, missing fetch
Jackbringas May 3, 2025
40f828f
added custom css
Wdrew232 May 4, 2025
1c25b51
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
Wdrew232 May 4, 2025
01a2c03
signin funcionality done, missing fetch
Jackbringas May 5, 2025
7d0cb89
a
XxDrancerxX May 5, 2025
2155cb2
a
XxDrancerxX May 5, 2025
f627397
Merge pull request #58 from 4GeeksAcademy/sing-up-funcionality
XxDrancerxX May 5, 2025
e8c27a5
Merge pull request #62 from 4GeeksAcademy/sing-in-funcionality
XxDrancerxX May 5, 2025
c870f20
front-end-google-api
XxDrancerxX May 5, 2025
b079f05
google-api
XxDrancerxX May 5, 2025
d012c6e
Merge pull request #68 from 4GeeksAcademy/48-front-end-view-of-the-go…
Jackbringas May 5, 2025
8dc2b34
test
Jackbringas May 5, 2025
abfc552
testing
Jackbringas May 5, 2025
b55b780
sig-in-started
XxDrancerxX May 6, 2025
c5726b4
create user and encrypted password succesfully
Jackbringas May 6, 2025
e8a038d
Merge pull request #69 from 4GeeksAcademy/sign-up-endpoint-with-passw…
XxDrancerxX May 6, 2025
95767ee
endpoint
XxDrancerxX May 6, 2025
be93816
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
XxDrancerxX May 6, 2025
a09144f
Merge pull request #70 from 4GeeksAcademy/65-log-in-end-point-with-jwt
Jackbringas May 6, 2025
58fab83
login fetch get a token, logout delete the token
Jackbringas May 7, 2025
d35c555
error message changed
Jackbringas May 7, 2025
e220e19
SIGNUPDONE
XxDrancerxX May 7, 2025
0539c64
Merge pull request #71 from 4GeeksAcademy/login-fetch
XxDrancerxX May 7, 2025
555a659
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
XxDrancerxX May 7, 2025
42f0ffe
updated
XxDrancerxX May 7, 2025
79bc7e8
main-started
XxDrancerxX May 7, 2025
83004ff
Merge pull request #72 from 4GeeksAcademy/59-sign-up-fetch
Jackbringas May 7, 2025
055d3c0
fixed coding and added custom cocktails
Wdrew232 May 7, 2025
d922659
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
Wdrew232 May 7, 2025
b107334
created favorites page
Wdrew232 May 7, 2025
ba6b90e
Merge pull request #75 from 4GeeksAcademy/18-ingredients-customization
XxDrancerxX May 8, 2025
dbb9007
Merge branch 'main' into 60-create-favorites-page-view
XxDrancerxX May 8, 2025
1a05b22
Merge pull request #76 from 4GeeksAcademy/60-create-favorites-page-view
XxDrancerxX May 8, 2025
80e2be5
added local storage for favorites
Wdrew232 May 8, 2025
3569c63
gMerge branch 'main' of https://github.com/4GeeksAcademy/finalproject…
Wdrew232 May 8, 2025
dce7910
added local storage to favorites that get clicked on from search
Wdrew232 May 8, 2025
75878ed
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
Wdrew232 May 8, 2025
f2441c2
Merge pull request #78 from 4GeeksAcademy/60-create-favorites-page-view
Jackbringas May 8, 2025
cbfac03
set up storage for favorites
Wdrew232 May 8, 2025
4047cbc
gMerge branch 'main' of https://github.com/4GeeksAcademy/finalproject…
Wdrew232 May 8, 2025
7d00913
database fixed
XxDrancerxX May 8, 2025
25aaf90
done
XxDrancerxX May 8, 2025
3c6cf78
a
XxDrancerxX May 8, 2025
d60b3d5
a
XxDrancerxX May 9, 2025
b07e831
Merge pull request #79 from 4GeeksAcademy/60-create-favorites-page-view
XxDrancerxX May 9, 2025
4807d53
a
XxDrancerxX May 9, 2025
d0dc8bd
password-reset-done
XxDrancerxX May 9, 2025
744a8c4
dine
XxDrancerxX May 9, 2025
587f278
Merge pull request #84 from 4GeeksAcademy/73-set-new-password-view-IDM
Jackbringas May 9, 2025
abc9dec
done
XxDrancerxX May 9, 2025
2817f15
added back end and changed fav jsx to db for back end
Wdrew232 May 9, 2025
23205d4
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
Wdrew232 May 9, 2025
0433e02
reset link
Jackbringas May 9, 2025
6c64972
Merge pull request #86 from 4GeeksAcademy/61-connect-favorites-page-t…
Jackbringas May 9, 2025
7469a24
created logout page
Wdrew232 May 10, 2025
9d97476
Merge pull request #87 from 4GeeksAcademy/password-request-reset-link
Wdrew232 May 10, 2025
e4aace2
layout built
XxDrancerxX May 12, 2025
5044743
Merge branch 'main' of https://github.com/4GeeksAcademy/finalprojectJ…
XxDrancerxX May 12, 2025
b3497fc
main layout
XxDrancerxX May 12, 2025
dcc043e
Merge pull request #94 from 4GeeksAcademy/64-main-page-functionality
Jackbringas May 12, 2025
0139078
Merge branch 'main' into 91-create-logged-out-page-view
XxDrancerxX May 14, 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
22 changes: 14 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
"[javascriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
"[javascriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"github.copilot.enable": {
"*": false,
"plaintext": false,
"markdown": false,
"scminput": false
}
}
25 changes: 14 additions & 11 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,29 @@ flask-sqlalchemy = "*"
flask-migrate = "*"
flask-swagger = "*"
psycopg2-binary = "*"
python-dotenv = "*"
flask-cors = "*"
gunicorn = "*"
cloudinary = "*"
flask-admin = "*"
typing-extensions = "*"
flask-jwt-extended = "==4.6.0"
wtforms = "==3.1.2"
sqlalchemy = "*"
requests = "*"
flask-cors = "*"
python-dotenv = "*"
werkzeug = "*"
flask-bcrypt = "*"

[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'"
218 changes: 201 additions & 17 deletions Pipfile.lock

Large diffs are not rendered by default.

83 changes: 2 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,2 @@
# WebApp boilerplate with React JS and Flask API

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

- 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.

### 1) Installation:

> 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)

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:

| Engine | DATABASE_URL |
| --------- | --------------------------------------------------- |
| SQLite | sqlite:////test.db |
| MySQL | mysql://username:password@localhost:port/example |
| Postgress | postgres://username:password@localhost:5432/example |

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/).
If you receive error of requests module not found:
pipenv install requests
4 changes: 4 additions & 0 deletions READMEE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
team members:
Drew Wilson
Israel Diaz
Jacqueline Bringas
26 changes: 26 additions & 0 deletions docs/assets/reset_migrations.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,29 @@ 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!"
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<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" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello Rigo</title>

</head>
<body>
<div id="root"></div>
Expand Down
35 changes: 0 additions & 35 deletions migrations/versions/0763d677d453_.py

This file was deleted.

48 changes: 48 additions & 0 deletions migrations/versions/52359ea700cf_new_migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""New migration

Revision ID: 52359ea700cf
Revises:
Create Date: 2025-05-12 21:01:14.658239

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '52359ea700cf'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=120), nullable=False),
sa.Column('email', sa.String(length=120), nullable=False),
sa.Column('password', sa.String(length=255), nullable=False),
sa.Column('phone', sa.String(length=20), nullable=False),
sa.Column('is_active', sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email'),
sa.UniqueConstraint('phone')
)
op.create_table('favorite',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('drink_id', sa.String(length=50), nullable=False),
sa.Column('drink_name', sa.String(length=120), nullable=False),
sa.Column('drink_image', sa.String(length=255), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###


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