Skip to content

Frontend

AOrps edited this page Apr 26, 2022 · 7 revisions

Directory Location

  • src/front-end

Requirements

  • Google oauth2 credentials { CLIENT_ID + CLIENT_SECRET }
  • .env file
  • valid-sigs.json file

Generating Google oauth2 credentials

Contents of .env file

# To create .env file
touch .env
  • .env must have the following 5 environment variables
    • GOOGLE_CLIENT_ID
      • This is provided to the developer via Google.
    • GOOGLE_CLIENT_SECRET
      • This is provided to the developer via Google.
    • SESSION_KEY
      • For the developer to choose. (At the time of writing this it is some random characters but there is definitely a better (and more secure) way of doing this and may be omitted in the future)
    • BENDPOINT
      • This should be the endpoint (server, area, etc.) where the src/api portion of the code is being run
    • TYPE
      • Helps maintainers / testers
      • Option between "test" or "prod"
        • "test" : tests on localhost/oauth2/callback i.e. for testing
        • "prod" : tests on sig-track.xyz/oauth2/callback endpoint i.e. for production
      • Default is "test" functionality

Example of .env file

Contents of valid-sigs.json file

Example of valid-sigs.json file

TLDR

# Change to src/front-end directory
cd src/front-end

# .env file
cat <<EOF > .env
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
SESSION_KEY=""
BENDPOINT=""
TYPE=""
EOF

# valid-sigs.json file
cat <<EOF > valid-sigs.json
[ "sig1", "sig2", "sig3", ... ] 
EOF
Clone this wiki locally