Skip to content

adushaj2022/Vote-Safe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Vote Safe

Secure voting directly from a mobile phone

Tech Stack

TypeScript
React Native
Expo
Node

Requirements

Have node js installed then run the following commands to install yarn, expo and typescript globally.

npm install expo-cli --global # install expo globally
npm install yarn --global # install yarn globally
npm install typescript --global # install ts globally

Download Redis, for windows download or installer go HERE or for a manual download for other platforms click HERE

Setting up virtual device (Windows)

Download Android Studio to utilize virtual device, after installed watch this video for help

Setting up virtual device (Mac)

Use xcode for ur virtual device which will be ios, if you need help getting a virtual ios device running you can probably find something online to help

Using Expo instead

you do not need to even use a virtual device, download the expo go app on your phone. When starting the mobile app run yarn start and scan qr code and the app will open on your phone

Starting the mobile app

Make sure your device is running at this point in time, it just has to be on and open.

Next go to the directory in which you want to run / install this project and run the following commands

git clone https://github.com/adushaj2022/VoteSafe.git
cd mobile
yarn install # install dependencies using yarn
yarn start # for expo option
expo start --android # starting the app
# or for ios
expo start --ios

There is one more thing you need to do, go into ./mobile/api/config.ts

export const _http = axios.create({
  baseURL: "",
});

Change the baseURL to http://{yourIpAddress}:{nodeServerPort}/ If you do not know your ip run ipconfig :)

Starting the backend

cd server
npm install # if there are dependencies missing
npm run build # compile typescript
npm start # run app

Database setup

Download postgresql on your computer, make sure you know your password, keep port on 5432 this is default just do not change it. After setting up your .env file (see below), please create a database called 'votesafe', when starting the server the databases will be created automatically

Environment Variables

Go to root file directory and enter the commands

cd server
touch .env # bash
ni .env # powershell

.env file contents can be found in discord

Development help

Instead of stopping the server, compiling typescript, then restarting the server. We can do the following. Open up a new terminal and run the following

npm run watch

Next leave that terminal open and open a new one, and run the following

npm run dev

Now it will watch for changes and recompile for you :)

Further Resources

Native Base
Navigation
Expo
Redux

Contributing

Create a branch of your own and submit pull requests that will then be reviewed

About

Full stack mobile project where users can create elections and vote

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published