Skip to content

Latest commit

 

History

History
305 lines (194 loc) · 7.08 KB

README.md

File metadata and controls

305 lines (194 loc) · 7.08 KB

quizoinator

Table of contents:

Description:

Quizoinator is divided into two modules: community portal and quiz portal. The community portal is a place where users can create posts, comment on them, like them and make relationships with other users. The quiz portal is a place where users can create quizzes and solve them. The application is written in Python using the Flask framework. The database used is sqlalchemy.

Technologies:

  • Python
  • Flask
  • SQLAlchemy
  • HTML
  • CSS
  • JavaScript
  • Bootstrap
  • Docker
  • Docker-compose

Setup

After successful setup, the application will be available at http://localhost:5000

Prerequisites:

Clone the repository

git clone https://github.com/KubiakJakub01/quizoinator.git 
cd quizoinator

Install python3:

  • Linux:
sudo apt install python3

For MacOS you can also use Homebrew:

brew install python3

For more information visit:

https://docs.python-guide.org/starting/install3/osx/

After installing python, make sure that it is added to the PATH. Check it by running the following command:

python3 --version

Install pip

Follow the instructions on: https://pip.pypa.io/en/stable/installation/ to install pip.

Docker (optional)

Follow the instructions on: https://docs.docker.com/get-docker/ to install docker.

With python virtualenv

Create a virtual environment and install the requirements:

Linux and MacOS

python3 -m venv .venv
source venv/bin/activate
pip install -r requirements.txt

Windows

python -m venv .venv
.\venv\Scripts\activate
pip install -r requirements.txt

Then run the application:

python3 app.py

With docker

Build the image:

docker build -t quizoinator .

Run the container:

docker run -p 5000:5000 -v ./instance:/app/instance -v ./src/static/user/images:/app/src/static/user/images quizoinator

With docker-compose

docker compose up

Fill the database with sample data (optional)

To fill the database with sample data, run the following script:

python3 feed_db_with_sample_data.py \
        [--db_url instance/database.db] \
        [--pictures_dir images/sample_avatars] \
        [--pictures_save_dir src/static/user/images] \
        [--posts_num 10] \
        [--comments_num 30] \
        [--likes_num 50] \
        [--relationships_num 20]

Screenshots

  1. Home page:

Home page

  1. Sign up page:

Click on the Sign up button in the navbar.

Sign up page

  1. Login page:

Click on the Login button in the navbar.

Login page

  1. User home page:

After successful login, you will be redirected to the user home page.

User profile page

  1. Update user profile page:

Click on the Update button in the navbar.

Update user profile page

  1. Browse blog:

Click on the Blog button in the navbar to browse the blog.

Evolved blog

Click on the View posts button to view blog.

Blog view

  1. Post view:

Click on the View or in the post title to view post.

Post view

  1. Like view:

Click on the likes text to view who liked the post.

Like view

  1. Add comment:

Write a comment and click on the Add button.

Write comment

Your comment will be added to the post.

Add comment

  1. Write post:

To write a post, click on the Blog -> Add post button in the navbar.

Write post

Write title, content and click on the Add button.

Add post

After adding the post, you will be redirected to the blog.

Added post

  1. Like post:

To like a post, click on the Like button.

Like post

  1. Search posts:

You can search posts by title or content.

Search posts

  1. Add friend:

To search for users write their username in the search bar.

Search users

Then click on the Search button. If the user exists, you will be redirected to his profile.

User view

You can send a friend request by clicking on the Add friend button.

Send friend request

You can view your friends by clicking on the Friends button in the navbar.

Friends view

  1. Friend request:

If someone sends you a friend request in Friends view you will see a notification. You can accept or reject the friend request.

Friend request

  1. Accepted friend request:

Accept friend request

  1. Admin panel:

To access the admin panel, you must be logged in as an admin.

Admin view

  1. Admin panel - users:

Admin users view

  1. Admin panel - admin users:

admin view admins

  1. Admin panel - add admin:

In the admin panel, you can add a new admin. Click on the Add admin button. Then write id of the user you want to add as an admin and click on the Add button.

Add admin

Added admin

After this new user will be able to access the admin panel.

Added admin view