The application is available for viewing here.
Leaf Lounge book store and community hub is built with a Django
backend - a high-level Python framework that encourages rapid development and clean code practices, and Bootstrap5
, an extensive styling library. As a networking platform, Leaf Lounge offers book lovers the unique opportunity to connect and share impressions, reviews, and critiques of books. Visitors wishing to join one of Leaf Lounge's vast communities need only purchase a book and create an account to gain access to their personal profile, immediately gaining access to all Leaf Lounge has to offer. Additionally, registered users have the option of becoming a Leaf Lounge author by registering for an author profile and uploading their own published works to the Leaf Lounge library.
- Technology Stack
- Feature Sneak Peek
- Structure
- Wireframes
- User Stories
- Business/Social Goals
- UX Goals
- Features
- Models
- Aesthetics
- Testing & Debugging
- Issues
- Accessibility & Performance
- Deployment
- Forking a GitHub Repository
- Cloning a GitHub Repository
- Credits
Django Framework
- fullstack technology.Python
- Used for Django manipulation & interaction.
PostgreSQL
Amazon S3
HTML5/ Django Syntax
- Used for structuring and content.CSS3
- Used for adding styles to the content for legibility and aesthetic appeal.Bootstrap5
- For quick styling and pre-built component libraries.Javascript
- For adding basic interactivity and dynamically setting URLs.jQuery
- For adding basic interactivity and dynamically setting URLs.
FontAwesome
icons - used for icons.Chrome Developer Tools
- used for debugging the website during production.Lighthouse
- For performance, accessibility, best practices and SEO checking.GitHub
- For code storage, version control and deployment.Git
- For commiting through the terminal and pushing to GitHub for storage.Gitpod
- The IDE I developed the project in.VSC
- For quick testing of allauth functionality due to Gitpod's limitations.Balsamiq
- For project wireframe design.W3C Markup Validation Service
- to validate my HTML for potential errors.W3C CSS Validation Service
- to validate my CSS code for potential errors.Code Beautify
- to beautify CSS code.JSHint
- for checking and validating my JS code.Pep8
- for Python code validation and best practices formatting.
- Advanced Book Filtering and Sorting
- Genre-Specific Communities and Forums
- Leave & Read Reviews
- Comprehensive E-COMMERCE
- Custom User Profile
- Become an Author
- Dedicated Customer Service
- As a site user, I would like fast access to only the pages that would benefit my experience.
- All pages should be displayed based on whether I am registered/logged in.
- I should be redirected to relevant pages and without coming across site errors.
- As a site user, I would like all pages to follow the same branding guidelines - this includes font family, colours (colour palette), image styles, spacing, and effects. I would also like colours to convey the correct emotions to ensure the intended branding message and motives.
- As a site visitor and/or potential reseller, I would like colours to convey the correct emotions to ensure the intended branding message and motives.
- As a site user, I would like all pages to be responsive to ensure I have a good user experience. This includes best practices in legibility, colour contrast, font sizes, branding, and element visibility.
- As a site user, if I am not provided with a success page, I need to be presented with a success message on the home page so I know my action was successful.
- As a site user, if I am not provided with an error page, I need to be presented with an error message on the home page so I know my action was unsuccessful.
- As a site user, I should be presented with a 404 page if the page I am looking for is unavailable, or a 500 page I made a bad request to the server with the option of returning to the home page.
- As a site user, I would like to be redirected to an error page if my financial transaction was unsuccessful. Alternatively, an error message should be provided.
- As a site user, I would like to be redirected to a success page so that I can be sure my financial transaction was successful. Alternatively, a success message should be provided.
- As a user, I want to be provided with good accessiblity and interaction on the site so that I can have a pleasant experience on the platform.
Leaf Lounge strives to recreate the experience of shopping in a bookstore by designing its library as a collection of shelves, with different height and colour books, split by genres. The colour blue
is associated with wisdom, a common association with that of a library, thus is the main colour echoed throughout the site. Aesthetics outside of colours are kept to a minimum, with most of the books' appeal stemming from their cover images and effects.
The shelves in the library use a combination of cold-brown tones to mimick wood, while the book-spine shades of dark blues and musky green compliment the timber-colours.
The application is deployed on Heroku via a GitHub connection, and is available for viewing in the link at the top of this README.md document. Additionally, the site is hosted on AWS, and uses S3 for file storage.
To deploy a Heroku project, please refer to the guide below.
There are some general requirements when it comes to setting up your application and its files:
- Your dependencies must be placed in the requirements.txt file.
- You must strictly adhere to the correct folder structure expected by Django's settings.
- In Django's settings.py file, setting Debug = True in development will display a detailed errors page if the application comes across an error hindering template rendering. It will also allow the collection of static files (stylesheets, images, and javascript files automatically). Setting Debug = False will display standard error pages under the same conditions and will not update any changes to static files.
In Heroku, this is configured under Config Vars
in the Settings
tab.
Note: Do not commit to GitHub with Debug = True. Always set Debug = False before committing to avoid exposing personal details.
Note: You will need two-factor verification set up to enable log in.
Log onto your Heroku dashboard using your username and password, and confirm the access code in the two-factor verification app of your choosing.
You will be asked to pick a name and region for your app before clicking Create app
on the next page.
Once you've created your app, go to the Deploy
tab at the top.
Select the middle box with GitHub's logo to connect your Heroku app to a GitHub Repository.
If prompted, authorize Heroku to access your GitHub account. At the bottom, enter the name of the repository you wish to deploy to, and click Connect.
Under Automatic Deploys
, choose a branch from your GitHub repository that Heroku will watch for changes.
Enable automatic deploys by clicking Enable Automatic Deploys
. With this, every push to the selected branch will automatically deploy a new version of your app.
When you create the app, you will need to add the heroku/python
buildpack in the Settings
tab.
If you've enabled automatic deploys, any push to the selected branch will automatically deploy your application.
If you prefer to deploy manually or want to deploy a branch without enabling automatic deploys, go to Manual deploy
, select the branch, and click Deploy Branch
.
Your application will have a similar look to the following Heroku URL configuration: https://*.herokuapp.com
and can be found after clicking the Open App
button on your dashboard in the top right corner.
To follow this guide, you will need to have created an account on aws.
Login in to your account, and in the top navigation bar, in the search menu, type "S3". Click on the S3 Scalable Storage in the Cloud
button, and click Create Bucket
.
To create the new bucket:
- Enter a bucket name.
- Select
ACLs Enabled
. - Select
Bucket Owner Preferred
. - Deselect
Block All Public Access
. - Check the box to acknowledge the risk of public access.
- Leave the other options unchanged and click
Create Bucket
.
Under General Purpose Buckets
, click on your bucket. Click on the Properties
tab and scroll down to the Static Website Hosting
section and click Edit
.
- Click
Enable
. - Enter
"index.html"
(without quotes) into the Index document input. - Enter
"error.html"
(without quotes) into the Error document input. - Click
Save changes
.
Click on the Permissions
tab and scroll down to the Cross-origin resource sharing (CORS) section and click Edit
.
- Add the following code for the CORS settings.
- Click
Save changes
.
[
{
"AllowedHeaders": ["Authorization"],
"AllowedMethods": ["GET"],
"AllowedOrigins": ["*"],
"ExposeHeaders": []
}
]
In the same Permissions
tab of your S3 bucket, scroll to the Bucket policy
section, click Edit
and click Policy Generator
.
This will open in a new tab.
- For the policy type you can select
S3 Bucket Policy
. - For the principal you can enter
*
. - For the Action select
GetObject
from the dropdown.
Go Back to the Policy Editor and copy your Bucket ARN
.
Go back to the Policy Generator.
- Paste the ARN into the ARN input.
- Click
Add Statement
. - Click
Generate Policy
. - Copy all of the text in the window popup. Paste this Policy JSON code into the Policy Editor and add a
/*
to the end of yourBucked ARN
. - Click
Save Changes
.
On the Permissions
tab, scroll down to the Access Control List
section and click Edit
.
- Click
List
in Everyone (public access). - Check the checkbox to indicate you understand the changes and their effects.
- Click
Save changes
.
- Search and select
IAM
in the search bar. - Click
User groups
on the left hand side. - Click
Create Group
and enter a group name. - Click
Create User Group
at the bottom of the page.
- Click
Policies
in the left-handside menu. - Click
Create Policy
.- Click the
JSON
tab. - Click the
Actions
dropdown. - Click
Import policy
. - Search for
S3
. - Select
AmazonS3FullAccess
. - Click
Import Policy
.
- Click the
- In the top navigation bar, search for
S3
and right click the button. Open this in a new tab for ease of access for the following steps. - In this new tab, find your bucket and copy your
Bucket ARN
. - Go back to the previous tab and add your ARN in quotes to the
Resource
list twice, for the second one add/*
after the ARN.
Your code should follow this structure:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement1",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"YOUR_ARN",
"YOUR_ARN/*"
]
}
]
}
- Click
Next
. - Enter a Policy name and description and click
Create Policy
.
- Click
User groups
in the left-handside menu. - Find your group and click it.
- Click the
Permissions
tab. - Click the
Add Permissions
dropdown. - Click
Attach Policies
.- Search for the policy you created earlier and select its checkbox.
- Click
Attach Policies
.
- Click the
- Click
Users
in the left-handside menu. - Click
Create User
.- Enter a name and click
Next
.
- Enter a name and click
- Select the group you created and click
Next
. - Click
Create User
.
- Click on your user and go into the
Security Credentials
tab. - Scroll down to
Access Keys
and clickCreate Access Key
.- Select
Application Running Outside AWS
. - Click
Next
.
- Select
- Click
Create Access Key
. - Download the .csv file and click
Done
. - Open the file in a text editor of your choice, and use the values provided as your
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
keys in Heroku Config Vars.
To make changes to your repository without changing its original state, you can make a copy of it via fork
. This ensures the original repository remains unchanged.
Steps:
- Click into the GitHub repository you want to fork.
- Click
Fork
in the top right-hand side of the top bar, and this should take you to a page titledCreate a new fork
. - You can now work in this copy of your repository without making changes to the original.
Cloning a repository essentially means downloading a copy of your repository that can be worked on locally. This method allows for version control and backup of code.
Steps:
- Click on the GitHub repository you want to clone.
- Click on the
Code
button. - Copy the link in the dropdown.
- Open a terminal within your VSC (or whatever IDE you choose to use).
- In the terminal type 'git clone' and paste the URL.
- Press Enter - you now have a cloned version of your GitHub repository.
-
For help solving
Unsupported lookup 'icontains' for ForeignKey or join on the field not permitted.
: stack overflow -
For help solving
unsupported operand type(s) for |=: 'NoneType' and 'Q'
: stack overflow -
For initialising an
Q()
(wasn't sure on syntax): stack overflow -
For setting up Mailchimp Marketing