Skip to content

rayriffy/mwit-elect

Repository files navigation

MWITS Election System

Requirements

Installation

  1. Clone repository

    $ git clone https://github.com/rayriffy/hacktech-backend
    Cloning into 'hacktech-backend'...
    remote: Counting objects: 322, done.
    remote: Compressing objects: 100% (183/183), done.
    Receiving objects: remote: Total 322 (delta 143), reused 280 (delta 112), pack-reused 0
    Receiving objects: 100% (322/322), 225.04 KiB | 268.00 KiB/s, done.
    Resolving deltas: 100% (143/143), done.
  2. Install composer package

    $ composer install
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Package operations: 70 installs, 0 updates, 0 removals
    ...
  3. Install NPM package

    $ yarn
    yarn install v1.9.4
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    info fsevents@1.2.4: The platform "win32" is incompatible with this module.
    info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
    [3/4] Linking dependencies...
    warning "laravel-mix > img-loader@3.0.0" has unmet peer dependency "imagemin@^5.0.0".
    [4/4] Building fresh packages...
    Done in 76.59s.
  4. Generate CSS/JS resources

    $ yarn run prod
    yarn run v1.9.4
    npm run production
    
    > @ production C:\xampp\htdocs\mwitelect.rayriffy.com
    > cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
    
    DONE  Compiled successfully in 18827ms
    
     Asset    Size  Chunks             Chunk Names
      /js/app.js  242 kB       0  [emitted]  /js/app
    /css/app.css  158 kB       0  [emitted]  /js/app
    Done in 29.76s.
    ```.
    
  5. Copy .env.example to .env

  6. Config your own MySQL in .env

  7. Generate new APP_KEY

    $ php artisan key:generate
    Application key [base64:RIFFYDADDYALLHOME] set successfully.
  8. Migrate database

    $ php artisan migrate
    Migrating: 2018_08_31_060559_create_user_table
    Migrated:  2018_08_31_060559_create_user_table
    Migrating: 2018_08_31_111056_create_candidate_table
    Migrated:  2018_08_31_111056_create_candidate_table
    Migrating: 2018_08_31_111113_create_election_table
    Migrated:  2018_08_31_111113_create_election_table
    Migrating: 2018_08_31_111219_create_vote_table
    Migrated:  2018_08_31_111219_create_vote_table

Routes

Domain Method URI Name Action Middleware
GET HEAD / home Closure
GET HEAD admin admin.home Closure
GET HEAD admin/addcandidate/{elect} admin.candidate.add.page Closure
GET HEAD admin/addelect admin.elect.add.page Closure
POST admin/candidate admin.candidate.add Closure web,checkauth,checkadmin
DELETE admin/candidate/delete/{elect}/{candidate} admin.candidate.delete Closure web,checkauth,checkadmin
PUT admin/candidate/edit/{elect}/{candidate} admin.candidate.edit.sys Closure web,checkauth,checkadmin
POST admin/elect admin.elect.add Closure web,checkauth,checkadmin
DELETE admin/elect/delete/{elect} admin.elect.delete Closure web,checkauth,checkadmin
PUT admin/elect/edit/{elect} admin.elect.edit.sys Closure web,checkauth,checkadmin
GET HEAD admin/elect/edit/{elect} admin.elect.edit.page Closure
GET HEAD admin/elect/{elect} admin.elect.show Closure
GET HEAD admin/elects admin.elect.all Closure
POST auth auth Closure web
GET HEAD logout logout Closure
GET HEAD user/elect user.elect Closure
POST user/vote user.vote.sys Closure web,checkauth
GET HEAD user/vote/{elect} user.vote.page Closure
GET HEAD {fallbackPlaceholder} Closure

Generating Tickets

You can generate Admin Ticket by using artisan

$ php artisan ticket:admin 1 5
 Do you want to generate 1 amount of Admin Token that will expire in 5 hours?? (yes/no) [no]:
 > yes

zVQJbv8oFcL3

In the following command it's mean "1 Admin Ticket will be generated, which will expire in 5 hours"

After confirmation, you will get a ticket. For this example, zVQJbv8oFcL3 is a generated Admin Ticket

Also works with normal ticket, too. php artisan ticket:user

About

MWIT Election System

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published