Giter VIP home page Giter VIP logo

geekcamp.sg's Introduction

Geekcamp.SG

Geekcamp.SG's code

The code could probably be used for other unconferences that allow for user submission and voting before the unconference happens. Making it open source so that others can use, but not customising alot because this is a bare MVP for Geekcamp.SG. So you'll probably need to hack abit of stuff to make it work for your unconference (Logos, partners, email-to address).

Anyone wanting to submit pull requests are welcomed to do so :) Would appreciate if anyone spots security flaws to at least come forward and let me know about it too.

Stack: PHP/Codeigniter and MongoDB

MongoDB chosen because I already have a HA infrastructure for it readily available.

Setup Required! Edit the .htaccess file such that it points to your root dir

Optional If you are using mongodb with username and passwords and replica sets. Edit correspondingly

applications/config/custom_constants.php

  • define('MONGO_DB_NAME', 'mongo db name');
  • define('MONGO_REPLICA_SET', 'replicaset name. if you are using replica sets');
  • define('MONGO_USERNAME', 'your mongo username');
  • define('MONGO_PASSWORD', 'your mongo password for your mongo db');
  • define('MONGO_CONNECTION', 'connect to your mongo instance');

applications/models/core_model.php

edit the connection such that it fits your use case.

applications/views/core.php

change the logo and the title as per your needs. and the partners too.

###Core code concepts walkthrough ####Models

All model classes connect to the database by first loading core_model, and running the connect_to_db() function.

All model classes have a function at the top, called choose_collection(). This function returns a MongoCollection (pardon me if I'm wrong, coding this while on holiday with no internet connection), which they get by calling the connect_to_db() in core_model. For the SQL peeps, it's the same as a table.

Once collection is chosen, you can start doing what you want with the collection.

Note! For writes to database that are very important, remember to call it with the fsync setting set to true. It has been done for all existing database writes.

####Views core.php basically contains the skeleton of all the pages, and has a variable called $content that it echos. $content typically contains the contents of the page.

All the views are based on the Twitter Bootstrap framework.

####Controllers

3 main controllers, pages, user, admin

Pages displays all the public facing pages, including the talk submission page.

User handles all user registration functions. Hide user/signup() when you do not want new users by adding a '_' before the name of signup(). signup is deactivated by default.

Admin handles the admin backend, and allow users to edit existing talks.

####Custom libraries

User_lib and Hash_lib

Hasb_lib contains 1 function to generate a random string. This function is mainly used to generate the salt in the user password

User_lib contains is_logged_in to basically check if a existing user is logged in. is_admin() is not in use.

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.