MBilalQureshi / versus-drf-m5

0 stars 1 forks source link

Versus

Versus is a product comparison website where users can post items to find out more about them from other users' points of view.

On this platform, users can show their passion for how they feel towards specific products. They can upvote or downvote it or indulge themselves in discussing these products.

So, to enjoy full features simply register yourself and sign in to the world of Versus.

Site Mockup

The live site can be found here - Versus

Table of Contents

Table of contents generated with markdown-toc

Other .md file links

Frontend Testing

Navigate to the FRONTEND TESTING README file.

Backend

Navigate to the BACKEND README file.

User Experience (UX)

A visitor to Versus is most probably someone who wants to buy a product and post that product just to find what others think about that product, is it worth buying or if that product information is already there that visitor could get exact information by viewing the post.

EPIC: User Profiles

The milestone is about user profiles. Their number of up/down votes, number of posts and all the posts.

User Stories

Future Release User Story

EPIC: Home Posts Page, Trending and Voted

A list of posts will be shown on this page and users will be able to search for posts based on title, username, price, and category. Almost the same tasks will be performed on these three pages. A list of popular profiles based on the highest number of upvotes can also be seen.

User Stories

EPIC: Post Page

This epic handles a single post data and content in it such as votes, comments, and image profile of the user who posted it.

User Stories

EPIC: Users Comments

The user can comment on posts, and edit or delete their comments. The user is also able to view other post

User Stories

EPIC: Create Post

Users can create posts in which they can add an image, content add a post title set its category and price.

User Stories

EPIC: User Navbar

Users can interact with the nav bar icons and redirect to other web pages. Users can also sign out by clicking its icon.

User Stories

EPIC: Sign-in/ Sign-up

This milestone covers Signup/ Sign-up.

User Stories

Agile Methodology

GitHub Projects was used to manage the development process using the agile approach. To ensure streamlined organization, all User Stories were grouped into Milestones, representing the corresponding Epics, following the MOSCOW prioritization technique. For a comprehensive overview of the project's progress and workflow, I invite you to explore our dynamic Kanban board. here.

The user stories seen above are based on the items mentioned on the project board.

Design

The design of this website is very simple yet elegant and the color scheme gives a very relaxing vibe to attract more users.

Color Scheme

The color palette is generated using COOLORS.

Color Palette

The color scheme of the website gives a very good contrast after placing the main items on the web page and the main purpose of this color scheme is to give effect of an enthusiasm to the site users.

Imagery

All the images are fetched from the Cloudinary database except sign-in and sign-up which are fetched from online sources. Read the credits for more details.

Wireframes

Landing Page The landing page shows public posts even when the user is still not logged in. Once logged in user can also view the most trending posts based on up votes and also voted section which contains all the posts on which the user had voted. ![Landing Page](docs/wireframes/home_trending_voted.png)
Product Post Page All the data related to a single post is shown here and also once the user has logged in, the user can comment or vote on the post directly from here. ![Product Post Page](docs/wireframes/post_comment.png)
Add Post Page Users can create a post on products via this page. Rules are also mentioned here. ![Add Post Page](docs/wireframes/add_post.png)
Profile Page User can make all sorts of changes to their profile from here once logged in. All the posts are also present here on the profile page. ![Profile Page](docs/wireframes/profile.png)
Sign in Page Users access all the features of the website once signed in via this page. ![Sign in Page](docs/wireframes/signin.png)
Sign up Page New users can sign up from here to access the website all features. ![Sign up Page](docs/wireframes/signup.png)

Fonts

DM Sans is the primary font for this website, secondary font is set to sans-serif.

Testing

Testing and results can be found here

Security Features and Defensive Design

Custom error 404 page:

Custom page 400 Bad request page is added in case the user tries to enter invalid URLs.

Form Validation

Features

Header

header

Logo

Home Page

Home Page

Search Bar

Search Bar

Most Up Voted Profiles

Most Up Voted Profiles

Category List

Category List

Add Post Page

Add Post Page

Edit Post Page

Edit Post Page

Trending Page

Trending Page

Voted Page

Voted Page

Profile Page

Profile Page

Edit Profile Page

Edit Profile Page

Change Password Page

Change Password Page

Change Username Page

Change Username Page

Comment Section

Comment Section

Edit Comment

Edit Comment

Sign Up Page

Sign Up Page

Sign in Page

Sign in Page

Sign out Modal, Model # 1

Sign out Modal

Post Creation Rules, Model # 2

Post Creation Rules model

Website rules modal on Sign Up, Model # 3

Website rules modal on Sign Up

Reusable React Components

Asset

Asset component is used in many parts of the website before content is loaded. It had three parts mentioned below.

Avatar

Avatar acts as the user's image which is mostly beside usernames. This component sets the following.

