GithubHelp home page GithubHelp logo

global-localhost / community-platform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from duckduckgo/community-platform

0.0 0.0 0.0 28.09 MB

DuckDuckGo Community Platform

Home Page: https://duck.co/

License: Other

Perl 29.09% JavaScript 31.42% CSS 9.94% Shell 0.21% HTML 1.64% Lua 0.02% PLpgSQL 10.76% Raku 1.10% SCSS 9.83% Handlebars 5.98%

community-platform's Introduction

DuckDuckGo - Community Platform

This is the source code for the DuckDuckGo Community Platform at duck.co

Requirements / Installation

The DuckDuckGo Community Platform is built on Perl, Catalyst, DBIx::Class, Text::Xslate and Dancer2.

Requires perl 5.16.3 (or higher) and:

  • cpanm (local::lib and/or perlbrew recommended)
  • gcc toolchain (gcc, make, lib headers)
  • git
  • libcurl
  • imagemagick
  • postgresql (recommended, though you may get away with mysql or sqlite for now)

To install these on Debian / Ubuntu:

  apt-get install cpanm build-essential libgd2-xpm-dev libssl-dev git libcurl4-gnutls-dev libxml2-dev imagemagick perl-doc postgresql libpq-dev

To proceed with installation, you will also need Dist::Zilla

  cpanm -i Dist::Zilla

To install community-platform's Perl dependencies, go to its directory and run:

  dzil authordeps --missing | cpanm
  dzil listdeps --missing | grep -v abstract | cpanm

This will take some time. You can add --notest to the cpanm command to speed things up, but this may result in fires later.

Test Data

Before running the dev server, we need a database schema.

The default is to use SQLite if no DSN configuration environment variables are found, e.g.

  export DDGC_DB_DSN='dbi:Pg:database=ddgc';
  export DDGC_DB_USER='ddgc';
  export DDGC_DB_PASSWORD='yourdbpass';

To run the dev environment deployment script, your postgres user requires the following permissions:

  ALTER USER ddgc CREATEDB;
  ALTER USER ddgc LOGIN;

This script deploys the schema and populates it with a test / dev data set:

  script/ddgc_deploy_dev.pl

You can also roll over any existing schema with the --kill switch:

  script/ddgc_deploy_dev.pl --kill

For the flags to work, you need to generate their sprites. This process has to be repeated everytime the country flags are changed.

  script/ddgc_generate_flag_sprites.pl

Community platform's generated static files, media uploads, caches, duckpan packages etc. live in $HOME/ddgc/

Development

To launch the development web server:

script/ddgc_dev_server.sh

This, by default, launches a plack server bound to port 5001 with DBIC and Catalyst console debugging enabled with Plack debug panels in rendered output.

It watches the lib/ directory and restarts if there are any changes written. It supports the following options:

  • -p - Set port to bind to
  • -m - Use a debug mailer on localhost:1025 (python -m smtpd -n -c DebuggingServer localhost:1025)
  • -n - Don't render Plack debug panels (useful for frontend work)

Front end elements (js, css...) in src/ are managed by node.js / grunt.

To launch a task to rebuild static files when they change, use

grunt watch

User Accounts

The following accounts are created by ddgc_deploy_dev.pl:

  • testone An admin, who is native German but also speaks English.

  • testtwo A normal user who speaks Spanish with public profile.

  • testthree A translation manager who speaks English, Arabic, and German.

  • testfour An admin, who speaks German, Spanish, and English.

  • testfive A normal user without public profile, who speaks Russian and English.

  • Additionally there are also test1 to test40 all without any setup.

Any random password will suffice, as a separate service is used to provide authentication in production.

License

This software is licensed under Perl 5 dual license: either GPLv1 or later, or, at users' choice, Artistic 1.0. We welcome contributions to this software under the same licensing terms.

Third party credits

The project is built using other software packages and creative content:

community-platform's People

Contributors

aanarres avatar adamsc1-ddg avatar alohaas avatar bsstoner avatar cngarrison avatar crazedpsyc avatar deskfolio avatar getty avatar guiltydolphin avatar jagtalon avatar jbarrett avatar jdorweiler avatar jkv avatar kablamo avatar majuscule avatar malbin avatar mariagraziaalastra avatar moollaza avatar mrshu avatar mwmiller avatar nilnilnil avatar ordoban avatar russellholt avatar scepticrail avatar sdougbrown avatar stommepoes avatar tagawa avatar wreis avatar zachthompson avatar zekiel 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.