Skip to main content

Technology Stack

WIDE is developed on the Angular (v17) framework for its front end application, and express-js for its server application.

In order to build the application locally or deploy a separate instance of it, you must first install and set up node.js on your machine as well as Angular 17 and its dependencies. The WIDE server also relies on the availability of a Key-Value store in order to be able to persist the data. WIDE currently supports Redis data stores on Upstash out-of-the box.

Note

Please refer to the respective documentation of each framework and make sure the platform is correctly setup before running the code locally.

Running the WIDE Client

To run the Angular WIDE client locally, run ng serve and the WIDE client should load on the appropriate port, http://localhost:4200 by default;

Environment Variables

The WIDE client's configuration follows standard Angular practices and may be found in the environments\environment.ts

export const environment = {
production: true,
wideServerApiUrl: 'https://api.wid3.app',
wideDomain: 'https://wid3.app',
googleOAuth: {
clientId: '<Google OAuth Client Id>',
redirectUri: 'https://wid3.app/credentials/oauth/redirect/google'
},
discordOAuth: {
clientId: '<Discord OAuth Client Id>',
redirectUri: 'https://wid3.app/credentials/oauth/redirect/discord',
},
microsoftOAuth: {
msalConfig : {
auth: {
clientId: '<MSAL Config Client Id>',
authority: 'https://login.microsoftonline.com/common/',
redirectUri: 'https://wid3.app/credentials/oauth/redirect/microsoft'
}
}
},
}

Running the WIDE Server

To run the express-js back-end project locally, run node .\server.js and the WIDE client should start on the relevant port, http://localhost:3000 by default;

Environment Variables

The WIDE server's configuration must be placed in a .env file located the project root.

Warning

The Server's environment file contains highly sensitive information and must be managed appropriate and NEVER be shared!

WEB_DOMAIN="http://localhost:4200" //The WIDE Client Domain
SIWE_MESSAGE_EXPIRY_SECONDS=300
COOKIE_DOMAIN=LOCAL
COOKIE_USE_SECURE=false
COOKIE_SAME_SITE=lax
COOKIE_EXPIRY_MILLISECONDS=3600000
SESSION_SECRET=00000000000 //Define a Unique Session Secret
SESSION_STORAGE=REDIS
WIDE_CONTRACT="0x5FbDB2315678afecb367f032d93F642f64180aa3" //The Address for the Smart Contract
WEB3_NODE_URI="http://127.0.0.1:8545" //The Blockchain Node's URI
WEB3_PRIVATE_KEY="0x..." //The Server's unique wallet private key. This is used to sign messages and log them onto the smart contract. !! DO NOT SHARE THIS KEY
WEB3_PUBLIC_KEY="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" //The Server's public wallet key.
UPSTASH_PORT=31994
UPSTASH_ENDPOINT=sample.upstash.io //Provided by Upstash
UPSTASH_PASSWORD=upstash_password //Provided by Upstash