Coder Social home page Coder Social logo

hasgeek / hasjob Goto Github PK

View Code? Open in Web Editor NEW
235.0 26.0 80.0 18.41 MB

Hasjob, the Hasgeek job board

Home Page: https://hasjob.co

License: GNU Affero General Public License v3.0

Python 70.35% Mako 0.06% Ruby 0.05% CSS 0.04% JavaScript 5.06% Shell 0.09% Dockerfile 0.08% Makefile 0.01% SCSS 0.41% Sass 3.46% Jinja 20.38%
job-board python hasgeek hacktoberfest

hasjob's Introduction

Hasjob

Code for Hasjob, Hasgeek’s job board at https://hasjob.co/

Copyright © 2010-2021 by Hasgeek

Hasjob’s code is open source under the AGPL v3 license (see LICENSE.txt). We welcome your examination of our code to:

  • Establish trust and transparency on how it works, and
  • Allow contributions to Hasjob.

Our workflow assumes this code is for use on a single production website. Using this to operate your own job board is not recommended. The name ‘Hasjob’ and the distinctive appearance of the job board are not part of the open source code.

To establish our intent, we use the AGPL v3 license, which requires you to release all your modifications to the public under the same license. You may not make a proprietary fork. To have your contributions merged back into the master repository, you must agree to assign copyright to Hasgeek, and must assert that you have the right to make this assignment. (You may not like this condition, and we understand. If you have a better idea, tell us!)

Installation

Installation is a multi-step process. If any of this is outdated, consult the .travis.yml file. That tends to be better maintained.

Pick an environment

Hasjob requires a FLASK_ENV environment variable set to one of the following values, depending on whether the deployment is in development or production:

  • DEVELOPMENT or development or dev (default)
  • PRODUCTION or production or prod

In a production environment, you must set FLASK_ENV globally for it to be available across processes. On Ubuntu/Debian systems, add it to /etc/environment and reboot.

PostgreSQL, Redis, NodeJS

Hasjob requires PostgreSQL, Redis and NodeJS. Installation

On macOS using Homebrew:

$ brew install postgresql
$ brew services start postgresql
$ brew install redis
$ brew services start redis
$ brew install node

On Ubuntu:

  • PostgreSQL:

    $ sudo apt install postgresql
    $ sudo systemctl enable postgresql@13-main
    
  • Redis: sudo apt install redis

  • NodeJS: Follow instructions at https://node.dev/node-binary

Next, create a PostgreSQL DB. On macOS:

$ createdb hasjob

On any Linux distribution:

$ sudo -u postgres createuser -d hasgeek
$ sudo -u postgres createdb -O hasgeek hasjob

Edit instance/development.py to set the variable SQLALCHEMY_DATABASE_URI to one of these, depending on whether the database is hosted under the hasgeek user or your personal account, and whether your database is accessed over a Unix socket or IP:

  1. postgresql:///hasjob
  2. postgresql://localhost/hasjob
  3. postgresql://hasgeek:YOUR_PASSWORD_HERE@localhost:5432/hasjob

Redis does not require special configuration, but must listen on localhost and port 6379 (default).

Configuration

Hasjob requires several configuration variables. Copy instance/settings-sample.py into a new file named either instance/development.py or instance/production.py depending on runtime environment, and set all values.

Hasjob operates as a client app of Funnel (previously Lastuser before it merged into Funnel). You must either run Funnel yourself, in parallel with Hasjob, or register as a client on the production website at https://hasgeek.com/apps.

Hasjob makes use of subdomains to serve different sub-boards for jobs. To set it up for development:

  • Edit /etc/hosts and add these entries:

    127.0.0.1    hasjob.test
    127.0.0.1    static.hasjob.test
    127.0.0.1    www.hasjob.test
    129.0.0.1    your-test-subboard.hasjob.test
    
  • Edit instance/development.py and change SERVER_NAME to 'hasjob.test:5001'

Install dependencies

Hasjob runs on Python 3.7 or later with the Flask microframework.

Virutalenv + pip + webpack

If you are going to use a computer on which you would work on multiple Python based projects, Virtualenv is strongly recommended to ensure Hasjob’s elaborate and sometimes version-specific requirements doesn't clash with anything else.

You will need to install all the requirements listed in requirements.txt using pip:

$ pip install -r requirements.txt

If you intend to actively contribute to Hasjob code, some functionality is sourced from the related libraries coaster, baseframe and Flask-Lastuser. You may want to clone these repositories separately and put them in development mode:

