IzzyLeech / terok-nor-station

0 stars 1 forks source link

Terok Nor Station

screenshot

Goal for this Project

My overall goal for my project is to create a fan website for Star Trek Deep Space Nine, where the user of the website can contribute to the development of the website by contributing data about the show. The user will be able to create an account so that they will be able to add, edit and delete information about the site and also be able to interact with other users of the website in the community section. The community section will be an open forum where user can discuss their enjoyment of the show and also give updates, and input on the development of the website. The project will also have a admin-section where the admin can approve or reject request from user to add, edit or delete information from the website.

Table of Contents

UX

A user of Terok Nor station could generally be a fan of Star Trek of all ages. It may be someone who wants to look up information about Deep Space Nine or someone who likes to gather information and create entries to the databases.

User Stories

Epic | Website Function

Epic | Community

Epic | Season

Epic | Episodes

Epic | Site Admin

User Requirements and Expectations

Requirements

Expectations

Wireframes

I have used Balsamic to develop my wireframes for my website. I initially created the mobile version and then the wireframes and then scalled it up for both tablet and desktop. I only created layout's for page that would require alot of content and would change amongst the different screen sizes. I decide not to include the admin-request page and the approve and reject page as they will stay the same on all page sizes

The wireframes are below:

Mobile Wireframe

Tablet Wireframe

Desktop Wireframe

\   Back to Top \  

Design Choices

Fonts

The font I have chosen are both from Google Fonts

The first font is Sono which will be the main font that will be seen throughout the website. It will be implemented on all font contnet. Reason from for picking this font is that it is clearly distinguishable from the header font that is very plain and simple as appose to Sono being a very striking font.

The second font is Merriweather which will be used on all header on the website. Reason for picking the font is mainly due to it plain and simplicity outlook when shown.

Colours

For choosing my Colors for the website I used ColorHexa and used to Muzli Colors to create a pallet of the colors.

The colors I choose

ColorPallet

Hex Value Root variable name Text Button Background Opposite Colour
#FF7A7A red X X black,
#00f600 green X black
#f8f8ff white X X black,
#d3d3d3 grey X black ,
#141414 black x X grey, white, red, green,

All of the desired colour combinations have passed the WebAIM Contrast Checker and the results can be seen below.

Colour 1 Colour 2 Results
red black result
green black result
white black result
grey black result

Images

I have included some images that will render from local files.

backgroundimage

welcome

debug

![]()

favicon

Structure

Modal Diagram

Diagram for the fan_database app

fan-modal

Diagram for the community app

community-modal

Models Info

Season Modal

Name Key Type Other Details
season_number IntegerField
start_date dateField
end_date dateField
episode_count IntergerField
image CloudinaryField "image", default='debug-image.jpg'
summary Textfield default='Enter an summary on what happen in the season'

Episode Modal

Name Key Type Other Details
overall_episode_number IntegerField
season_episode_number IntegerField
season FK(Season) on_delete=models.CASCADE
title CharField max_length=220
image CloudinaryField "image", default="debug-image.jpg", blank=True
synopsis TextField default="Enter synopsis for episode, keep it brief and in one paragraph"
plot TextField default="Write a detail description of the episode's plot, use multiple paragraphs"
air_date DateField
stardate DecimalField max_digits=6, decimal_places=1
updated DateTimeField auto_now=True
created DateTimeField auto_now_add=True
approved BooleanField default=False

EpisodeLog Modal

Name Key Type Other Details
episode FK(Episode) on_delete=models.CASCADE
user FK(User) on_delete=models.SET_NULL, null=True
timestamp DateTimeField auto_now_add=True
overall_episode_number IntegerField
season_episode_number IntegerField
season FK(Season) on_delete=models.SET_NULL
title CharField max_length=220
synopsis TextField
plot TextField default="Write a detail description of the episode's plot, use multiple paragraphs"
air_date DateField
stardate DecimalField max_digits=6, decimal_places=1
approved BooleanField default=False

