Live Link: https://inspired-goc1.onrender.com
Whether you're overcoming obstacles in life, need an extra push to get stuff done, or enjoy sharing postive quotes with your friends, Inspired is here to help! Inspired is an app where users can swipe to like or dislike daily quotes and create collections to store their favorite quotes.
- Users can create an account, log in, and log out.
- Users can use a demo log in to try the site.
- Logged out users are directed to the home page.
- Logged in users can create, edit, and delete quotes.
- Logged in users can create, edit, and delete collections.
- Logged in users can like/dislike a quote.
- Logged in users can customize their own themes.
- Logged in users and guest users search for quotes in different categories.
- Quote of the day feature.
- Logged in users can add tags to a quote.
- Logged in users can search for quotes/authors.
- React-Redux
- Javascript
- Flask
- SQL-Alchemy
- Alembic
- Python
- CSS
- HTML
- PostgreSQL
Column Name | Data Type | Details |
---|---|---|
id | Integer | Not Null, Primary Key |
username | String | Not Null |
String | Not Null, unique | |
hashed_password | String | Not Null |
created_at | DateTime | Not Null |
update_at | DataTime | Not Null |
- unique: true`
Column Name | Data Type | Details |
---|---|---|
id | Integer | Not Null, Primary Key |
title | String(150) | Not Null |
user_id | Integer | Not Null, Foreign Key |
created_at | DateTime | Not Null |
update_at | DataTime | Not Null |
user_id
referencesusers
table
Column Name | Data Type | Details |
---|---|---|
collection_id | Integer | Not Null, Foreign Key |
quote_id | Integer | Not Null, Foreign Key |
created_at | DateTime | Not Null |
update_at | DateTime | Not Null |
collection_id
referencescollections
tablequote_id
referencesquotes
table
Column Name | Data Type | Details |
---|---|---|
id | Integer | Not Null, Primary Key |
content | String | Not Null |
user_id | Integer | Foreign Key |
created_at | DateTime | Not Null |
update_at | DataTime | Not Null |
user_id
referencesusers
table
Column Name | Data Type | Details |
---|---|---|
id | Integer | Not Null, Primary Key |
quote_id | String | Not Null |
user_id | Integer | Not, Null,Foreign Key |
created_at | DateTime | Not Null |
update_at | DataTime | Not Null |
user_id
referencesusers
tablequote_id
referencesquotes
table
Column Name | Data Type | Details |
---|---|---|
id | Integer | Not Null, Primary Key |
quote_id | String | Not Null |
user_id | Integer | Not, Null,Foreign Key |
created_at | DateTime | Not Null |
update_at | DataTime | Not Null |
user_id
referencesusers
tablequote_id
referencesquotes
table
- faker
- WTForms
- alembic
- Flask
- react-tinder-card
- redux
- redux-thunk
- react-modal
This is the backend for the Flask React project.
-
Install dependencies
pipenv install --dev -r dev-requirements.txt && pipenv install -r requirements.txt
-
Create a .env file based on the example with proper settings for your development environment
-
Setup your PostgreSQL user, password and database and make sure it matches your .env file
-
Get into your pipenv, migrate your database, seed your database, and run your flask app
pipenv shell
flask db upgrade
flask seed all
flask run
-
To run the React App in development, checkout the README inside the
react-app
directory.
IMPORTANT! If you add any python dependencies to your pipfiles, you'll need to regenerate your requirements.txt before deployment. You can do this by running:
pipenv lock -r > requirements.txt
ALSO IMPORTANT! psycopg2-binary MUST remain a dev dependency because you can't install it on apline-linux. There is a layer in the Dockerfile that will install psycopg2 (not binary) for us.
-
Create a new project on Heroku
-
Under Resources click "Find more add-ons" and add the add on called "Heroku Postgres"
-
Install the Heroku CLI
-
Run
heroku login
-
Login to the heroku container registry
heroku container:login
-
Update the
REACT_APP_BASE_URL
variable in the Dockerfile. This should be the full URL of your Heroku app: i.e. "https://flask-react-aa.herokuapp.com" -
Push your docker container to heroku from the root directory of your project. This will build the dockerfile and push the image to your heroku container registry
heroku container:push web -a {NAME_OF_HEROKU_APP}
-
Release your docker container to heroku
heroku container:release web -a {NAME_OF_HEROKU_APP}
-
set up your database:
heroku run -a {NAME_OF_HEROKU_APP} flask db upgrade heroku run -a {NAME_OF_HEROKU_APP} flask seed all
-
Under Settings find "Config Vars" and add any additional/secret .env variables.
-
profit