Skip to content

Architecture

Jakub Sykora edited this page Oct 20, 2024 · 48 revisions

Languages

  • Python
    • For backend development with Django
  • JavaScript
    • For frontend development with React
  • HTML
    • For structuring the web pages with React
  • CSS
    • For styling the web pages with React
  • SQL
    • For database queries, likely through PostgreSQL

Frameworks

  • Django (Python)

    • Django powers the backend, handling routing, data management, and server-side logic.
  • React (JavaScript)

    • React manages the frontend, enabling dynamic updates and interaction with user inputs.

APIs

  • Google Books API
    • The Google Books API provides access to book information, such as titles, authors, and cover images, to enhance the book search and display features of the application.

Package/Build Managers

  • pipenv (Python)

    • Manages Python dependencies and virtual environments, ensuring consistency across all development environments.
  • (Node Package Manager):

    • Handles JavaScript dependencies for the React frontend and facilitates running build scripts

What Each Person Will Work On

TBD

Deployment

  • Hosting Provider

    • We will deploy the application using Heroku. Heroku offers seamless integration with GitHub and supports easy scaling and management of web applications.
  • Automation

    • We will set up a CI/CD pipeline using GitHub Actions to automatically deploy to Heroku when code is pushed to the main branch. This ensures continuous integration and delivery, minimizing manual steps in the deployment process.
  • Scripts

    • Deployment scripts will handle tasks like database migrations, setting environment variables, and installing required dependencies. These scripts will automate the setup process, ensuring smooth and consistent deployment of new updates.

Are you using Virtual Machines or Containers?

  • No we do not plan on using VM's or containers

Is it a SPA or traditional? Or mix?

  • Our application will utilize a mix of a Single Page Application (SPA) and traditional web architecture. For dynamic features like book searches using the Google Books API, where results are displayed without full-page reloads, we utilize React, making this section behave like an SPA. This allows for fast, seamless updates as users interact with the app. However, for static pages or sections like account management or static content (e.g., help or about pages), we use Django's server-side rendering, which follows a more traditional approach.

List of URLs

  • URL: /Landing

    • Landing Page:
    • This is the opening page of the application. Users can either log in or create an account from this page.
  • URL: /CreateAccount

    • Create Account Page
    • This page allows users to create a new account by entering and confirming their email and password.
  • URL: /Login

    • Log In Page
    • This page is for existing users to log in to their accounts using their username or email and password.
  • URL: /Home

    • Home Page
    • After logging in, users are directed to the home page, which provides links to the main features of the app: discovering books, viewing a read list, accessing their personal profile, and the forums.
  • URL: Profile

    • Personal Profile Page
    • This page shows the user’s profile, displaying their bio, favorite books, ratings, and reviews. Users can also navigate to log out or the edit profile page from here.
  • URL: /Settings

    • Settings/Edit Profile Page
    • This page allows users to update their profile information such as name, email, password, bio, and favorite books. Users can also upload or delete their profile picture.
  • URL: /Books?genre=<genre-name>

    • Book Discovery Page
    • This page lists books based on the genre selected by the user. The query parameter genre= is used to display books from a specific genre like "Fantasy," "Romance," etc.
  • URL: /Books/<book-title>

    • Selected Book Page
    • This page is displayed when a user selects a specific book from the discovery page. It shows the book’s cover, a description, the author’s name and photo, and a carousel of recommended similar books.
  • URL: /Authors/<author-name>

    • Author Page
    • This page provides information about the author, including their photo, a short biography, and a list of their bestsellers.
  • URL: /Authors/<author-name>/Books

    • View All Books By Author Page
    • This page displays a collection of all the books written by the selected author, allowing users to browse through the entire list.
  • URL: /ReadList

    • Read List Page
    • This page allows users to view and manage their collections of books, organized by genre. It also shows progress tracking for each book in their list.
  • URL: /Forums

    • Forum Page
    • This page lists all the available forum discussions related to books, allowing users to browse and participate in discussions about their favorite books or authors.
  • URL: /Forums/<forum-id>

    • Specific Forum Topic Page
    • This page shows a specific forum topic with user responses and discussions, along with any relevant book recommendations related to the topic.

Database Schema

