Git Product home page Git Product logo

presto's Introduction

presto-q&a

Work done for a subject in Database and Web Applications Laboratory [LBAW] in MIEIC @FEUP, in collaboration with @cyrilico, @diogotorres97 and @Kubix20.

The Product

Presto is an online platform where people can ask questions and contribute with answers, developing a community of unique insights on a wide variety of topics.

Members can post questions associated with one or more topics, which other people may answer. Any member can reflect their opinion on the application’s content via commentaries (where it is possible to mention fellow members), ratings or both. Members are notified of activity that can be of their interest, such as questions from people they follow, upvotes on their content and mentions by other people. There is an advanced search feature where users can search for almost anything, with powerful filters and sorting options to better suit what one seeks. Each member has a score associated, built on his contributions to the community and others’ opinion on it.

More information here.

You can also checkout Presto's promotional video.

Development

APIs

Framework/Libraries

Technologies

  • PHP
  • HTML
  • CSS
  • JavaScript
  • PostgreSQL

Gallery



How to Run

Install dependencies and compile assets

$ composer install
$ npm install
$ npm run prod
$ php artisan clear-compiled
$ php artisan optimize

Run

$ docker-compose up
$ php artisan serve

Team

Name: GROUP1725

Theme: Collaborative Q&A

Elements:

presto's People

Contributors

antonioalmeida avatar cyrilico avatar dependabot[bot] avatar diogotorres97 avatar kubix20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bondeto

presto's Issues

Main feed queries

Top questions/answers (sorted by a weird score):
SELECT 'question', id, (((select count(*) from question_rating where question_id = question.id and rate = 1) + 1.9208) / ((select count(*) from question_rating where question_id = question.id)) - 1.96 * SQRT(((select count(*) from question_rating where question_id = question.id and rate = 1) * (select count(*) from question_rating where question_id = question.id and rate = -1)) / ((select count(*) from question_rating where question_id = question.id)) + 0.9604) / ((select count(*) from question_rating where question_id = question.id))) / (1 + 3.8416 / ((select count(*) from question_rating where question_id = question.id))) as score FROM question WHERE (select count(*) from question_rating where question_id = question.id) > 0 union SELECT 'answer', id, (((select count(*) from answer_rating where answer_id = answer.id and rate = 1) + 1.9208) / ((select count(*) from answer_rating where answer_id = answer.id)) - 1.96 * SQRT(((select count(*) from answer_rating where answer_id = answer.id and rate = 1) * (select count(*) from answer_rating where answer_id = answer.id and rate = -1)) / ((select count(*) from answer_rating where answer_id = answer.id)) + 0.9604) / ((select count(*) from answer_rating where answer_id = answer.id))) / (1 + 3.8416 / ((select count(*) from answer_rating where answer_id = answer.id))) as score from answer where (select count(*) from answer_rating where answer_id = answer.id) > 0 ORDER BY score DESC;

New questions/answers (sorted by date):
select 'question', id, "date" from question union select 'answer', id, "date" from answer order by "date" desc;

Recommended questions/answers (sorted by the weird score, filter results to only show posts from people the member follows):
SELECT 'question', id, (((select count(*) from question_rating where question_id = question.id and rate = 1) + 1.9208) / ((select count(*) from question_rating where question_id = question.id)) - 1.96 * SQRT(((select count(*) from question_rating where question_id = question.id and rate = 1) * (select count(*) from question_rating where question_id = question.id and rate = -1)) / ((select count(*) from question_rating where question_id = question.id)) + 0.9604) / ((select count(*) from question_rating where question_id = question.id))) / (1 + 3.8416 / ((select count(*) from question_rating where question_id = question.id))) as score FROM question WHERE (select count(*) from question_rating where question_id = question.id) > 0 and question.author_id in (select following_id from follow_member where follower_id = $USER_ID) union SELECT 'answer', id, (((select count(*) from answer_rating where answer_id = answer.id and rate = 1) + 1.9208) / ((select count(*) from answer_rating where answer_id = answer.id)) - 1.96 * SQRT(((select count(*) from answer_rating where answer_id = answer.id and rate = 1) * (select count(*) from answer_rating where answer_id = answer.id and rate = -1)) / ((select count(*) from answer_rating where answer_id = answer.id)) + 0.9604) / ((select count(*) from answer_rating where answer_id = answer.id))) / (1 + 3.8416 / ((select count(*) from answer_rating where answer_id = answer.id))) as score from answer where (select count(*) from answer_rating where answer_id = answer.id) > 0 and answer.author_id in (select following_id from follow_member where follower_id = $USER_ID) ORDER BY score DESC;

Cron tasks

Currently only have planned db tables clustering. Need anything else? Ask JCL

Report content check duplication

In cases where report for a given (user, content) already exists, do something -> return a pretty error? If the error is in the regular Laravel format, front end is already showing it

Remove rendering from cards

Explore the possibility of not rendering content as HTML in question (but mostly answer) cards, but instead as pure text, as it doesn't look good. Example:

Example

There is a quick easy way to do it, just pointing it out here so it's not forgotten.

DB enhancements

Member

  • New column: is_certified (not null, default false)
  • Unique index on lower(username)

Topic

  • Unique constraint on name

Flag members (for moderators)

Admin interface is done, only need to implement option for moderator (small popup when clicking in order to provide a reason and then send?)

A3 Milestones

Stuff to do

High priority - stuff reused in most pages

  • Finish navbar (add links to user dropdown, add search bar, add notifications preview example)
  • Finish questions/answers cards
  • Fix footer positioning and design - read here
  • Finish 'add question' popup

Medium priority

  • Dedicated sign up page
  • Dedicated login page
  • Dedicated about page
  • Admin page - manage users and moderators
  • Finish user page
  • Finish search page(s)

Low priority

  • Logged in version of feed
  • Define primary and secondary color

Can't think of anything else right now. Feel free to add more stuff, and to create separate issues for any of these topics so we can discuss them

Mentions on comments

  • check issue when the end of input is a mention
  • check a notifications error when adding a comment -> might be on my end

Close question

Add option to close a question -> user chooses a question?

Regex for form validation

Main ones:
Username - /^[a-zA-Z][\w-]{1,18}(?![-_])\w$/ (2-20 chars, must start with letter, can contain - or _ but not end with them)
Name = /^[a-z\s]+$/i
Password - /^(?=.*\d)(?=.*[a-zA-Z])(?=.*["-_?!@#+*$%&/()=])["\w\-?!@#+*$%&/()=]{8,32}$/ (8-32 chars, must contain at least one of each: number, letter, special char - ";-_?!@#+*$%&/()=)
Email - Usage of input type=email should be enough

Adding as necessary

Report content

Report is sent as notification to all moderators (pop up when clicking to report so as to be able to provide a reason for the report)

Delete content

VERY IMPORTANT: Confirmation pop up before deleting so user can confirm his action!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.