$ cd ..
$ git clone https://github.com/hasgeek/coaster.git
$ git clone https://github.com/hasgeek/baseframe.git
$ git clone https://github.com/hasgeek/flask-lastuser.git
$ pip uninstall coaster baseframe flask-lastuser
$ for DIR in coaster baseframe flask-lastuser; do cd $DIR; python setup.py develop; cd ..; done
$ cd baseframe && make && cd ..

You will need to install all dependencies, run Webpack to bundle CSS, JS files & generate the service-worker.js

$ cd <hasjob project root>
$ make

Before you run the server in development mode, make sure you have Postgres server and Redis server running as well. To start Hasjob:

$ ./runserver.sh

Create root board

Some functionality in Hasjob requires the presence of a sub-board named www. Create it by visiting http://hasjob.test:5001/board (or the /board page on whatever hostname and port you used for your installation). The www board is a special-case to refer to the root website.

Periodic jobs

Hasjob requires some tasks to be run in periodic background jobs. These can be called from cron. Use crontab -e as the user account running Hasjob and add:

*/10 * * * * cd /path/to/hasjob; flask periodic sessions
*/5  * * * * cd /path/to/hasjob; flask periodic impressions
0    2 * * * cd /path/to/hasjob; flask periodic campaignviews

Other notes

If you encounter a problem setting up, please look at existing issue reports on GitHub before filing a new issue. This code is the same version used in production, so if the website works, chances are something is wrong in your installation.

WSGI is recommended for production. For Apache, enable mod_wsgi and make a VirtualHost with:

WSGIScriptAlias / /path/to/hasjob/git/repo/folder/wsgi.py

For Nginx, run wsgi.py under uWSGI and proxy to it:

location / {
    include uwsgi_params; # Include common uWSGI settings here
    uwsgi_pass 127.0.0.1:8093;  # Use the port number uWSGI is running on
    uwsgi_param UWSGI_CHDIR /path/to/hasjob/git/repo/folder;
    uwsgi_param UWSGI_MODULE wsgi;
}

Sample uWSGI configuration:

[uwsgi]
socket = 127.0.0.1:8093
processes = 8
threads = 2
enable-threads = True
master = true
uid = <user-account-on-your-server>
gid = <group-for-user-account>
chdir = /path/to/hasjob/git/repo/folder
virtualenv = /path/to/virtualenv
plugins-dir = /usr/lib/uwsgi/plugins
plugins = python37
pp = ..
wsgi-file = wsgi.py
callable = application
touch-reload = /path/to/file/to/touch/to/cause/reload
pidfile = /var/run/uwsgi/%n.pid
daemonize = /var/log/uwsgi/app/%n.log

hasjob's People

Contributors

abijith-kp avatar arunkrishnan avatar caulagi avatar codecloudme avatar dependabot[bot] avatar drprofesq avatar hitezh avatar iambibhas avatar iamsudip avatar jace avatar jimms avatar karthikb351 avatar kracekumar avatar miteshashar avatar nigelbabu avatar pravj avatar pre-commit-ci[bot] avatar pyup-bot avatar qurbat avatar samyakbhuta avatar sanketsaurav avatar shreyas-satish avatar snyk-bot avatar vidya-ram 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hasjob's Issues

Job sharing using Facebook

Currently "Tweet This" or "Email This" options are available. There should be option so that user can share job using Facebook like share on Facebook.

Anonymous profiles

User profile pages should have an anonymous version where a summary of relevant information is provided along with endorsements from real people, without revealing the individual's identity.

Suggested by @jitendravyas.

Cache cards using local storage

In Hasjob's new avatar as a rich client app, job cards should be cached locally so that the server only needs to send the newest cards. Reloading the page takes way too long on mobile.

Notice of expiry

An expiry notice should be sent 1-2 days prior to the listing expiring.

Certified recruiter flag

Companies like HackerEarth regularly list on Hasjob for their clients. They are in our approved list of recruiters who pay for every listing.

We've should make this a flag that shows on the listing. I propose:

  1. Recruiter table which lists all the domains used by certified recruiters (should it also include specific email addresses for gmail users?)
  2. A certified flag on the listing that is automatically set if the recruiter is found in the recruiter table. This can be manually unset for cases where the recruiter is hiring for themselves.
  3. A monthly report that looks for recruiter listings and helps prepare an invoice (manually processed).

Browse by company/company type

The board needs a way to browse by company (currently proxied for by the poster) OR by type of company: startups, stable companies, etc.

