Git Product home page Git Product logo

qpixel's Introduction


QPixel

Q&A by the community, for the community

CircleCI Build Status Coverage Status DOI

Rails-based version of our core software, powering codidact.com. Currently under active development towards MVP.

Table of Contents

Community

To discuss features and voice ideas, please ask a new question on Codidact Meta. For technical discussions about the QPixel software itself, please ask on Codidact Collab instead.

Contributing

Contributions are welcome - please read the CONTRIBUTING document before you start and look at the GitHub issues for things to do.

Installation

These instructions are assuming you already have a Unix environment available with Ruby and Bundler installed. WSL should work as well, but (core) Windows is unlikely to.

If you don't already have Ruby installed, use RVM or rbenv to install it before following these instructions.

Install prerequisites

For Debian-Based Linux:

sudo apt update
sudo apt install gcc
sudo apt install make
sudo apt install libmysqlclient-dev
sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev
sudo apt install mysql-server

For Arch-Based Linux:

sudo pacman -Syyu
sudo pacman -Sy gcc
sudo pacman -Sy make
sudo pacman -Sy ruby autoconf bison base-devel unixodbc
sudo pacman -Sy openssl
sudo pacman -S mariadb mysqld nodejs

For Mac:

xcode-select --install
brew install mysql bison openssl mysql-client
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"

1. Install JS runtime

If you already have Node.JS installed, you can skip this step. If not, download and install it.

2. Install Redis

If you haven't already got it, download and install Redis.

3. Install Imagemagick

If you haven't already installed Imagemagick, you'll need to install it for your system.

4. Download QPixel

Clone the repository and cd into the directory:

git clone https://github.com/codidact/qpixel
cd qpixel

5. Configure database connection

If you weren't asked to set the root MySQL user password during mysql-server installation, the installation is likely to be using Unix authentication instead. You'll need to sign into the MySQL server with sudo mysql -u root and create a new database user for QPixel:

CREATE USER qpixel@localhost IDENTIFIED BY 'choose_a_password_here';
GRANT ALL ON qpixel_dev.* TO qpixel@localhost;
GRANT ALL ON qpixel_test.* TO qpixel@localhost;
GRANT ALL ON qpixel.* TO qpixel@localhost;

Copy config/database.sample.yml to config/database.yml and fill in the correct host, username, and password for your environment. If you've followed these instructions (i.e. you have installed MySQL locally), the correct host is localhost or 127.0.0.1.

You'll also need to fill in details for the Redis connection. If you've followed these instructions, the sample file should already contain the correct values for you, but if you've customised your setup you'll need to correct them.

6. Set up QPixel

Install gems:

bundle install

Set up the database:

rails db:create
rails db:schema:load
rails r db/scripts/create_tags_path_view.rb
rails db:migrate

 You'll need to create a Community record and purge the Rails cache before you can seed the database. In a Rails console (rails c), run:

Community.create(name: 'Dev Community', host: 'localhost:3000')
Rails.cache.clear

7. Seed the database:

$ rails db:seed
Category: Created 2, skipped 0
[...]

Run the server!

rails s

8. Create admin account

You can create the first user account in the application, which should be running at http://localhost:3000/. To upgrade the user account to an admin account, run rails c for a console, followed by:

User.last.update(confirmed_at: DateTime.now, is_global_admin: true)

If you create more accounts, you can visit http://localhost:3000/letter_opener to see the emails that would otherwise be sent by QPixel.

9. Configure Categories

Before you try to create a post we need to configure categories! Go to http://localhost:3000/categories/

img/categories.png

Click "edit" for each category and scroll down to see the "Tag Set" field. This will be empty on first setup.

img/tagset.png

You will need to select a tag set for each category! For example, the Meta category can be associated with the "Meta" tag set, and the Q&A category can be associated with "Main"

img/tagset-selected.png

Make sure to click save for each one.
Note: You may need to run rails db:seed again.

10. Create a Post

You should then be able to create a post! There are character requirements for the body and title, and you are required at least one tag.

img/create-post.png

And then click to "Save Post in Q&A"

img/post.png

Install with Docker

See the README.md in the docker folder for complete instructions.

License

AGPL licensed.


⬆ Back to Top

qpixel's People

Contributors

archielecroy avatar artofcode- avatar b-istiak-s avatar boxedfruits avatar cellio avatar charliebrumbaugh avatar dani21 avatar dependabot[bot] avatar dyaskur avatar galegosimpatico avatar kevinmmansour avatar kritixilithos avatar luap42 avatar luong-komorebi avatar mattjbrent avatar meagar avatar mithrandir24601 avatar moshikoi avatar quartata avatar rahulsnkr avatar razetime avatar rhoxio avatar rileyradoll avatar sarahmccuan avatar sau226 avatar superplane39 avatar technohacker avatar trilarion avatar vsoch avatar yafdance avatar

Stargazers

 avatar  avatar

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.