Welcome to the Book_Organizer README!
A app to help authors create and organize books they are currently writting and to connect authors to other aspiring authors.
- React
- Redux
- Flask
- Flask-SQLAlchemy
- WTForms
- Postgress
- Alembic
- Where a unauthenticated user first comes when they visit the site.
- Where an unauthenticated user can create a new account.
- Where an unauthenticated user can login to a preexisting account.
- Where authenticated users can create new public characters for people to enjoy.
- Where authenticated users can search for public characters.
- Where authenticated users can create new public characters.
- Where authenticated users can update preexisting public characters.
- Where authenticated users can view their personal account information.
- Where authenticated users can view their personal books.
- Where authenticated users can view specific details within a book.
- Where authenticated users can create new characters for a book.
- Where authenticated users can view their created polls.
- Where authenticated users can view all of the currently created polls for the site.
- Where authenticated users can view specific details within a specific poll.
- Where authenticated users can update their comments on a poll.
-
Reusable component that returns a link to a specific book that the authenticated user has created.
-
Displays the PrivateCharacter and Pages components for a specific book that was created by a authenticated user.
-
Displays all of the authenticated users books.
-
Displays all of the public characters currently created by users on the site.
-
Displays characters from a user by their unique search id.
-
Reusable component that allows users to comment on another users poll.
-
Displays comments for a specific poll.
-
Reusable component that allows an authenticated user to create a new book.
-
Reusable component that allows an authenticated user to create a new public character.
-
Reusable component that allow an authenticated user to create a new page or update an existing page if the update prop is set to true.
-
Reusable component that allow an authenticated user to create a new poll or update an existing poll if the update prop is set to true.
-
Reusable component that allow an authenticated user to create a new private character or update an existing private character if the update prop is set to true.
-
Displays all of the pages for a specific book.
-
Displays all of the private characters for a specific book.
-
Displays user information for a user that is not the currently authenticated user.
-
Reusable component that displays generic backend validation errors.
-
Displays an authenticated users followers.
-
Displays the users that an authenticated user is following.
-
Displays basic social links with their coresponding icons.
-
Displays the splash page.
-
Reusable component that will render a selected image when creating a public or private character.
-
Reusable component that renders a gif when the application is loading.
-
Reusable component for previous users to login to their existing account.
-
Component that will logout an authenticated user.
-
Component that sets up all of the authenticated routes and unauthenticated routes based on if a user is currently logged in or not.
-
Component that dynamically changes based on if a user is authenticated or not.
-
Displays all of the pages for a specific book created by the user.
-
Displays all of the current polls created by users on the site.
-
Displays the private characters for a specific book.
-
Displays the authenticated users personal information.
-
Reusable component that displays the search results returned from a search by a users unique id.
-
Reusable component that allows an unauthenticated user to create a new account.
-
Component that displays a specific public character when a character card is clicked on.
-
Reusable component that displays a loading gif on a successful request to an aws image upload.
-
Reusable component that shows a custom tooltip when hovering over a icon.
-
Reusable component that allows an authenticated user to update an existing public character.
-
Reusable component that allows an authenticated user to update their personal account information.
-
Used to hold global state setter functions for use in other parts of the application.
-
Used to hold generic backend validation error messages.
-
Holds the authenticated users personal information.
-
Allows for full crud on public character information.
-
Holds a searched for users public character data.
-
Allows for full crud on a authenticated users books.
-
Allows for full crud on a authenticated users private characters.
-
Allows for full crud on a authenticated users pages.
-
Allows for full crud on a authenticated users polls.
-
Allows for full crud on a authenticated users comments.
-
Holds all of the currently created polls by users of the site.
-
Holds all of the users following the currently authenticated user.
-
Allows for full crud on a users a authenticated user is following.
- One aspect that was particularly challenging for this project was being able to create a reusable component that displayed a preview of a users selected image to upload to AWS. This was challenging because it needed to be completely reusable and have responsive styles.
- Related to the challenge above, was a completely reusable and responsive modal that would be used across the site.
const ImgPreview = ({ update=false, prevAvatar, urlpreview, cancelImgChoice, avatarUrl, openModal, setOpenModal }) => {
const { currentStyle, initImgPreviewStyle } = useModalStyle();
useEffect(() => {
initImgPreviewStyle();
},[]);
const closeModal = () => {
setOpenModal(false);
}
if(update) {
return (
<>
<div className={styles.url_preview_wrap}>
<img src={prevAvatar} alt={"cool"} />
<span>Last Avatar: </span>
</div>
<ReactModal
isOpen={openModal}
onRequestClose={closeModal}
style={currentStyle}
appElement={document.getElementById('root')}
>
<div className={styles.url_preview_wrap}>
{urlpreview === null ?
null
:
<>
<img src={avatarUrl} alt={"cool"} />
<button onClick={cancelImgChoice}> Cancel </button>
</>
}
</div>
</ReactModal>
</>
)
}
return (
<>
<ReactModal
isOpen={openModal}
onRequestClose={closeModal}
style={currentStyle}
appElement={document.getElementById('root')}
>
<div className={styles.url_preview_wrap}>
{urlpreview === null ?
null
:
<>
<img src={avatarUrl} alt={"cool"} />
<button onClick={cancelImgChoice}> Cancel </button>
</>
}
</div>
</ReactModal>
</>
)
};
export default ImgPreview;
- Above is the reusable image preview component. This component was challenging because it had to be responsive and reusable for both first time uploads and updates to previous uploads. Along with what was mentioned before, this component is also a modal that will appear after a user has selected a image to upload to AWS.
- In order to know if the component was being used for a update or first time use, the prop
update
will conditionally render JSX based on if it is set to eithertrue
orfalse
. As for solving the styling issues, inline styles are set within a context value which is passed to theReactModal
style prop. These styles are constructed in the function callinitImgPreviewStyle();
, which is called when the component initially renders. The modal can be closed either by clicking anywhere on the page besides the modal window or clicking on the cancel button that displays within the modal window. This is accomplished by declaring state outside of theImgPreview
component and passing its state and state setter function as props(openModal, setOpenModal
). - Due to time constraints on the project, my original implementation of a reusable modal was naive and something I was not proud of. I decided to come back and do a full refactor of my initial implementation and decided to use a package called
ReactModal
. I chose this package because it was intuitive and its documentation was excellent.
- Allowing users to associate public characters to a private book.
- Allowing users to direct message the users they are following.
- Allowing users to upload pages to a book if they do not want to manually input page data.
- Allowing users to update a uploaded page file.
If you want to contribute to this project all you have to do is:
git clone https://github.com/JSchutza/Book_Organizer.git
cd Book_Organizer/
pipenv install
cd frontend/
npm install