Users Table

  • id : A unique int that will distinguish each user from each other
  • username : A string that will be used to identify users on reading lists and forum posts
  • email : A string that holds the user's email address
  • password : A string that is the user's password
  • bio : A string that will hold a description of the user
  • profile_picture_url : A string that holds the URL of the user's profile picture
  • created_at : The time at which the user's profile was created (stored as seconds since Unix Epoch)

Authors Table

  • id : A unique int that distinguishes each author from each other
  • name : A string that contains the author's name
  • biography : A string that contains a description of the author
  • author_picture_url : A string that holds the URL for the author's profile picture
  • created_at : The time at which the authors profile was created (stored as seconds since Unix Epoch)

Books Table

  • id : A unique int that represents the book's ISBN-13 number
  • title : A string that holds the title of the book
  • genre : A string that holds the books listed genre's
  • author_id : An int that holds the author's unique id
  • cover_image_url : A string that holds the URL for the image of the book's cover
  • description : A string that holds the description of the book
  • published_date : The date that the book was first published

Reviews Table

  • id : A unique int that distinguishes each review from each other
  • user_id : An int that will hold the review writer's user id
  • book_id : An int that will hold the id of the book that the review is written for
  • rating : An int between 1 and 5 inclusive, that represents the rating that the reviewer is giving the book
  • review_text : A string that holds the review text
  • created_at : The time at which the review was created (stored as seconds since Unix Epoch)

Read List Table

  • id : A unique int that distinguishes each read list from each other
  • user_id : An int that will hold the read list creator's id
  • book_id : An int that will hold the id of the book at the top of the read list
  • progress : An int between 0 and 100 inclusive that represents the percentage of the book the user has read
  • added_at : The time at which the read list was created (stored as seconds since Unix Epoch)

Forums Table

  • id : A unique int that distinguishes each forum from each other
  • title : A string that holds the viewable title of a forum
  • description : A string that holds the description of a forum
  • created_at : The time at which the forum was created (stored as seconds since Unix Epoch)
  • created_by : An int that holds the forum creator's unique id

Forum Posts Table

  • id : A unique int that distinguishes forum posts from each other
  • forum_id : An int that holds the id of the forum that the post was posted under
  • user_id : An int that holds the id of the user that created the post
  • content : A string that holds the content of the post
  • created_at : The time at which the post was created (stored as seconds since Unix Epoch)

List of Common Queries

  • Get all books in a specific genre

    • SELECT * FROM books WHERE genre = 'Fantasy';
  • Get book details by title

    • SELECT * FROM books WHERE title = 'How to kill a mockingbird';
  • Find books by an author

    • SELECT books.*
    • FROM books
    • JOIN authors ON books.author_id = authors.id
    • WHERE authors.name = 'J.K. Rowling';
  • Get a user's read list

    • SELECT books.*
    • FROM read_list
    • JOIN books ON read_list.book_id = books.id
    • WHERE read_list.user_id = 1; (Replace 1 with the actual user ID)
  • Get reviews for a specific book

    • SELECT reviews.*, users.username
    • FROM reviews
    • JOIN users ON reviews.user_id = users.id
    • WHERE reviews.book_id = 1; (Replace 1 with the actual book ID)
  • Get forum discussions by title or keyword

    • SELECT * FROM forums WHERE title ILIKE '%discussion%';
  • Get posts in a specific forum

    • SELECT forum_posts.*, users.username
    • FROM forum_posts
    • JOIN users ON forum_posts.user_id = users.id
    • WHERE forum_posts.forum_id = 1; (Replace 1 with the actual forum ID)
  • Find all books by an author and their reviews

    • SELECT books.title, reviews.rating, reviews.review_text, users.username
    • FROM books
    • JOIN authors ON books.author_id = authors.id
    • JOIN reviews ON books.id = reviews.book_id
    • JOIN users ON reviews.user_id = users.id
    • WHERE authors.name = 'J.K. Rowling';
  • Get user profile details

    • SELECT * FROM users WHERE id = 1; (Replace 1 with the actual user ID)
  • Get all books with progress from a user's read list

    • SELECT books.title, read_list.progress
    • FROM read_list
    • JOIN books ON read_list.book_id = books.id
    • WHERE read_list.user_id = 1; (Replace 1 with the actual user ID)

Clone this wiki locally