Code Monkey home page Code Monkey logo

stopstalk / stopstalk-deployment Goto Github PK

View Code? Open in Web Editor NEW
313.0 10.0 96.0 45.71 MB

Stop stalking and start StopStalking :wink:

Home Page: https://www.stopstalk.com

License: MIT License

Python 84.18% HTML 2.10% CSS 0.92% JavaScript 7.50% Shell 0.07% Makefile 0.01% C 0.44% XSLT 1.68% Less 0.86% SCSS 0.88% Cython 1.36%
web2py competitive-programming python materializecss crawling codechef codeforces spoj hackerearth hackerrank uva programming-contests aws timus stopstalk atcoder hacktoberfest

stopstalk-deployment's Introduction

StopStalk

Stop stalking and Start StopStalking ๐Ÿ˜Ž

Module Requirements

Note: Apply sudo if required for your system.

  1. First, make sure the development packages of libxml2 and libxslt are installed

Assuming you are running a Debian-based distribution, you can install them by using:

apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev

Install the required packages by running:

pip install -r requirements.txt

Also, pip doesn't respect proxy while installing packages from the requirements file. So if you are using a proxy in your terminal you MAY use:

pip install -r requirements.txt --proxy=<proxy address>
  1. To deploy the code, uglify-js and uglifycss needs to be installed

To install uglifyjs:

npm install uglify-js -g

To install uglifycss:

npm install uglifycss -g

Installation

  1. Install web2py (We need 2.14.6 version only) in a directory. We have committed the web2py source so that you can directly unzip and start using it

    • Unzip the web2py_src.zip somewhere outside the stopstalk directory.
    • After unzipping the web2py, copy the source of stopstalk to its applications directory
    • Final directory structure should be something like -
      • web2py/
        • applications/
          • stopstalk/
            • models
            • views
            • controllers
            • ...
  2. Navigate into the applications directory in web2py directory.

    $ cd web2py/applications/
    
  3. Install StopStalk by cloning this repository

    git clone https://github.com/stopstalk/stopstalk-deployment.git
    mv stopstalk-deployment stopstalk
    

    Note: Web2Py does not allow appname to contain hyphens.

  4. Install MySQL - here Make sure you remember the root password for mysql server.

  5. Create a database in MySQL

    $ mysql -u root -p        # Enter your mysql root password after this.
    
    mysql> CREATE DATABASE stopstalkdb;
    mysql> CREATE DATABASE uvajudge;
    
  6. Copy 0firstrun.py to models/

    $ cd stopstalk/
    $ cp models/0firstrun.py.sample models/0firstrun.py
    
  7. Open 0firstrun.py and change the settings.

    current.mysql_user = "root" # Change if you have given access to any other user in mysql
    current.mysql_password = "" # As per your mysql password
    current.mysql_server = "localhost"
    current.mysql_dbname = "migration" # Will remain same as long as you followed 5.
    current.mysql_uvadbname = "uvajudge" # Will remain same as long as you followed 5.
    
    # Configure mail options
    current.smtp_server = "logging" # Mails will not be sent. Will be logged where the web2py server is running
                                    # Else you can set it to your smtp server.
    current.sender_mail = ""        # Not required if logging
    current.sender_password = ""    # Not required if logging
    
    current.bulk_smtp_server = "logging"
    current.bulk_sender_mail = ""        # Not required if logging
    current.bulk_sender_password = ""    # Not required if logging
    
    current.analytics_id = "" # Leave it empty if you don't want Google Analytics on Localhost
    current.calendar_token = "" # Leave it empty if you don't have an access token ID for Google Calendar API
    
    # Leave the following empty for very basic email validation
    # https://app.neverbounce.com/settings/api
    current.neverbounce_user = ""
    current.neverbounce_password = ""

    In case if you want to send emails - Install postfix for your respective OS and configure the above smtp server accordingly.

  8. Install Redis - here

  9. Install InfluxDB (1.7) - here

  10. Navigate back to the web2py folder and start the web2py server.

    $ cd web2py
    $ python web2py.py -a yourPassword // Choose any password
    
  11. Open the browser and go to the URL -

    http://localhost:8000/stopstalk/

