You can head to the live website here -----> VGB Games
The VBG Games site is a Magic the Gathering and boardgaming network, connecting players in the area in and around Varberg city on the west coast of Sweden. The main goal is to give different playgroups a common site to plan events, sell or buy games, cards and accessories, communicate with eacother. Since the gameshop in Varberg closed down there is no place for people who loves games to connect and meet with likeminded people who are engaged in the same hobby.
It was developed to help connect poeple in Varberg with likeminded players. The main coal was to allow users to join/create events, sell or buy products, and communicate about everything MtG and boardgames with the messaging service.
This Django project is made for those that:
Landing page/Homepage
A straightforward landing page with a short welcome-message, links to register or sign in right next to the welcome-message. There is also a nav-bar that only contains the options login or register before you sign in.
Login
The login asks the user to input their username and password, there is also a button if you forgot your passwrod to allow the user to reset it with their email address. Error/success messages pop-in to give the user feedback if the login was successful or if there was an error.
Register new user
Allows new visitors to register as users of the site, they need to type in: Username(required), Email(required), Password and confirm password(required), First Name and Last Name.
Logged-in welcome
Message that says 'Welcome, you're successfully signed in'. and a automatic Django message that confirms your login. Now that you're signed in as a authenticated user the nav-bar chenges and gives you access to all parts of the site: Events, Messaging, Marketplace and Logout.
Log-out
When the logged in user clicks the logout button in the nav bar the get redirected to a confirmation page that asks if the user is sure they want to sign out and the signout button to confirm. The nav-bar is there for the user regret their logout descion and head to another part of the site.
Browse events
This page lists all the available public events. at the top there is also a button for creating new events and a input field to type in a access-code if another user have giiven you access to one of their private events. If you type a correct code you're automatically added as a participant and you get a django message confirming, if it is not a correct access code you get a django error message explaining that.
Each event lists the event title, description, host, time and date, how many participants and 3 buttons: Communicate(opens a message-board for the specific event), join button(if you already have joined its a gray joined "button"), and if you are the creator of the event you have a delete button so you can delete the event. All events are sorted so the events that are happing soonest is displayed at the top if the list and sorted in descending order. There is also a code running in heroku everyday at midnight that deletes all events that happened during the day.
Events communication
When the communicate button for an event is clicked you're brought to a chat-like messaging page for the specific event, all users that have access to the event(for public-events all signed in users, for private events everyone with the access-code) can read and write messages in the communicate page. This feature makes it great for potential perticipants and particapants alike to ask questions to the creator or eachother, so that Q&A's that perhaps more than one user is wondering is answered and available in a logical place. The creator of each message has the opportunity to delete their own messages.
The communicate page also displays the event-information at the top of the page so that it's easily accessible.
Create event
The create-event page consists of a Title input-field, Description textarea input, datetime-picker and a checkbox to make a private event.
If you check the private event box, you as the creator of a private event will see the access-code for the specific event in the event when you head to your joined events section and this is the code you share with users you would like to join your event.
Joined events
This page lists all the events you have oined/created.
Each event lists the event title, description, host, time and date, how many participants and 3 buttons: Communicate(opens a message-board for the specific event), a gray joined "button", and if you are the creator of the event you have a delete button so you can delete the event. All events are sorted so the events that are happing soonest is displayed at the top if the list and sorted in descending order. There is also a code running in heroku everyday at midnight that deletes all events that happened during the day.
Edit events
This part of the event app implements a robust and intuitive event editing functionality specifically designed for the event creators. This allows you to have full control over the event details and make adjustments as necessary.
Messages Inbox
The inbox feature in the project provides a centralized location for users to manage and view their received messages. It allows registered users to communicate with each other within the site, facilitating efficient and convenient communication.
Sent messages box
The sent message box feature in the project allows users to keep track of the messages they have sent to other users within the site. It provides a convenient way to view and manage sent messages, ensuring that users have a complete record of their communication history.
Deleted messages box
The deleted messages box feature in the project provides a dedicated space for users to store and manage their deleted messages. It offers a convenient way to recover accidentally deleted messages or permanently remove unwanted messages from the system.
Archived messages box
The archived messages box feature in the project offers users a dedicated space to store and manage their archived messages. It provides a convenient way to declutter the main inbox while still retaining access to important or historical conversations.
Write new message
The write new message feature in the project allows users to compose and send new messages to other users within the site. It provides a convenient and intuitive interface for initiating and engaging in conversations.
Message conversation
The message conversation feature in the project allows users to view and manage their conversations with other users in a streamlined and intuitive interface. This feature is designed to facilitate seamless and efficient communication within the site.
Marketplace all products for sale
The marketplace feature in the project serves as a platform where users can view all available products for sale and display their own products. It provides a seamless and user-friendly interface for exploring, comparing, selling and purchasing products.
Create a new product for sale
The create new product for sale feature in the project allows users to list their own products for sale in the Marketplace. It offers an intuitive interface for users to enter product details and create new listings.
Your products for sale overview
The user's products for sale overview feature in the project provides users with a comprehensive dashboard to manage all their product listings in the marketplace.
Social media verification (facebook, Google...)
In future releases I would like to add that you can sign up to the site with google, facebook or similar account.
Activate and setup email confirmation
Add email confirmation when user signs up for the site, to make sure the user is a real person.
Add email notifications
Add email notifications for new messeges, users joining your events, users show interest in your product for sale.
Add contact seller functionality
Add a 'Contact Seller' button on product listings. This will redirect users to a pre-filled new message form, making communication between buyers and sellers quicker and easier.
Add on-site notification system
Add a notification system for new messeges, users joining your events, users show interest in your product for sale.
Design and make a logo in Adobe Illustrator
Make a logo in Adobe Illustrator that reflects the brand identity of the site.
Make the homepage for logged in users
Make the homepage for logged in users more appealing and attractive, and add functionality like lists of joined events, your products for sale, new messages, etc.
Sort products in the markedplace by Category
Add a filter option in the marketplace to sort products by category.
Sort products in the markedplace by sold/available
Add a filter option in the marketplace to sort products by sold/available.
Add a display next to the navbar that shows which user is logged in
Add a display next to the navbar that makes it easy for the user to make sure he/she is logged in correctly.
The site's design features a calming blue color scheme, accented with playful hues of orange and red. The background illustraion are ment to represent the occean which is a an important part of the coastal city of Varberg, enhancing the visual appeal and providing the "feeling" of the coast. The layout and responsiveness of the site are based on Bootstrap framework
The colorscheme was taken from the color-design book Papier Tigre Color Inspiration volume 2, it was chosen for its calm blue colors with the playful orange and red complimenting-colors.
The RGB codes are:
From Google Fonts the 'Wellfleet' was chosen for it's playful look and easy readability, and the back up if not supported is standard 'monospace'.
Background image is created by me (Marelius Moen) in Adobe Illustrator, the design of the background is inspired by the occean which is a very important part of the coastal-city Varbergs image. These visuals add visual interest and enhance the user experience, making the site more engaging and visually appealing.
Before starting the development of the VBG Games site, wireframes were created to plan and visualize the layout and structure of the different pages. These wireframes served as a blueprint for the design process, ensuring a cohesive and user-friendly interface.
Our application uses the PostgreSQL database to handle data persistence.
Allauth We use the Django Allauth package to manage user authentication. It was migrated to PostgreSQL database.
A message between a User and another User or an AnonymousUser.
Name | Database Key | Field Type | Validation |
---|---|---|---|
Sender | sender | ForeignKey to User | on_delete=models.CASCADE |
Recipient | recipient | ForeignKey to User | on_delete=models.CASCADE, related_name='recipient_messages' |
Subject | subject | CharField | max_length=255 |
Body | body | TextField | None |
EmailField | blank=True | ||
Parent | parent | ForeignKey to 'self' | on_delete=models.CASCADE, related_name='next_messages', null=True, blank=True |
Thread | thread | ForeignKey to 'self' | on_delete=models.CASCADE, related_name='child_messages', null=True, blank=True |
Sent at | sent_at | DateTimeField | default=now |
Read at | read_at | DateTimeField | null=True, blank=True |
Replied at | replied_at | DateTimeField | null=True, blank=True |
Sender Archived | sender_archived | BooleanField | default=False |
Recipient Archived | recipient_archived | BooleanField | default=False |
Sender Deleted At | sender_deleted_at | DateTimeField | null=True, blank=True |
Recipient Deleted At | recipient_deleted_at | DateTimeField | null=True, blank=True |
Moderation Status | moderation_status | CharField | max_length=1, choices=STATUS_CHOICES, default=STATUS_ACCEPTED |
Moderation By | moderation_by | ForeignKey to User | on_delete=models.CASCADE, related_name='moderated_messages', null=True, blank=True |
Moderation Date | moderation_date | DateTimeField | null=True, blank=True |
Moderation Reason | moderation_reason | CharField | max_length=120, blank=True |
is_pending()
: Tell if the message is in the pending state.is_rejected()
: Tell if the message is in the rejected state.is_accepted()
: Tell if the message is in the accepted state.is_new
: Tell if the recipient has not yet read the message.is_replied
: Tell if the recipient has written a reply to the message.get_absolute_url
: Deprecated. Usage is deprecated since v3.3.0.quote(format_subject, format_body=None)
: Return a dictionary of quote values to initiate a reply.get_replies_count()
: Return the number of accepted responses.clean()
: Check some validity constraints.clean_moderation(initial_status, user=None)
: Adjust automatically some fields, according to the status workflow.clean_for_visitor()
: Do some auto-read and auto-delete, because there is no one to do it (no account).update_parent(initial_status)
: Update the parent to actualize its response state.notify_users(initial_status, site, is_auto_moderated=True)
: Notify the rejection (to sender) or the acceptance (to recipient) of the message.get_dates()
: Get some dates to restore later.set_dates(sender_deleted_at, recipient_deleted_at, read_at)
: Restore some dates.get_moderation()
: Get moderation information to restore later.set_moderation(status, by_id, date, reason)
: Restore moderation information.auto_moderate(moderators)
: Run a chain of auto-moderators.A proxy to Message, focused on pending objects to accept or reject.
Same as Message
set_accepted()
: Set the message as accepted.set_rejected()
: Set the message as rejected.Represents a product category.
Name | Database Key | Field Type | Validation |
---|---|---|---|
Name | name | CharField | max_length=100 |
__str__()
: Returns the name of the category.Represents a product in the e-commerce system.
Name | Database Key | Field Type | Validation |
---|---|---|---|
Title | title | CharField | max_length=200 |
Description | description | TextField | None |
Price | price | DecimalField | max_digits=10, decimal_places=2 |
Category | category | ForeignKey to Category | on_delete=models.CASCADE |
Seller | seller | ForeignKey to User | on_delete=models.CASCADE |
Created At | created_at | DateTimeField | auto_now_add=True |
Card Name | card_name | CharField | max_length=255, null=True, blank=True |
Card Image URL | card_image_url | URLField | null=True, blank=True |
Sold | sold | BooleanField | default=False |
Represents an event with details such as title, description, date, and participants.
Name | Database Key | Field Type | Validation |
---|---|---|---|
Title | title | CharField | max_length=100 |
Description | description | TextField | None |
Date | date | DateTimeField | None |
Is Private | is_private | BooleanField | default=False |
Creator | creator | ForeignKey to User | on_delete=models.CASCADE |
Participants | participants | ManyToManyField to User | related_name='events_attending' |
Access Code | access_code | CharField | max_length=10, null=True, blank=True |
Comments | comments | ManyToManyField to Comment | blank=True, related_name='event_comments' |
has_already_passed()
: Returns True if the event date has already passed.Links users to events they are participating in.
Name | Database Key | Field Type | Validation |
---|---|---|---|
Event | event | ForeignKey to Event | on_delete=models.CASCADE |
User | user | ForeignKey to User | on_delete=models.CASCADE |
Represents a comment on an event.
Name | Database Key | Field Type | Validation |
---|---|---|---|
Event | event | ForeignKey to Event | on_delete=models.CASCADE |
User | user | ForeignKey to User | on_delete=models.CASCADE |
Text | text | TextField | None |
Created At | created_at | DateTimeField | auto_now_add=True |
__str__()
: Returns a formatted string representation of the comment.generate_access_code()
Generates a random access code consisting of 10 digits connected to the specific event.
python
def generate_access_code():
return ''.join(secrets.choice(string.digits) for _ in range(10))
Manual tests where done to make sure all user experience features work as intended.
Test Case | Description | Expected Outcome | Successful |
---|---|---|---|
See Public Events | User is able to view all the public events. | A list of public events is displayed. | ✅ |
Join Public Events | User can join a public event. | User is added to the event's participants. | ✅ |
Create Public Events | User can create a new public event. | A new public event is created and visible to all users. | ✅ |
Create Private Events | User can create a new private event. | A new private event is created and visible only to invited users. | ✅ |
Join Private Events with Access Code | User can join a private event with a valid access code. | User is added to the event's participants upon entering a valid access code. | ✅ |
See Messages Received | User can view all received messages. | A list of received messages is displayed. | ✅ |
See Messages Sent | User can view all sent messages. | A list of sent messages is displayed. | ✅ |
See Messages Archived | User can view all archived messages. | A list of archived messages is displayed. | ✅ |
See Messages Deleted | User can view all deleted messages. | A list of deleted messages is displayed. | ✅ |
Send New Messages | User can send new messages to other users. | The message is successfully sent and appears in the recipient's received messages. | ✅ |
Reply to Message in Conversation | User can reply to a message within a conversation thread. | The reply is successfully sent and appears in the conversation thread. | ✅ |
See Products for Sale | User can view all products for sale. | A list of products for sale is displayed. | ✅ |
See Which Products Are Sold | User can view all sold products. | A list of sold products is displayed. | ✅ |
See the Products You Have Put Up for Sale | User can view all the products they have put up for sale. | A list of the user's products for sale is displayed. | ✅ |
Create New Product Listing for Sale | User can create a new product listing for sale. | A new product listing is created and visible to all users. | ✅ |
Register as New User | User can register a new account. | A new account is successfully created for the user. | ✅ |
Sign In with Registered User | User can sign in with their registered account. | User is successfully signed in to their account. | ✅ |
Sign Out with Registered User | User can sign out from their registered account. | User is successfully signed out from their account. | ✅ |
To ensure the quality and readability of the Python code in this project, all Python files were checked with the PEP8 linter provided by Code Institute. This tool helps enforce the PEP8 style guide, which is widely accepted in the Python community for coding standards.
The PEP8 linter checks for issues like line lengths, whitespace usage, variable naming conventions, docstrings and more. The code in this project has passed the PEP8 linter test without any errors, which means that it adheres to these standards, making it easier to read and maintain.
You can check the PEP8 linter here: PEP8 linter
The CSS code in this project was tested using the W3C CSS Validator and passed without any errors.
The HTML code in this project was tested using the W3C HTML Validator and passed without any errors.
The site has been tested using Lighthouse and has achieved the following scores:
These scores indicate the site's high performance, accessibility, adherence to best practices, and search engine optimization.
The final version of the Full-Stack application was deployed to Heroku, while the database was deployed to ElephantSQL. This deployed version was thoroughly tested to ensure its functionality matches the version in the development environment.
Both the deployed and local versions were tested across various scenarios and functionalities as documented in this 'Testing' section. The tests confirmed that the deployed version of the application behaves as expected and mirrors the development version.
It's important to note that consistent code quality was maintained throughout the project. This was ensured by adhering to the PEP8 style guide, facilitated by the PEP8 linter provided by Code Institute.
For further details on the deployment process, refer to the 'Deployment' section below.
You find the deployed app here: LINK The app is deployed to Heroku and the database to ElephantSQL.
The project was deployed to Heroku using the below procedure:-
Go to ElephantSQL and create a new account.
Create a new instance of the database.
Select a name for your database and select the free plan.
Click "Select Region"
Select a region close to you.
Click "Review"
Click "Create Instance"
Click on the name of your database to open the dashboard.
You will see the dashboard of your database. You will need the URL of your database to connect it to your Django project.
Clone the repository.
git clone https://github.com/Mareliusmoen/varberg-games.git
Go to the varberg-games
directory.
cd varberg-games
(or your path to the project)Create a virtual environment.
python3 -m venv venv
source venv/bin/activate
Install all dependencies.
pip install -r requirements.txt
Create a env.py
file.
touch env.py
Add the following lines to env.py
:
import os
os.environ["SECRET_KEY"]
= your secret key.os.environ["DEBUG"]
= "True" or "False" depending on whether you are in development or production.os.environ["DEVELOPMENT"]
= "True" or "False" depending on whether you are in development or production.os.environ["ALLOWED_HOSTS"]
= your domain name.os.environ["DATABASE_URL"]
= your database url.Create and migrate the database.
python manage.py makemigrations
python manage.py migrate
Create the superuser.
python manage.py createsuperuser
Run the server.
python manage.py runserver
Access the website by the link provided in terminal. Add /admin/
at the end of the link to access the admin panel.
Recipient user autocomplete in new message form pushes all content to the left, I set display to none to hide the text but the div still pops in at the right side of the screen.
Unread message count as a integer in the messages text of the navbar button.
Undeleting messages after they have been deleted. The postman code provided did not pass the PEP8 linter so I needed to reformat parts of the code to fit the 79 character maximum per line, and I havent found the bug that causes this not function anymore.
Mark messages as read/unread. The postman code provided did not pass the PEP8 linter so I needed to reformat parts of the code to fit the 79 character maximum per line, and I havent found the bug that causes this not function anymore.
On certain screensizes the buttons for edit, and delete product are a little bit off vertically.
The hour and minute sliders of the datetimepicker are in some way hidden, you can click where they are supposed to be shown and it registers your choice, but the bars themselves are not visible.