The latter is not straightforward. We have no way to do this unless we track companies, a la CrunchBase.

Commenting support required

Many jobs don't have a clear enough description. Allowing users to comment will help make the listings interactive.

The flip side is that less savvy users will attempt to apply for the job via comments, adding noise for others.

We should have commenting as a controlled feature to see how it works.

Require login to post jobs

Login will enable management of listings from the website, including tracking responses and reporting spammers.

Check for Apply instructions

The How to Apply section must include a URL or email address, to prevent accidental listings with no contact information.

Database Access

A front end user interface that can pull out data about HasJob is required.
The data parameters required are

  1. Name of the company that has posted a Job on HasJob
  2. Category/Job Title(s) (This could be a little vague in terms of data. What is an important metric is the kind of group the Job belongs to. By group I mean cloud, JS etc. Here's an example: http://jobs.hasgeek.com/search?q=cloud
    It would be good to have all the companies that show up on this search result as a list with the mentioned parameters. The Category might not be adequately able to tell us about the job)
  3. Contact of the Job Poster
    Email/Phone number)
  4. City of the Job/ Office
    We will most probably only have the city where the job requirement is. It can be safely assumed that the comany has an office at the site specified.
  5. Company Url

The HasJob database can be used to coordinate the marketing and sponsorship activities. This is a good approach to take as users on the list already know of Hasgeek and will be open to exploring sponsorship options with us.

This feature can be further extended in the future to include a company's cumulative activity data on Hasgeek products and events, a part of the larger Hasgeek profile building activity

Limit how to apply field

Let posters choose between two options: email and URL. Wrap both types of links to count clicks. Disable free text here, let that be in description instead.

Whoosh has occasional locking errors

Whoosh locks the index when updating it. This causes locking errors on the rare occasion when two job listings are confirmed at the same time. Here's a typical traceback:

Exception on /confirm/z39wf [POST] Traceback (most recent call last):

File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1504, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1264, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1262, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1248, in dispatch_request
  return self.view_functions[rule.endpoint](**req.view_args)
File "/var/www/hasjob/views.py", line 312, in confirm
  db.session.commit()
File "/usr/local/lib/python2.6/dist-packages/sqlalchemy/orm/scoping.py", line 114, in do
  return getattr(self.registry(), name)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/sqlalchemy/orm/session.py", line 655, in commit
  self.transaction.commit()
File "/usr/local/lib/python2.6/dist-packages/sqlalchemy/orm/session.py", line 319, in commit
  self.session.dispatch.after_commit(self.session)
File "/usr/local/lib/python2.6/dist-packages/sqlalchemy/event.py", line 291, in __call__
  fn(*args, **kw)
File "/usr/local/lib/python2.6/dist-packages/flask_sqlalchemy.py", line 185, in after_commit
  models_committed.send(session.app, changes=d.values())
File "/usr/local/lib/python2.6/dist-packages/blinker/base.py", line 220, in send
  for receiver in self.receivers_for(sender)]
File "/var/www/hasjob/search.py", line 57, in on_models_committed
  writer = ix.writer()
