Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UIcode/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REACT_APP_API_URL=http://localhost:4080
REACT_APP_GOOGLE_CLIENT_ID=711253381463-l6acl9v1blh2i71jmlu01olfbg60nlj3.apps.googleusercontent.com
REACT_APP_ENCLAVE_URL=https://safetrace.enigma.co
REACT_APP_GOOGLE_MAPS_API_KEY=AIzaSyCh90IL7Ek4iDZqHUKJSeXrubCTGi4GbsQ
4 changes: 4 additions & 0 deletions UIcode/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REACT_APP_API_URL=http://localhost:4080
REACT_APP_GOOGLE_CLIENT_ID=711253381463-l6acl9v1blh2i71jmlu01olfbg60nlj3.apps.googleusercontent.com
REACT_APP_ENCLAVE_URL=https://safetrace.enigma.co
REACT_APP_GOOGLE_MAPS_API_KEY=AIzaSyCh90IL7Ek4iDZqHUKJSeXrubCTGi4GbsQ
45 changes: 42 additions & 3 deletions UIcode/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,54 @@
# React File Upload

- This is a React UI to interact with the backend and the Enclave service.
- It is still in development, for now using it client you can report new user data and upload location history.
- For simplicity, we are currently only supporting Google sign-in
> This is a full stack React-Express file uploader but could easily be modified to work with any back-end including cloud storage

## Quick Start

```bash
# Install dependencies server/client
npm install
cd client
# Install dependencies
npm install

# Create .env.development file as follows
touch .env.development
```

Obtain a Google client ID following the instructions on [https://developers.google.com/identity/sign-in/web/sign-in](https://developers.google.com/identity/sign-in/web/sign-in) and make sure to include the `localhost:3000` to authorized origins.
Then add this variable to your `.env.development`

```bash
#set google client id i.e. 119469794689-hhq7rpcmd88c7r5gkiom0u2pakfka3cd.apps.googleusercontent.com
echo "REACT_APP_GOOGLE_CLIENT_ID=119469794689-hhq7rpcmd88c7r5gkiom0u2pakfka3cd.apps.googleusercontent.com" >> .env.development
```

Top run the backend API check [https://github.com/cmalfesi/SafeTrace/tree/master/backend](https://github.com/cmalfesi/SafeTrace/tree/master/backend)
Then add the API URL to your `.env.development`

```bash
#set google client id i.e. 119469794689-hhq7rpcmd88c7r5gkiom0u2pakfka3cd.apps.googleusercontent.com
echo "REACT_APP_API_URL=http://localhost:4080" >> .env.development
```

Include the Enclave URL in your `.env.development`
```bash
echo "REACT_APP_ENCLAVE_URL=https://safetrace.enigma.co" >> .env.development
```

Include Google Maps API Key in your `.env.development`, you can find instructions on how to obtain it here [https://developers.google.com/maps/documentation/javascript/get-api-key](https://developers.google.com/maps/documentation/javascript/get-api-key)

```bash
echo "REACT_APP_GOOGLE_MAPS_API_KEY=AaLeiVHdICmJYzM8w8aSyEzo-TainZ3W3Ev2QfQ" >> .env.development
```

Finally to run the client execute the following commands:

```bash
# Serve on localhost:3000
npm start


# Serve on localhost:3000
npm run dev
```
6 changes: 6 additions & 0 deletions UIcode/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
Loading