Welcome to the Lunar Glow. This website has been designed to provide an online platform for customers to explore and purchase a variety of high-quality, luxury candles, wax melts and accessories. With a focus on creating a delightful shopping experience, this website aims to showcase our products while ensuring ease of navigation and secure transactions.
Designing Lunar Glow involved understanding the target audience and competitors, defining goals, and creating wireframes and prototypes for layout and functionality. Developing a visual identity with design mockups follows, leading to the coding of designs into HTML, CSS, and JavaScript, ensuring responsiveness across devices. Testing included maual/usability testing, and performance optimization The launch involved deploying the website securely via Heroku.
At Lunar Glow, our customers are looking to elevate their decor and to create a cosy, relaxing atmosphere. Bearing this in mind, the colour scheme has been kept to muted and natural tones for a relaxing, yet sophisticated feel to the user experience.
#000000
used for primary text.#E84610
used for primary highlights.#4A4A4F
used for secondary text.#009FE3
used for secondary highlights.#faebd780
and#f4ede7
were used for background colour.
The website coolors.co was used to generate the colour palette. The hero image was used as inspiration and complementing and similar colours from the image was used to create the colour palette.
The font was used to give a clean and elegant finish.
-
Lato was used for primary headers, titles and secondary text.
-
Ms Madi was used for some of the scent headings.
-
Font Awesome icons were used throughout the site, such as shopping bag icons, secure checkout button, social media icons in the footer.
- As a new site user, I would like to create a profile, so that I can store my order details and have a personalized shopping experience on Lunar Glow.
- As a new user, I would like to browse products, so that I can explore the range of candles and wax melts available on Lunar Glow.
- As a new user, I would like to search for specific products, so that I can quickly find items that match my preferences on Lunar Glow.
- As a new user, I would like to sign up for a newsletter, so that I can receive updates, promotions, and news about new products from Lunar Glow.
- As a new user, I would like to read about scent profiles, so that I can understand the different fragrance options available and discover scents that match my preferences on Lunar Glow.
- As a new user, I would like to see which products match my desired scent profile, so that I can easily find and purchase items that align with my preferences on Lunar Glow.
- As a returning user, I would like to log in to my profile, so that I can access my saved information and easily place orders without re-entering my details on Lunar Glow.
- As a returning user, I would like to browse products, so that I can explore the range of candles and wax melts available on Lunar Glow.
- As a returning user, I would like to search for specific products, so that I can quickly find items that match my preferences on Lunar Glow.
- As a returning user, I would like to sort products by different criteria (e.g., price, scent type), so that I can easily find the products I'm interested in on Lunar Glow.
- As a returning user, I would like to add items to my shopping bag, so that I can keep track of the products I want to purchase on Lunar Glow.
- As a returning user, I would like to edit or remove items from my shopping bag, so that I can adjust my order before proceeding to checkout on Lunar Glow.
- As a returning user, I would like to complete my purchase and buy the items in my shopping bag, so that I can enjoy the candles and wax melts from Lunar Glow.
- As a returning user, I would like to access an FAQ section, so that I can find answers to common questions about products, delivery, and returns on Lunar Glow.
- As a site administrator, I should be able to add new products, so that I can expand the range of offerings available on Lunar Glow.
- As a site administrator, I should be able to edit existing product details, so that I can update information and pricing as needed on Lunar Glow.
- As a site administrator, I should be able to remove products, so that I can manage inventory and remove discontinued items from Lunar Glow.
- As a site administrator, I should be able to view and manage user profiles, so that I can assist users with account-related issues and ensure data integrity on Lunar Glow.
- As a site administrator, I should be able to access order details, so that I can track orders, manage deliveries, and handle customer inquiries on Lunar Glow.
- As a site administrator, I should be able to manage the FAQ section, so that I can update and add answers to common questions as needed on Lunar Glow.
- As a site administrator, I should be able to view newsletter subscribers, so that I can analyze subscriber data and manage newsletter communications effectively on Lunar Glow.
- As a site administrator, I should be able to manage user permissions and roles, so that I can control access to different parts of the admin panel and ensure data security on Lunar Glow.
-
User Authentication and Profile Creation
- Users can create accounts and profiles to store their order details and preferences, providing a personalized shopping experience. This provides value as it enables users to manage their orders and preferences conveniently and securely, fostering loyalty and repeat purchases.
-
Product Browsing, Searching, and Sorting
- Users can easily browse, search, and sort through a variety of candles and wax melts. This provides value as it allows users to quickly find products that match their preferences, enhancing the overall shopping experience.
-
Easy to Use UI Components
- Navigation Elements (Nav Bar, Menu): Navigation elements help users move between different sections or pages of the website. They enhance user experience by providing clear pathways to desired content or functionality.
- Buttons: Buttons trigger actions or events when clicked by the user. They enable users to interact with the system, such as submitting a form, adding items to a shopping bag, or navigating to a different page.
-
Product Management
- Administrators can add new products, update existing product details, and remove discontinued items from the inventory. This provides value as it enables administrators to keep the product catalog up-to-date, ensuring a fresh and relevant selection for users.
-
Newsletter Subscription
- Users can sign up to receive newsletters, promotions, and updates about new products. This will add value as it keeps users informed about new offerings and promotions, fostering engagement and encouraging repeat visits to the website.
-
Scent Profiles and Product Matching
- Users can explore scent profiles and identify products that align with their desired fragrances. This helps users discover products that cater to their preferences, enhancing satisfaction and facilitating informed purchasing decisions.
-
FAQ Section
- Users can access a comprehensive FAQ section to find answers to common questions about products, delivery, and returns. This provides users with helpful information and support, reducing uncertainties and enhancing satisfaction with the shopping experience.
-
Shopping Bag Management
- Users can add, edit, and remove items from their shopping bags before proceeding to checkout. This provides value as it gives users control over their purchases, allowing them to review and adjust their orders as needed.
-
Order Management
- Administrators can view and manage order details, and handle customer inquiries. This adds value by helping administrators streamline order processing and customer service, ensuring timely deliveries and resolving issues promptly.
-
Admin Dashboard
- Site administrators have access to a dashboard to manage products, user profiles, orders, FAQs, and newsletter subscribers. This will empower administrators to efficiently oversee and maintain the website, ensuring smooth operations and excellent user experience.
There are many great additions that can be added to the sit to make UX better and to have even more users visiting and re-visiting the site.
-
Wishlist Functionality
- Allow users to create and manage wishlists of products they're interested in purchasing in the future.
-
Product Reviews and Ratings
- Enable users to leave reviews and ratings for products they have purchased, helping other users make informed decisions.
-
Personalised Recommendations -Implement algorithms to provide personalised product recommendations based on users' browsing and purchase history.
-
Social Media Integration
- Allow users to share products they like on social media platforms, and integrate social media login options for easier access.
-
Gift Cards and Vouchers
- Introduce the option for users to purchase and redeem gift cards or vouchers for themselves or others.
-
Subscription Services
- Offer subscription services where users can subscribe to receive regular deliveries of their favorite candles or wax melts.
-
Customization Options
- Provide options for users to customize their orders, such as selecting scents, container styles, or packaging preferences.
-
Local Pickup and Delivery
- Implement a feature for users to choose local pickup or delivery options for their orders, catering to different preferences and needs.
-
Live Chat Support
- Offer live chat support to assist users with inquiries, product recommendations, and troubleshooting in real-time.
-
Guest Checkout
- Allow users to complete purchases without creating an account, streamlining the checkout process for first-time visitors.
-
Product Bundles and Sets
- Create curated bundles or sets of products at discounted prices, encouraging users to purchase complementary items together.
-
Seasonal Collections and Limited Edition Releases
- Introduce seasonal collections and limited edition releases to keep your product offerings fresh and encourage repeat visits from users.
-
Interactive Scent Profiling
- Enhance the scent profiling feature by making it more interactive, allowing users to explore scent families and discover new fragrances.
-
Multilingual Support
- Offer support for multiple languages (especially Welsh) to cater to a diverse user base and expand your reach to international markets.
Techlologies used during the creation of Lunar Glow include:
- HTML used for the main site content.
- CSS used for the main site design and layout.
- CSS :root variables used for reusable styles throughout the site.
- CSS Flexbox used for an enhanced responsive layout.
- CSS Grid used for an enhanced responsive layout.
- JavaScript used for user interaction on the site.
- Python used as the back-end programming language.
- Git used for version control. (
git add
,git commit
,git push
) - GitHub used for secure online code storage.
- Gitpod used as a cloud-based IDE for development.
- Bootstrap used as the front-end CSS framework for modern responsiveness and pre-built components.
- Materialize used as the front-end CSS framework for modern responsiveness and pre-built components.
- Django used as the Python framework for the site.
- PostgreSQL used as the relational database management.
- ElephantSQL used as the Postgres database.
- Heroku used for hosting the deployed back-end site.
- Stripe used for online secure payments of ecommerce products/services.
- AWS S3 used for online static file storage.
class Product(models.Model):
category = models.ForeignKey(
"Category", null=True, blank=True, on_delete=models.SET_NULL)
sku = models.CharField(max_length=254, null=True, blank=True)
name = models.CharField(max_length=254)
description = models.TextField()
scent_profile = models.ForeignKey('scentprofile.ScentProfile', on_delete=models.SET_NULL, null=True, blank=True)
sku = models.CharField(max_length=254, null=True, blank=True)
price = models.DecimalField(max_digits=6, decimal_places=2)
image = models.ImageField(null=True, blank=True)
def __str__(self):
return self.name
- DrawSQL DrawSQL was used to create an ERD to visualise the tables within the database and their relationships.
-
Table: Product
PK id (unique) Type Notes FK category ForeignKey FK to Category model sku CharField name CharField description TextField FK scent_profile CharField FK to ScentProfile model price DecimalField image ImageField -
Table: Category
PK id (unique) Type Notes name harField friendly_name CharField -
Table: Order
PK id (unique) Type Notes FK user_profile ForeignKey FK to UserProfile model order_number CharField full_name CharField email EmailField phone_number CharField country CountryField street_address1 CharField street_address2 CharField county CharField date DateTimeField delivery_cost DecimalField order_total DecimalField grand_total DecimalField -
Table: OrderLineItem
PK id (unique) Type Notes FK order ForeignKey FK to Order model FK product CharField FK to Product model quantity IntegerField lineitem_total DecimalField -
Table: FAQCategory
PK id (unique) Type Notes name CharField friendly_name CharField -
Table: FAQ_QA
PK id (unique) Type Notes FK faq_category ForeignKey FK to FAQCategory model question CharField answer TextField -
Table: Subscriber
PK id (unique) Type Notes email EmailField name CharField timestamp DateTimeField -
Table: ScentProfile
PK id (unique) Type Notes name CharField description TextField -
Table: UserProfile
PK id (unique) Type Notes FK user OneToOneField FK to User model default_phone_number CharField default_street_address1 CharField default_street_address2 CharField default_town_or_city CharField default_county CharField default_postcode DecimalField default_country CountryField
For all testing, please refer to the TESTING.md file.
The live deployed application can be found deployed on Heroku.
This project uses ElephantSQL for the PostgreSQL Database.
To obtain your own Postgres Database, sign-up with your GitHub account, then follow these steps:
- Click Create New Instance to start a new database.
- Provide a name (this is commonly the name of the project: lunar_glow).
- Select the Tiny Turtle (Free) plan.
- You can leave the Tags blank.
- Select the Region and Data Center closest to you.
- Once created, click on the new database name, where you can view the database URL and Password.
This project uses AWS to store media and static files online, due to the fact that Heroku doesn't persist this type of data.
Once you've created an AWS account and logged-in, follow these series of steps to get your project connected. Make sure you're on the AWS Management Console page.
-
Search for S3.
-
Create a new bucket, give it a name (matching your Heroku app name), and choose the region closest to you.
-
Uncheck Block all public access, and acknowledge that the bucket will be public (required for it to work on Heroku).
-
From Object Ownership, make sure to have ACLs enabled, and Bucket owner preferred selected.
-
From the Properties tab, turn on static website hosting, and type
index.html
anderror.html
in their respective fields, then click Save. -
From the Permissions tab, paste in the following CORS configuration:
[ { "AllowedHeaders": [ "Authorization" ], "AllowedMethods": [ "GET" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [] } ]
-
Copy your ARN string.
-
From the Bucket Policy tab, select the Policy Generator link, and use the following steps:
-
Policy Type: S3 Bucket Policy
-
Effect: Allow
-
Principal:
*
-
Actions: GetObject
-
Amazon Resource Name (ARN): paste-your-ARN-here
-
Click Add Statement
-
Click Generate Policy
-
Copy the entire Policy, and paste it into the Bucket Policy Editor
{ "Id": "Policy1234567890", "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1234567890", "Action": [ "s3:GetObject" ], "Effect": "Allow", "Resource": "arn:aws:s3:::your-bucket-name/*" "Principal": "*", } ] }
-
Before you click "Save", add
/*
to the end of the Resource key in the Bucket Policy Editor (like above). -
Click Save.
-
-
From the Access Control List (ACL) section, click "Edit" and enable List for Everyone (public access), and accept the warning box.
- If the edit button is disabled, you need to change the Object Ownership section above to ACLs enabled (mentioned above).
Back on the AWS Services Menu, search for and open IAM (Identity and Access Management). Once on the IAM page, follow these steps:
- From User Groups, click Create New Group.
- Suggested Name:
group-lunar_glow
(group + the project name)
- Suggested Name:
- Tags are optional, but you must click it to get to the review policy page.
- From User Groups, select your newly created group, and go to the Permissions tab.
- Open the Add Permissions dropdown, and click Attach Policies.
- Select the policy, then click Add Permissions at the bottom when finished.
- From the JSON tab, select the Import Managed Policy link.
-
Search for S3, select the
AmazonS3FullAccess
policy, and then Import. -
You'll need your ARN from the S3 Bucket copied again, which is pasted into "Resources" key on the Policy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": [ "arn:aws:s3:::your-bucket-name", "arn:aws:s3:::your-bucket-name/*" ] } ] }
-
Click Review Policy.
-
Suggested Name:
policy-lunar_glow
(policy + the project name) -
Provide a description:
- "Access to S3 Bucket for lunar_glow static files."
-
Click Create Policy.
-
- From User Groups, click your "group-lunar_glow".
- Click Attach Policy.
- Search for the policy you've just created ("policy-lunar_glow") and select it, then Attach Policy.
- From User Groups, click Add User.
- Suggested Name:
user-lunar_glow
(user + the project name)
- Suggested Name:
- For "Select AWS Access Type", select Programmatic Access.
- Select the group to add your new user to:
group-lunar_glow
- Tags are optional, but you must click it to get to the review user page.
- Click Create User once done.
- You should see a button to Download .csv, so click it to save a copy on your system.
- IMPORTANT: once you pass this page, you cannot come back to download it again, so do it immediately!
- This contains the user's Access key ID and Secret access key.
AWS_ACCESS_KEY_ID
= Access key IDAWS_SECRET_ACCESS_KEY
= Secret access key
- If Heroku Config Vars has
DISABLE_COLLECTSTATIC
still, this can be removed now, so that AWS will handle the static files. - Back within S3, create a new folder called:
media
. - Select any existing media images for your project to prepare them for being uploaded into the new folder.
- Under Manage Public Permissions, select Grant public read access to this object(s).
- No further settings are required, so click Upload.
This project uses Stripe to handle the ecommerce payments.
Once you've created a Stripe account and logged-in, follow these series of steps to get your project connected.
- From your Stripe dashboard, click to expand the "Get your test API keys".
- You'll have two keys here:
STRIPE_PUBLIC_KEY
= Publishable Key (starts with pk)STRIPE_SECRET_KEY
= Secret Key (starts with sk)
As a backup, in case users prematurely close the purchase-order page during payment, we can include Stripe Webhooks.
- From your Stripe dashboard, click Developers, and select Webhooks.
- From there, click Add Endpoint.
https://lunar-glow-77444c493d2e.herokuapp.com/checkout/wh/
- Click receive all events.
- Click Add Endpoint to complete the process.
- You'll have a new key here:
STRIPE_WH_SECRET
= Signing Secret (Wehbook) Key (starts with wh)
This project uses Gmail to handle sending emails to users for account verification and purchase order confirmations.
Once you've created a Gmail (Google) account and logged-in, follow these series of steps to get your project connected.
- Click on the Account Settings (cog icon) in the top-right corner of Gmail.
- Click on the Accounts and Import tab.
- Within the section called "Change account settings", click on the link for Other Google Account settings.
- From this new page, select Security on the left.
- Select 2-Step Verification to turn it on. (verify your password and account)
- Once verified, select Turn On for 2FA.
- Navigate back to the Security page, and you'll see a new option called App passwords.
- This might prompt you once again to confirm your password and account.
- Select Mail for the app type.
- Select Other (Custom name) for the device type.
- Any custom name, such as "Django" or lunar_glow
- You'll be provided with a 16-character password (API key).
- Save this somewhere locally, as you cannot access this key again later!
EMAIL_HOST_PASS
= user's 16-character API keyEMAIL_HOST_USER
= user's own personal Gmail email address
This project uses Heroku, a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud.
Deployment steps are as follows, after account setup:
- Select New in the top-right corner of your Heroku Dashboard, and select Create new app from the dropdown menu.
- Your app name must be unique, and then choose a region closest to you (EU or USA), and finally, select Create App.
- From the new app Settings, click Reveal Config Vars, and set your environment variables.
Key | Value |
---|---|
AWS_ACCESS_KEY_ID |
user's own value |
AWS_SECRET_ACCESS_KEY |
user's own value |
DATABASE_URL |
user's own value |
DISABLE_COLLECTSTATIC |
1 (this is temporary, and can be removed for the final deployment) |
EMAIL_HOST_PASS |
user's own value |
EMAIL_HOST_USER |
user's own value |
SECRET_KEY |
user's own value |
STRIPE_PUBLIC_KEY |
user's own value |
STRIPE_SECRET_KEY |
user's own value |
STRIPE_WH_SECRET |
user's own value |
USE_AWS |
True |
Heroku needs two additional files in order to deploy properly.
- requirements.txt
- Procfile
You can install this project's requirements (where applicable) using:
pip3 install -r requirements.txt
If you have your own packages that have been installed, then the requirements file needs updated using:
pip3 freeze --local > requirements.txt
The Procfile can be created with the following command:
echo web: gunicorn app_name.wsgi > Procfile
- replace app_name with the name of your primary Django app name; the folder where settings.py is located
For Heroku deployment, follow these steps to connect your own GitHub repository to the newly created app:
Either:
- Select Automatic Deployment from the Heroku app.
Or:
- In the Terminal/CLI, connect to Heroku using this command:
heroku login -i
- Set the remote for Heroku:
heroku git:remote -a app_name
(replace app_name with your app name) - After performing the standard Git
add
,commit
, andpush
to GitHub, you can now type:git push heroku main
The project should now be connected and deployed to Heroku!
This project can be cloned or forked in order to make a local copy on your own system.
For either method, you will need to install any applicable packages found within the requirements.txt file.
pip3 install -r requirements.txt
.
You will need to create a new file called env.py
at the root-level,
and include the same environment variables listed above from the Heroku deployment steps.
Sample env.py
file:
import os
os.environ.setdefault("AWS_ACCESS_KEY_ID", "user's own value")
os.environ.setdefault("AWS_SECRET_ACCESS_KEY", "user's own value")
os.environ.setdefault("DATABASE_URL", "user's own value")
os.environ.setdefault("EMAIL_HOST_PASS", "user's own value")
os.environ.setdefault("EMAIL_HOST_USER", "user's own value")
os.environ.setdefault("SECRET_KEY", "user's own value")
os.environ.setdefault("STRIPE_PUBLIC_KEY", "user's own value")
os.environ.setdefault("STRIPE_SECRET_KEY", "user's own value")
os.environ.setdefault("STRIPE_WH_SECRET", "user's own value")
# local environment only (do not include these in production/deployment!)
os.environ.setdefault("DEBUG", "True")
Once the project is cloned or forked, in order to run it locally, you'll need to follow these steps:
- Start the Django app:
python3 manage.py runserver
- Stop the app once it's loaded:
CTRL+C
or⌘+C
(Mac) - Make any necessary migrations:
python3 manage.py makemigrations
- Migrate the data to the database:
python3 manage.py migrate
- Create a superuser:
python3 manage.py createsuperuser
- Load fixtures (if applicable):
python3 manage.py loaddata file-name.json
(repeat for each file) - Everything should be ready now, so run the Django app again:
python3 manage.py runserver
If you'd like to backup your database models, use the following command for each model you'd like to create a fixture for:
python3 manage.py dumpdata your-model > your-model.json
- repeat this action for each model you wish to backup
You can clone the repository by following these steps:
- Go to the GitHub repository
- Locate the Code button above the list of files and click it
- Select if you prefer to clone using HTTPS, SSH, or GitHub CLI and click the copy button to copy the URL to your clipboard
- Open Git Bash or Terminal
- Change the current working directory to the one where you want the cloned directory
- In your IDE Terminal, type the following command to clone my repository:
git clone https://github.com/d3lyth/lunar_glow.git
- Press Enter to create your local clone.
Alternatively, if using Gitpod, you can click below to create your own workspace using this repository.
Please note that in order to directly open the project in Gitpod, you need to have the browser extension installed. A tutorial on how to do that can be found here.
By forking the GitHub Repository, we make a copy of the original repository on our GitHub account to view and/or make changes without affecting the original owner's repository. You can fork this repository by using the following steps:
- Log in to GitHub and locate the GitHub Repository
- At the top of the Repository (not top of page) just above the "Settings" Button on the menu, locate the "Fork" Button.
- Once clicked, you should now have a copy of the original repository in your own GitHub account!
After thoroughly comparing Local vs live deployment, there doesn't seem to be any differences in the website.
The main code base for this project has come from the Boutique Ado walkthrough by Code Institute, that I have then added, edited and removed some features and code. This will include the profiles app, the checkout and bag app and various other features of the website.
The code for the footer has been based on and adapted from Tim Nelson in this html file.
The product names and descriptions for various products and scent profiles were generated using AI - ChatGPT.
Image credit can be seen below.
Source | Location | Notes |
---|---|---|
Markdown Builder | README and TESTING | tool to help generate the Markdown files |
Chris Beams | version control | "How to Write a Git Commit Message" |
W3Schools | entire site | responsive HTML/CSS/JS navbar |
W3Schools | contact page | interactive pop-up (modal) |
W3Schools | entire site | how to use CSS :root variables |
Flexbox Froggy | entire site | modern responsive layouts |
Grid Garden | entire site | modern responsive layouts |
StackOverflow | quiz page | Fisher-Yates/Knuth shuffle in JS |
YouTube | leaderboard | using localStorage() in JS for high scores |
YouTube | PP3 terminal | tutorial for adding color to the Python terminal |
WhiteNoise | entire site | hosting static files on Heroku temporarily |
Medium | artice | instructions on how to create erd diagrams using django extensions |
Here are the sources of the images for the website.
Source | Location | Type | Notes |
---|---|---|---|
Pexels | entire site | image | favicon on all pages |
Ethel and Co | home page | image | hero image background |
ScentMyLove | entire site | image | sample of fake products - mainly candles and wax bars |
Etsy | entire site | image | sample of fake products |
TinyPNG | entire site | image | tool for image compression |
- I would like to thank my Code Institute mentor, Tim Nelson for their support throughout the development of this project.
- I would like to thank the Code Institute tutor team (especially Roman) for their assistance with troubleshooting and debugging some project issues.
- I would like to thank the Code Institute Slack community for the moral support; it kept me going during periods of self doubt and imposter syndrome.
- I would like to thank my partner Rob, and my daughters for believing in me, and allowing me to make this transition into software development.
- I would like to thank my friend Matt, for his coding advice.