Links

Environment Configuration

This part of the document provides you with the Environmental file configuration required in API code of Spurtcommerce.

Mail Configuration

For mail configuration, you need to set up your SMTP credential in the .env file in api code
#
# Mail
#
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_USERNAME="[email protected]" #--Your Email Id
MAIL_PASSWORD= "spurt123&" #--Your Email Password
MAIL_PORT=465
MAIL_SECURE=true
MAIL_ENCRYPTION=tls
MAIL_FROM="[email protected]"

Environment Variables

Database Configuration

we are using mysql database, we need to configure database credentials in the .env file
#
# MySQL DATABASE
#
TYPEORM_CONNECTION=mysql
TYPEORM_HOST=localhost
TYPEORM_PORT=3306
TYPEORM_USERNAME= "testuser" #--Your MySql Username
TYPEORM_PASSWORD= "spurt123&" #--Your MySql Password
TYPEORM_DATABASE= "spurt_commerce" #--Your Database Name
TYPEORM_SYNCHRONIZE=false
TYPEORM_LOGGING=["query", "error"]
TYPEORM_LOGGER=advanced-console

JWT Configuration

Here are some scenarios where JSON Web Tokens are useful:
  • In your api code, Locate .env file and include a config variable "JWT_SECRET" (if not present already) and set a random string as config value (e.g:[email protected]#$%678$%^&*abndutyth89?)()#[email protected]&naagw) for this variable.
JWT token for authorization will be created with help of this secret key.
JWT_SECRET = "[email protected]#$%678$%^&*abndutyth89?)()#[email protected]&naagw" #set your own secret key

crypto Configuration

Here we are using crypto for encrypting and decrypting of the JWT token
CRYPTO_SECRET ="as$*[email protected]^(&*asdeaassdod3?)()#[email protected]&SYU" #set your own secret key

For S3 storage

set your aws S3 credential in .env and .env production file
#
# AWS S3 Bucket
#
AWS_ACCESS_KEY_ID="GHTWEDRC4VPO26ASERTY" #your AWS access keyID
AWS_SECRET_ACCESS_KEY="AeADwer+s4ubL1edvcKtgVBverdfgv+hnp272h0j" #your AWS secret access code
AWS_DEFAULT_REGION="uk-west-4" #AWS default region ID
AWS_BUCKET= "name-image" # your AWS bucket name
#
# File Upload System (local or s3)
#
IMAGE_SERVER = "s9" #your aws image server name