Note:

  • The database will be completely empty after installation
  1. Done. ๐Ÿ˜„

  2. To setup syntax check before all of your commits, just create a file in applications/stopstalk/.git/hooks/pre-commit with just make syntaxx_check as it's content.

A few steps to setup your local database - StopStalk Wiki

Project Dependencies

StopStalk is built on the Web2Py Framework, which is a Python-based MVC framework. The project also depends on several other open-source packages, some of which are

Contribute

  1. Fork the repository

  2. Clone your forked repository

  3. Find any of the issues from here - Issues and try solving it or any other enhancements

  4. Solve the bug or enhance the code and send a Pull Request!

    Note: Make sure to add the issue number in the commit message.

    Example Commit message: Solved Issue #5

  5. We will review it as soon as possible.

Configuration

Configure the models/000_config.py file as per your requirement.

Configuring Calendar API client ID

  1. Goto Google developers console and click on New Project.
  2. Give the project a name like stopstalk-test and create the project.
  3. Goto API Manager.
  4. Search and select Google Calendar API and enable it.
  5. Click on Go To Credentials and fill out the form
  6. Copy client ID and paste it in models/0firstrun.py
  7. Done. ๐Ÿ˜„

Contact

Contact Us Page: https://www.stopstalk.com/contact_us

Email: [email protected], [email protected], [email protected]

Creator Website: http://raj454raj.com

Social Links

stopstalk-deployment's People

Contributors

akshatm147 avatar amansharma07 avatar dependabot[bot] avatar devipriyasarkar avatar earora97 avatar emilluta avatar ewenchou avatar gaushikmr avatar hitesh96db avatar iamadisri avatar iamrajiv avatar jonnoftw avatar kazoni avatar kenrick95 avatar khaledkee avatar lavishsaluja avatar manav1403 avatar ming13 avatar mipsapatel avatar pulkitsharma07 avatar raj454raj avatar skbly7 avatar vedantrathore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stopstalk-deployment's Issues

Optimize update-trending script.

Since the submission table is growing considerably - We need to come up with an efficient script to update the trending problems. Also trending problems for friends has to be dealt separately to optimize page load time of trending page.

.iterselect() instead of .select() 10% memory optimization as Web2Py docs say!

Python "iterators" are a type of "lazy-evaluation". They 'feed' data one step at time; traditional python loops create the entrire set of data in memory before looping.

The traditional use of select is:

for row in db(db.table.id>0).select():
    rtn = row

but for large numbers of rows, using an iterator-based alternative has dramatically lower memory use:

for row in db(db.table.id>0).iterselect():
    rtn = row

Testing shows this is around 10% faster as well, even on machines with large RAM.

Design html emails for StopStalk

We need HTML emails for the following purposes -

  • On registration before complete website launch
  • Welcoming the user when the website is up
  • On receiving a friend request
  • Acceptance of a friend request
  • Rejectance of a friend request
  • Unfriending a friend

Extend the profile sites to TopCoder!

Questions -

  • Does topcoder have api?
  • Does topcoder actually has public profile pages?
  • Say above are true, how do we retrieve only the topcoder submissions given we have last_retrieved already updated for current users?

Whole new DB schema. Maybe a lot efficient, faster and less memory consuming.

Instead of storing the handles and sites in the auth_user table have a table having site handles and site names and then make id of this table as the foreign key for auth_user table.

  • Advantages -
    • Retrieve(update) submissions of 1 particular handle only once.
    • Lot of submissions that are duplicate can be saved
  • Disadvantages
    • Migration is dangerous
    • It will take a bit of time to change the existing code(Surely more than a bit ;) )

Also make a problem table(extend current problem_tags table) and just include problem_id in a submission.

Add Github as a profile site?

Things to consider -

  • It will have to be hardcoded, since this was never the use-case and the current schema won't support it
  • Most probably Github API does not support retrieving ALL the commits till date for a specific user

Filter for non matching text

This should be added only if the query matches(example: enter some text in user name that is not valid we will get all the submissions of logged-in user)
Error -> here

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.