read-district

Read District

Read District

This website provide book reviews and recommendation. You can write your personal review and read review of other users. Here you can find a selection of great book you’ll love.


Contents


UX

UX (User Experience)

Project Goals

The goal of this project is to build a website, using backend knowledge, to allows users to read book reviews created by other registered users and write book reviews.

The features on the website will:

I achieve this by:

User Goals

User Stories

New Site Visitor

Returning Site Visitor

Site Owner Goals

Back to contents


Design Choices

Fonts

The main font I’ve chosen is Crimson Pro, is an antique-classic looking font that fit well with all type of books. It is sober and elegant.
Is easy to read even using small font sizes.

Colours

I’ve chosen for the backbround a color similar to the old paper, and a lighter tone for the serach bar and the cards. Instead of a white background I wanted a warmer and relaxing color for the eyes. I used strong accent of colors for text messages and buttons, because their function is to attract the attention.

Colour Palette

Wireframes

I designed the mock-ups of the website using Figma.

I designed the pages having in mind cards and forms from previous projects. This design works well with responsive behaviours. The final result is slightly different, mostly improved by icons and organic repetition in the style.

Back to contents


Technologies Used

Languages

Database

Libraries

Tools

Back to contents


Features

Existing Features

Additional Site features

HTTP 404 Error

Future Features

Backend Design

Site Construction

Topology

Responsive Navbar

Page of the Book Reviews

Book Page

Add Review Page

Edit Review Page

Register Page

Login Page

Profile Page

CRUD Functionality

Site Page Create Read Update Delete
Book Review   All book reviews    
Book Page   Single book review   Delete single review
Add Review Created book review      
Edit Review   Single book review Update single book review  
Register Add new user      
Log In   User details    
Profile   User details    

User Messages

Defensive Programming

Database Design

users collection

Field Description Collection Key Data type Default Value
Unique ID _id ObjectId  
Username username string  
Password Hashed password string  
Email email string  

reviews collection

Field Description Collection Key Data type Default Value
Unique ID _id ObjectId  
Book Title title String  
Book Author author String  
Number of Pages number_pages integer  
Genre Category genre string  
Book Review Text review string  
Book Cover Image URL image_url string  
Created By: User create_by string username

Back to contents


Project Management

Back to contents


Version Control

Gitpod Workspaces

  1. In your GitHub repository click on the Gitpod button to start the workspace.
  2. Gitpod loads the online IDE editor window, you are ready to code.

Update Repository

Back to contents


Testing

Back to contents


Deployment

The website was developed using Git pushed to GitHub, which hosts the repository.

How to run this project locally

To run this project locally you will need the following tools installed on your system:

Instruction

  1. Navigate to the GitHub repository https://github.com/NicolaLampis/read-district .
    • click the Code button, then “download zip” to have a copy stored in you machine.
      • Unzip the repository into the chosen folder, open with your favourite IDE.
    • click the Code button, copy the URL.
      • Having Git installed on your system, you can clone the repository with the following command.
        git clone https://github.com/NicolaLampis/read-district
        
  2. If possible open a terminal session in the unzip folder or cd to the correct location.

  3. Create a virtual environment with the command:
    python -m .venv venv
    

    NOTE: Your Python command may differ, such as python3 or py

  4. Activate the .venv with the command:
    .venv\Scripts\activate
    

    This command may differ depending on your operating system, please check the Python Documentation on virtual environments for further instructions.

  5. Install all required modules with the command:
    pip -r requirements.txt.
    
  6. Create the env.py file.
    • In order to set the default environment variables env.py file should contain at least the following information: ``` import os

os.environ.setdefault(“IP”, “0.0.0.0”) os.environ.setdefault(“PORT”, “5000”) os.environ.setdefault(“SECRET_KEY”, “YOUR_OWN_VALUE”) os.environ.setdefault(“MONGO_URI”, “YOUR_OWN_VALUE”) os.environ.setdefault(“MONGO_DBNAME”, “YOUR_OWN_VALUE”)

- Replace "YOUR_OWN_VALUE" with the correct values.
- ***Important:*** Add the `env.py` file to your `.gitignore` file before pushing your files to any public git repository.
- A .gitignore file specifies intentionally untracked files that Git should ignore. In this way your sensible data remain secret and invisible.

7. You can run the application with the command:

python app.py ```

  1. You can visit the website at http://127.0.0.1:5000

Create the database in MongoDB

Deploy to Heroku

  1. Create a requirements.txt file using the terminal command pip freeze > requirements.txt.

  2. Create a Procfile with the terminal command echo web: python app.py > Procfile.

  3. Perform commands git add and git commit for both requirements and Procfile, ,then git push the project to GitHub.

  4. Create a new app on the Heroku website by clicking the “New” button in your dashboard. Give it a name and set the nearest region to you.

  5. From the heroku dashboard, click on “Deploy” > “Deployment method” and select GitHub.

  6. Link the heroku app to the correct GitHub repository.

  7. In the heroku dashboard, click on “Settings” > “Reveal Config Vars”. Insert the following KEY and VALUE:

Key Value
IP 0.0.0.0
PORT 5000
SECRET_KEY put_your_personal_secret_key
MONGO_URI mongodb+srv://root: your_root_password @myfirstcluster.iixj3.mongodb.net/ your_database_name ?retryWrites=true&w=majority
MONGO_DBNAME put_the_database_name
  1. Select deploy branch Master.

  2. Click Open App in Heroku to launch the App in a new browser window.

Back to contents


Credits

Images

Inspiration

Acknowledgements