Modal Handler

This shows and closes the data inside a modal.

More Dropdown

This component provides the following options to users

Libraries and Technologies Used

Languages

Frameworks - Libraries - Programs Used - Packages Used

Deployment

Combining existing DRF and React projects into the same workspace

  1. I used the link mentioned below to make a unified react and DRF application.

  2. Add in axiosDefaults.js to make unified projects work.

axios.defaults.xsrfCookieName = 'csrftoken';
axios.defaults.xsrfHeaderName = 'X-CSRFTOKEN';

Ready unified DRF and React before deployment

The below link explains the steps to take before deployment to Heroku.

Heroku

The site was deployed using Heroku and the live site can be found here: Versus. Note: Make sure to set DEBUG to False before deployment.

  1. Before actual deployment use Heroku "pip freeze > requirements.txt" on the Gitpod console. This will add all the dependencies in the requirements.txt file which will be needed by Heroku later during deployment.
  2. Log in to Heroku.
  3. On the main page there is an option to create a new app, click it.
  4. Enter a unique application name and select your region.
  5. Click on the Create App button.
  6. Click settings and select Config Vars.
  7. Click Reveal Config Vars enter the Key as "ALLOWED_HOST" and Value as "versus-bac55e8730b2.herokuapp.com" and press the add button.
  8. Add CLOUDINARY_URL as another config var and click add.
  9. Next, add Postgres DATABASE_URL and click add.
  10. After that add Django project SECRET_KEY.
  11. Same way Set DISABLE_COLLECTSTATIC to 1 and click add.
  12. Add two more of them as CLIENT_ORIGIN, CSRF_TRUSTED_ORIGINS and set values to "https://versus-bac55e8730b2.herokuapp.com"
  13. Go to the top of the page and select the deploy option.
  14. Select Github as the deployment method.
  15. Confirm to connect with GitHub and authorize Heroku from Github.
  16. In the search bar type the repository name and click the connect button.
  17. Scroll to the bottom of the deploy page and either click Enable Automatic Deploys for automatic deploys or Deploy Branch to deploy manually. Manually deployed branches will need re-deploying each time the repo is updated.
  18. Click View to view the deployed site.

Forking the GitHub Repository

With Forking one can make a copy of a repository and view or make changes in it without affecting the original repository. Following are the steps to do this.

  1. Log in to GitHub and locate Versus repository.
  2. At the top right side of the page just below the navigation bar, locate the fork button.
  3. You will now have a copy of the repository.

Making a Local Clone

  1. Log in to GitHub and locate Versus repository.
  2. Just below the repository name, click "Code".
  3. There is an option to copy the HTTPS link. Press the copy icon.
  4. Open Git Bash on the local machine.
  5. Change the current working directory to the location where we want the cloned directory to be made.
  6. Type git clone on bash and paste the HTTPS URL we copied earlier.
  7. Press Enter. local clone will be created.

Credits

Code

Media

pexels helped a lot in finding the product images mentioned below.

Images List by pexels - [Image 1](https://www.pexels.com/photo/assorted-color-bubble-jackets-hanged-16170/) - [Image 2](https://www.pexels.com/photo/assorted-gold-plated-table-figurines-1099816/). - [Image 3](https://www.pexels.com/photo/blue-glass-vase-220987/) - [Image 4](https://www.pexels.com/photo/green-plant-in-close-up-photography-13521384/) - [Image 5](https://www.pexels.com/photo/assortment-of-colorful-guns-for-game-5217754/) - [Image 6](https://www.pexels.com/photo/cactus-in-brown-vase-1302305/) - [Image 7](https://www.pexels.com/photo/car-interior-of-tesla-17345646/) - [Image 8](https://www.pexels.com/photo/space-gray-iphone-8-818043/) - [Image 9](https://www.pexels.com/photo/silver-iphone-on-a-green-grass-191841/) - [Image 10](https://www.pexels.com/photo/photo-of-a-gray-dell-laptop-displaying-pexels-webpage-811587/) - [Image 11](https://www.pexels.com/photo/woman-printing-photos-on-paper-while-forking-at-home-7014397/) - [Image 12](https://www.pexels.com/photo/person-holding-pringles-potato-chips-bottle-1450480/) - [Image 13](https://www.pexels.com/photo/ikea-showroom-of-bedroom-11244064/) - [Image 14](https://www.pexels.com/photo/a-person-holding-colgate-toothpaste-box-5612670/) - [Image 15](https://www.pexels.com/photo/gold-global-plates-342945/) - [Image 16](https://www.pexels.com/photo/box-of-soap-near-jar-17596996/) - [Image 17](https://www.pexels.com/photo/hair-treatment-bottles-in-box-on-table-17576517/)

Acknowledgments

Back to top