Giter VIP home page Giter VIP logo

comelec-system-local's Introduction

E-Voting System

This system has the following tech stack:

  • Laravel as frontend (web)
  • React Native as frontend (mobile)
  • Laravel as backend

React and React Native interface with Laravel through APIs. The endpoints are to be specified.

Setup

Important: Client and Server have the best chance of working if they have the same domain.

If the server is hosted, i.e. php artisan serve --host 0.0.0.0, then the client must be served with the same IP address as well.

As such, the entries SESSION_DOMAIN and SANCTUM_STATEFUL_DOMAINS in server/.env must point to the IP address or domain name of the client.

Server

  • Copy and edit the .env.example file to .env
  • Check and update dependencies by running composer update
  • composer install
  • php artisan key:generate
  • Make sure to have a mysql connection. If you are using a virtualhost, run a mysql server
  • php artisan migrate
  • npm run dev or npm run build
  • php artisan serve
  • The database name is "comelec_database"

Serving over LAN

php artisan serve --host 0.0.0.0

On Linux, other ports may not be able to be forwarded, so try this instead

sudo php artisan serve --host 0.0.0.0 --port=80

Mobile

The mobile portion of this application is handled with Expo.

Source files are located in the app/ folder. Expo Router is a file-based routing system, so its structure must be followed.

  • Download the Expo app on your phone
  • Run npm i -D
  • Host the server first. When the server is hosted, copy and paste the URL to the extra/API_URL entry in the mobile/app.json file.
  • Run npm run start or npm run android to develop
    • Note: You may want to connect your android device first. Try with the QR Code, IP address, or directly connecting through USB and doing npm run android.

Build for Mobile

  • cd to mobile/
  • eas build --profile preview --platform android
In case build doesn't work
  • Remove mobile/package-lock.json

In case Expo Go doesn't connect

Try connecting through tunnel instead of LAN. Note: It may be slower to connect, so it is not recommended to use. See this StackOverflow question

  • npm i @expo/ngrok
  • Install ngrok for your system. Good luck.
  • ngrok http 3000 (Run this in another terminal window)
  • npx expo start --tunnel

comelec-system-local's People

Contributors

mikhailpanzo avatar

Watchers

 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.