ApprovalRequest Modal

Name Key Type Other Details
user FK(User) on_delete=models.CASCADE
object_to_approve FK(Episode) on_delete=models.SET_NULL
approved BooleanField default=False
reason TextField default="Enter inforamtion on the request"
request_type CharField max_length=10, choices=REQUEST_TYPES, Request_types = "approval", "edit", "delete"

CommunitySection model

Name Key Type Other Details
section CharField max_length=200

Post Modal

Name Key Type Other Details
created_by FK(User) on_delete=models.SET_NULL, null=True
section FK(CommunitySection) on_delete=models.SET_NULL, null=True
name CharField max_length=200
description TextField null=True, blank=False
created DateTimeField auto_now=True
updated DateTimeField auto_now_add=True
pinned BooleanField default=False
likes ManyToManyField User, blank=True, related_name='post_likes'
dislikes ManyToManyField User, blank=True, related_name='post_dislikes'

Comment Modal

Name Key Type Other Details
user FK(User) on_delete=models.SET_NULL, null=True
post FK(Post) on_delete=models.SET_NULL, null=True
body TextField
updated DateTimeField auto_now=True
created DateTimeField auto_now_add=True

App Flow

Non Register-User

non-register-user

Authenticated-User

authenticated-user

Admin

admin

\   Back to Top \  

Features

Existing Features

 

Features to be Implemented

As it a fandom encyclopedia of a show there are many extra features that I would like to add in the future.

\   Back to Top \  

Tools and Technologies used

Testing

Code Validation

HTML

I have used the HTML W3C Validator to validate all of my HTML files.

As my project uses Jinja syntax, such as {% for loops %}, {% url 'home' %}, and {{ variable|filter }} it will not validate properly if I copy and paste into the HTML validator straight from my source files.

In order to properly validate my HTML pages with Jinja syntax for authenticated pages, I followed these steps:

Page Screenshot Notes
Home screenshot Pass: No Errors
Season screeshot Pass: No Errors
Community screeshot Pass: No Errors
search query screeshot Pass: No Errors
post screeshot Pass: No Errors
post form screeshot Fail: All summernote errors
episode screeshot Pass: No Errors
episode form screeshot Fail: All summernote errors
delete screeshot Pass: No Errors
delete request screeshot Pass: No Errors
login screeshot Pass: No Errors
sign up screeshot Fail: 4 errors
admin request screeshot Pass: No Errors
approve edit screeshot Pass: No Errors
approve add screeshot Pass: No Errors
approve delete screeshot Pass: No Errors
reject edit screeshot Pass: No Errors
reject add screeshot Pass: No Errors
reject delete screeshot Pass: No Errors

CSS

I have used the recommended CSS Jigsaw Validator to validate my CSS file.

File Screenshot Notes
style.css screenshot Pass: No errors

Javascript

I have used the recommended JShint Validator to validate all of my JS files.

File Screenshot Notes
script screenshot Pass: No Errors

Python

I have used the recommended CI Python Linter to validate all of my Python files.

File Screenshot Notes
settings.py screenshot Pass: No Errors
urls.py (main) [screenshot](readmedoc/pythonlinter/url-main-linter.png Pass: No Errors)
forms.py (fan_database) screenshot Pass: No Errors
models.py (fan_database) screenshot Pass: No Errors
urls.py (fan_database) screenshot Pass: No Errors
views.py (fan_database) screenshot Pass: No Errors
forms.py (community) screenshot Pass: No Errors
models.py (community) screenshot Pass: No Errors
urls.py (community) screenshot Pass: No Errors
views.py (community) screenshot Pass: No Errors

Lighthouse Audit

I've tested my deployed project using the Lighthouse Audit tool to check for any major issues.

