Giter VIP home page Giter VIP logo

freemex's Introduction

Freemex

Freemex is an online trading game which allows you to buy and sell stocks at your convenience and at the current market price. The player at the end with highest total stocks and cash wins the game.

Building from Source

  1. Create a virtual environment with virtualenv (install virtualenv, if its not installed).

    virtualenv freemex
    
    
  2. Clone the project in the virtual environment directory.

    cd freemex
    git clone https://github.com/lugnitdgp/freemex.git
    
    
  3. Activate the virtual environemnt.

    For Linux/Mac OSX

    source bin/activate
    
    

    For Windows

    .\Scripts\activate
    
    
  4. Install the requirements.

    cd freemex
    pip install -r requirements.txt
    
    
  5. Copy the .env.example file to .env file.

    cp .env.example .env
    
    
  6. Open the .env file and add an arbitary secret key.

  7. Generate Google+ OAuth credentials with the following steps:

    • Go to Google developer console

    • Create a new project if you do not have any (see the drop-down at the top left of your screen).

    • After the project is created you will be redirected to a dashboard. Click on ENABLE API button.

    • Select Google+ API from the Social APIs section.

    • On the next page, click the Enable button to enable Google+ API for your project.

    • To generate credentials, select the Credentials tab from the left navigation menu and hit the ‘Create Credentials’ button.

    • From the drop-down, select OAuth client ID.

    • On the next screen, select the application type (web application in this case) and enter your authorized javascript origins and redirect uri. For now, just set the origin as http://localhost:8000 and the redirect URI as http://localhost:8000/complete/google-oauth2/

    • Now, open the .env file and add your Google OAuth credentials.

  8. Generate Facebook login credentials with the following steps:

    • Go to Facebook Developers Console

    • Click on My Apps and then Add a New App.

    • Enter Display Name and Contact Email and click on Create App Id.

    • Select Facebook login and choose set up. Pick Web on the next page.

    • Enter http://localhost:8000 as the Site Url and hit Save.

    • Now go to Settings/Basic and then in the App Domains just put localhost and hit Save Changes.

    • Grab the App ID and App Secret and add them to the .env file.

  9. Migrate your database and run the Django Development Server.

    ./manage.py makemigrations
    ./manage.py migrate
    ./manage.py runserver
    
    
  10. Open http://localhost:8000 in your browser. (Opening http://127.0.0.1:8000 will cause problems with Social Login)

Starting the game

  1. Add the cronjob

    ./manage.py crontab add
    
    
  2. Load the fixtures

    ./manage.py loaddata fixtures.json
    
    
  3. Run the server and the prices should get updated every minute. Now, buy and sell stocks to make profit. Enjoy!

For contributors

Freemex uses the following technologies:

  • HTML/CSS/JavaScript
  • Pyhton(Django)

If you want to contribute to this project, then have a look here

freemex's People

Contributors

ankan17 avatar ghoshbishakh avatar anirbanbanik1998 avatar hereismodi avatar arc9693 avatar

Watchers

James Cloos 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.