File "/usr/local/lib/python2.6/dist-packages/Whoosh-1.8.0-py2.6.egg/whoosh/filedb/fileindex.py", line 271, in writer
  return SegmentWriter(self, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/Whoosh-1.8.0-py2.6.egg/whoosh/filedb/filewriting.py", line 125, in __init__
  raise LockError

LockError


Possible solution: catch the exception, sleep a second, and try again.

Suggested edits feature

When jobs are cross-posted to forums like Facebook, commentators often nitpick about grammar and spelling. The job board should have a suggested edit feature where anyone (or anyone with a certain reputation level or higher) should be able to edit the post and submit the edits for review by the original poster.

The job board could be a nicer place if people supported each other rather than pulling each other down.

Move to bs3

hasjob is not using bootstrap or for that matter, even baseframe.
We need to port all templates to use Bootstrap 3.

Location tagging

Hasjob should use location tagging instead of a freeform location text field. The Geonames webservice can be used to autocomplete location names:

http://ws.geonames.org/searchJSON?name_startsWith=<term>&countryBias=IN&featureClass=P&callback=<callback>

import errors due to new naming scheme (Flask)

flaskext.assets has been renamed as flask.ext.assets, used in assets.py
flaskext.sqlalchemy has been renamed as flask.ext.sqlalchemy, used in models.py and search.py

Sorry I am still figuring things out so could not send a patch.

Use profiles for contact information

Instead of letting applicants contact over email, require them to apply with a HasGeek profile. The Show Instructions button will become an I'm Interested button which will send a notice to the employer. If they are interested in the candidate, they can connect and Hasjob emails both parties to introduce them.

The profile page becomes an easy way to gauge the candidate's experience level.

Add a 'Closed' state

'Withdrawn' hides the listing entirely. Sometimes it's good to indicate the position has been filled, while leaving the description available for all to see.

Domain verification required

Domain verification is required to protect from fake listings. If someone posts with example.com as the website address and provides an email address @example.com, then their domain is considered verified -- the listing came from someone in the organization.

Non-verified listings should be held for moderation.

Search query in input box

When searching for a job, the queried phrase should appear in the search box on the results page.

Multi-company aggregation pages

Hasjob should support aggregation pages across companies.

An accelerator/incubator like the Morpheus should be able to make a page that lists jobs from across their portfolio companies.

Make Connection button is unintuitive

Employers are getting confused by the Make Connection button. Its not obvious what it does.

Further, the connection email that is sent out does not indicate who is responsible for following up, the candidate or the employer.

Hasjob should instead provide a text field for the employer to send a message directly to the candidate, and should record this response.

In future this process can take place over an email gateway instead of the web.

Reported by @surdattack.

Links in job posts should be validated

Users sometimes forget to include the http:// in a link. The editor widget should validate all links in the post to confirm they are correct.

  1. Force all URLs to be absolute (unless they are links to other posts on the job board, but how do we tell?)
  2. Check if the link is valid (ie, it loads with status 200)

Tweet with lister's twitter id

Folks sometimes respond to @hasjob's tweets. This is useless because the reply isn't directed to the person listing the job. They'll not see it.

We should ask for the lister's Twitter id in the posting form and include that in the tweet so that a Reply All will include them.

Run linkify on the Apply section

The Apply section is a plain text field and so doesn't go through bleach.clean and bleach.linkify. It could contain links though, so it needs to be passed through bleach.linkify when rendering the page. Watch for conflicts with the other parser that handles email addresses.

Breakage from issue #28

The linkify in Issue #28 is causing a bunch of side effects. This call should go into rendering instead of when saving to the database.

Sort search results by date

Search results are sorted by relevancy which is confusing to browse. Results sorted by date would be easier to look at.

Ignore candidate should send mail

Ignore candidate should send a canned response back to the candidate. It should be possible to add this canned response at the time of creation.

Search results are not sorted by date

If not done deliberately, this is a bug.
I am guessing changing the views.py at line 499 (def search()) can help:

results = sorted(results, key=lambda x: x.count, reverse=True)  if results[0]['idref'].split('/')[0]=='post'

I'll submit a patch if the change looks okay.

Title for the RSS feed is incorrect

Title for the rss feed is incorrect. The title seems to be picked up from the last post - should instead of a fixed text like Hasgeek job board or something.

Apply with LinkedIn

Candidates should be able to apply by submitting their LinkedIn profile. HasJob needs an "Apply with LinkedIn" button.

Move agelimit and newlimit into settings

The agelimit and newlimit variables should be in settings. However, importing timedelta in the settings file is a no-no (no code in settings), so we do it like this:

# settings.py
AGE_LIMIT = {'days': 30}
NEW_LIMIT = {'days': 1}

# code
agelimit = timedelta(**app.config['AGE_LIMIT'])
newlimit = timedelta(**app.config['NEW_LIMIT'])

Twitter tweet length isn't checked

The Twitter posting code doesn't check for tweet length accurately. It failed on this listing: http://jobs.hasgeek.com/view/pkqjq.

Traceback:

File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1504, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1264, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1262, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python2.6/dist-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1248, in dispatch_request
  return self.view_functions[rule.endpoint](**req.view_args)
File "/var/www/hasjob/views.py", line 347, in confirm_email
  _external=True), post.location)
File "/var/www/hasjob/twitter.py", line 26, in tweet
  api.update_status(text)
File "/usr/local/lib/python2.6/dist-packages/tweepy/binder.py", line 179, in _call
  return method.execute()
File "/usr/local/lib/python2.6/dist-packages/tweepy/binder.py", line 162, in execute
  raise TweepError(error_msg, resp)

TweepError: The text of your tweet is too long.

Tweet text:

text =  u'Website QA Analysts to perform functional, regression, and other types of website QA  for  Food.com. http://hsgk.in/IwOOTu #Bangalore'

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.