Page Size Screenshot Notes
Home Desktop screenshot No major warnings
Home Mobile screenshot No major Warnings
Season Destop screenshot No Major Warning
Season Mobile screenshot No Major Warning
Episode Desktop screenshot No Major Warning
Episode Mobile screenshot No Major Warning
Episde Form Desktop screenshot Minor Warnings due to summernote
Episde Form Mobile screenshot Minor Warnings due to summernote
Delete Request Desktop screenshot No Major Warning
Delete Request Mobile screenshot No Major Warning
Community Desktop screenshot No Major Warning
Community Mobile screenshot No Major Warning
Post Desktop screenshot No Major Warning
Post Mobile screenshot Minor Warnings
Create Post Desktop screenshot Minor Warnings
Create Post Mobile screenshot Minor Warnings
Delete Desktop screenshot No Major Warning
Delete Mobile screenshot No Major Warning
Admin Request Desktop screenshot No Major Warning
Admin Request Mobile screenshot No Major Warning
Add Approve Desktop screenshot No Major Warning
Add Approve Mobile screenshot Minor Warnings
Edit Approve Desktop screenshot No Major Warninga
Edit Approve Mobile screenshot Minor Warnings
Delete Approve Desktop screenshot No Major Warnings
Delete Approve Mobile screenshot Minor Warnings
Add Reject Desktop screenshot No Major Warnings
Add Reject Mobile screenshot Minor Warnings
Edit Reject Desktop screenshot No Major Warnings
Edit Reject Mobile screenshot Minor Warnings
Delete Reject Desktop screenshot No Major Warnings
Delete Reject Mobile screenshot Minor Warnings
Search Desktop screenshot No Major Warnings
Search Mobile screenshot No Major Warnings
Sign In Desktop screenshot No Major Warnings
Sign In Mobile screenshot No Major Warnings
Register Desktop screenshot No Major Warnings
Register Mobile screenshot No Major Warnings

Defensive Programming

Defensive programming was manually tested with the below user acceptance testing:

Page User Action Expected Result Pass/Fail Comments
Home Page
Click on Logo in the navbar Redirects to Home page Pass
Click on Login link in the navbar Redirects to Sign In Page Pass
Click on logout link in navbar Redirects to Sign In Page Pass
Click on sign up link in the community info Redirects User to Register Page Pass
Click on Home link in the navbar Redirects to Home page Pass
Click on a Season of the show link in the navbar Redirects to the season of the show Pass
Click on the community link in the navbar Redirects to the community page Pass
Click the twitter icon in footer Redirect to the twitter home page Pass
Click the youtube icon in footer Redirect to the youtube home page Pass
Click the instagram icon in footer Redirect to the instagram home page Pass
Enter a valid search queary Redirects to the search page with result Pass
Enter a nonvalid search queary Redirects to the search page with no result found message Pass
As admin click on Admin request list Redirects to the Admin request page Pass
Sign Up
Enter valid email address Field will only accept email address format Pass
Enter valid password (twice) Field will only accept password format Pass
Click already have an account link Redirects to sign in page Pass
Log In
Enter valid password Field will only accept password format Pass
Click Login button on login page Redirects user to Home page Pass
Click don't have a account link Redirects to login page Pass
Season Page
Click Next Season link in the infobox Redirects user to the next season of the show Pass
Click Add Episode Button Redirects user to the episodes form page Pass
Click Episode Title Redirects the user to the episdoe page of that episode Pass
Click Edit Episode button Redirects to the form of that episode Pass
Click Delete Episode button Redirects to the delete request page Pass
Add Episode Page
Click Create Episode button with all fields inputted Redirects to the Season that was filled out on the form Pass Messages of Your request to add an episode has been submitted. is placed underneath the Add Episode button
Click Create Episode button with all fields inputted except the Imagefield Redirects to the Season that was filled out on the form Messages of Your request to add an episode has been submitted. is placed underneath the Add Episode button
Click Create Episode button with Overall episode number not filled out Message of please fill out field Pass
Click Create Episode button with Season episode number not filled out Message of please fill out field Pass
Click Create Episode button with Season not selected Message of please select item Pass
Click Create Episode button with Title not filled out Message of please fill out field Pass
Click Create Episode button with Air date not filled out Message of please fill out field Pass
Click Create Episode button with Stardate not filled out Message of please fill out field Pass
Click Create Episode button with Reason not filled out Message of please fill out field Pass
Click Create Episode button with Plot not filled out Message of please fill out field Pass
Click Create Episode button with Plot filled with whitespace Message of please fill out field Pass
Click Create Episode button with Synopsis filled with whitespace Message of please fill out field Pass
Click Create Episode button with Synopsis filled not filled out Message of please fill out field Pass
Click the go back button redirects the user back to where they click the create episode button Pass
Update Episode Page
Click Create Episode with the reason field not filled out Message of please fill out field Pass
Click Create Episode button with all fields inputted Redirects to the Season that was filled out on the form Pass Messages of Your request to edit an episode has been submitted. is placed underneath the Add Episode button
Click Create Episode button with all fields inputted except the Imagefield Redirects to the Season that was filled out on the form Messages of Your request to edit an episode has been submitted. is placed underneath the Add Episode button
Click Create Episode button with Overall episode number not filled out Message of please fill out field Pass
Click Create Episode button with Season episode number not filled out Message of please fill out field Pass
Click Create Episode button with Season not selected Message of please select item Pass
Click Create Episode button with Title not filled out Message of please fill out field Pass
Click Create Episode button with Air date not filled out Message of please fill out field Pass
Click Create Episode button with Stardate not filled out Message of please fill out field Pass
Click Create Episode button with Plot not filled out Message of please fill out field Pass
Click Create Episode button with Plot filled with whitespace Message of please fill out field Pass
Click Create Episode button with Synopsis filled with whitespace Message of please fill out field Pass
Click Create Episode button with Synopsis filled not filled out Message of please fill out field Pass
Click the go back button redirects the user back to where they click the create episode button Pass
Delete Episode Page
Click Yes send request with reason field filled out Redirects to the Season that was filled out on the form Pass Messages of Your request to delete an episode has been submitted. is placed underneath the Add Episode button
Click Yes send request with reason field not filled out or with white space message displayed Please enter a reason for deletion Pass
Click the go back button Redirects to the season page where the Delete episode button was clicked Pass
Community Page
Click the Show Discusion link All post that have the show discussion section tags will be displayed only Pass
Click the All link All post will be displayed Pass
Click the Site Development link All post that have the site development section tag will be displayed only Pass
Click the Create Post button Redirect to the create post page Pass
Click the Edit Post button of a post Redirects to that post's data Pass
Click the Delete Post button of a post Redirects to the delete page Pass
Click the Post title link Redirect to the post page Pass
As user with delete perms click the delete post button Redirects to the delete page Pass
Post Page
Click the like button Like button turns green and the number counter adds 1 Pass
Click the dislike button Dislike button turn red and the number counter adds 1 Pass
Click the like button when the dislike button has been clicked before Like button turns Green number counter adds 1 and the dislike button turns grey and the number counter subtract one Pass
Click the dislike button when the like button has been clicked before dislike button turns red number counter adds 1 and the like button turns grey and the number counter subtract one Pass
Click the submit button when there is no input in the textfield An alert message is displayed with the comment PLease enter a comment Pass
Click the submit button when there is whitespace in the text field An alert message is displayed with the comment PLease enter a comment Pass
Click the submit button when there is text in the text field The comment should render in beneath the textfield Pass
Click the delete comment button on a comment in the comments Redirect to the delete page Pass
Delete Comment Page
Click the confirm button redirect to the post and the comment is deleted Pass
Click the go back button redirect to the post Pass
Edit Post Page
Click the create Post button when no data has been changed Validation error message will show displaying You haven't made any changes to the post Pass
Click the create post button when data has changed Redirect to the community page and the changes have been saved Pass
Click the go back button Redirect to the community page Pass
Create Post Page
Click the create post button with data entered Redirects to the community page with the post saving Pass
Click the create button with section not picked Alert to pick a item in the section Pass
Click the create button with Name not entered or whitespace enter Alert to enter a name in the field Pass
Click the create button with description not entered or whitespace enter Alert to user this field is required Pass
Click the create button with the pinned button selected Post will be pinned to the top of post Pass
Click the go back button redirect the user back to the community page Pass
Admin Page
Click on the approve delete request button redirect to the approve delete request page Pass
Click on the approve add request button redirect to the approve add request page Pass
Click on the approve edit request button redirect to the approve edit request page Pass
Click on the reject edit request button redirect to the reject edit request page Pass
Click on the reject add request button redirect to the reject add request page Pass
Click on the reject delete request button redirect to the reject delete request page Pass
Approve Delete request page
Click on Yes Approve button Redirect to the admin-request page and delete the episode Pass
Click on the No, go back button Redirect to the admin-request page Pass
Reject Delete request page
Click on Yes reject button Redirect to the admin-request page and keeps the episode Pass
Click on the No, go back button Redirect to the admin-request page Pass
Approve add request page
Click on Yes Approve button Redirect to the admin-request page and add the episode Pass
Click on the No, go back button Redirect to the admin-request page Pass
Reject add request page
Click on Yes reject button Redirect to the admin-request page and delete the episode that was submitted Pass
Click on the No, go back button Redirect to the admin-request page Pass
Approve edit request page
Click on Yes Approve button Redirect to the admin-request page and add the edited episode Pass
Click on the No, go back button Redirect to the admin-request page Pass
Reject edit request page
Click on Yes reject button Redirect to the admin-request page and delete the edited episode Pass
Click on the No, go back button Redirect to the admin-request page Pass

 

User Story Testing

The following are user stories I've implemented with screenshots to prove

User Story Screenshot
As a Site User I can create an account so that I can participate in the development of the fan database. screenshot
As a Site User I can use a navigation bar so that I can transverse to a different section of the website screenshot
As a Site User I can be able to add information about my Star Trek DS9 so that so that I can share my knowledge and insights with other fans. screenshot
As a Site User I can be able to edit information about Star Trek DS9 so that so that I can make sure mistakes can be changed and that the information is correct for other users. screenshot
As a Star Trek DS9 fan I can find information on specific episodes so that I can improve my knowledge of the show. screenshot
As a Star Trek DS9 I can interact with other fans of the show so that that we can discuss the show screenshot
As a Site User I can post entries in the community section so that I create an opportunity to interact with other members of the community screenshot
As a Site User I can delete my post in the community section so that I can have that access to not show the post. screenshot
As a Site Admin I can approve of information that is being sent to the database so that the information is correct and relevant to Star Trek DS9 screenshot
As a Site User I can access the links to social media of the website so that I can stay updated on the going on of the website screenshot
As a Site User I can like or unlike a post in the community section so that I can favorite content that I like screenshot
As a Site User I can comment on posts in the community section so that I can discuss with other members of the community and also give information on the development of the database. screenshot
As a Site User I can have the ability to log out of my account so that I am not currently always sign in. screenshot
As a User I can select a specific season of the show so that I can view the data of that season screenshot
As a User I can have access to a search bar so that I can quickly find the information that I am looking for. screenshot
As a User I can delete a comment in a post so that it doesn't exist anymore and can't be viewed screenshot
As an Admin I can assign permission to users so that they can become moderator, that will be grant special permissions screenshot
As an Admin I can see all the delete requests so that I can monitor how many requests there are screenshot
As a Site Admin I can see all the add requests so that I monitor how many add request their is to the database screenshot
As an Admin I can see all the requests for edits so that I can see what has been requests for approval or reject screenshot
As a Site Admin I can pin posts to the top of the order of posts so that other users can see a post of important screenshot
As a Site User I can Dislike/Undislike posts so that I can Dislike content I don't like screenshot
As an Admin I can approve and reject requests to add episodes to the database so that I can have final say on if the episode is suitable to be submitted screenshot
As an Admin I can approve and reject requests to add episodes to the database so that I can have final say on if the episode is suitable to be submitted screenshot
As an admin I can approve or reject requests for edits of episodes so that I can confirm if the edit is correct screenshot
As an admin I can approve or reject requests for edits of episodes so that I can confirm if the edit is correct screenshot
As a Admin I can approve or reject delete quests so that I can control what is being deleted from the database screenshot
As a Admin I can approve or reject delete quests so that I can control what is being deleted from the database screenshot

Open Issues

The following are user stories I wasn't able to implement but could be added with more time

User Story Screenshot
As a Fan of Star Trek I can be able to search the site's database for specific information about characters so that I can learn more about the show

Bugs

Bug Status
When the user clicks to make a delete requests, on the delete request page the go back button will not bring the user back until the reason field is inputted Closed
Currently the delete but is not show for a user who has perms to delete post in the community section Closed
when a user is not signed in, the first post will be in position but all the other post will stack on top of each other in a column Closed
Javascript for decription field not working due to summernote Closed
Rejecting delete request Closed
Redirect not working after creating, editing and deleting an episode Closed
[]()

Unfixed Bugs

Bug Note
Summernote field for description in post form
Summernote Field for plot in episode form.
Image field will not save file that is inputted Alternative for this problem image will be inputted by admin in the Admin panel

\   Back to Top \  

Deployment

The live deployed application can be found deployed on Heroku

ElephantSQL Database

This project uses ElephantSQL for the PostgreSQL Database.

To obtain your own Postgres Database, sign-up with your GitHub account, then follow these steps:

Cloudinary API

This project uses the Cloudinary API to store media assets online.

To obtain your own Cloudinary API key, create an account and log in.

Heroku Deployment

This project uses Heroku, a platform as a service that enables developers to build, run, and operate applications entirely in the cloud.

Deployment steps are as follows, after account setup:

Key Value
CLOUDINARY_URL insert your own Cloudinary API key here
DATABASE_URL insert your own ElephantSQL database URL here
DISABLE_COLLECTSTATIC 1 (this is temporary, and can be removed for the final deployment)
SECRET_KEY this can be any random secret key
PORT 8000

Heroku needs two additional files in order to deploy properly.

You can install this project's requirements (where applicable) using:

If you have your own packages that have been installed, then the requirements file needs updated using:

The Procfile can be created with the following command:

For Heroku deployment, follow these steps to connect your own GitHub repository to the newly created app:

Either:

Or:

The project should now be connected and deployed to Heroku!

Local Deployment

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.

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("CLOUDINARY_URL", "insert your own Cloudinary API key here")
os.environ.setdefault("DATABASE_URL", "insert your own ElephantSQL database URL here")
os.environ.setdefault("SECRET_KEY", "this can be any random secret key")
# local environment only (do not include these in production/deployment!)
DEVELOPMENT = "1"

Once the project is cloned or forked, in order to run it locally, you'll need to follow these steps:

Cloning

You can clone the repository by following these steps:

  1. Go to the GitHub repository
  2. Locate the Code button above the list of files and click it
  3. Select if you prefer to clone using HTTPS, SSH, or GitHub CLI and click the copy button to copy the URL to your clipboard
  4. Open Git Bash or Terminal
  5. Change the current working directory to the one where you want the cloned directory
  6. In your IDE Terminal, type the following command to clone my repository:
    • git clone https://github.com/IzzyLeech/terok-nor-station
  7. Press Enter to create your local clone.

Alternatively, if using Gitpod, you can click below to create your own workspace using this repository.

Open in Gitpod

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.

Forking

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:

  1. Log in to GitHub and locate the GitHub Repository
  2. At the top of the Repository (not top of page) just above the "Settings" Button on the menu, locate the "Fork" Button.
  3. Once clicked, you should now have a copy of the original repository in your own GitHub account!

\   Back to Top \  

Credits

\   Back to Top \