Spurtcommerce
DocumentAPI ReferenceAdd-ons
Docs
Docs
  • Overview
  • Getting Started
    • Introduction
    • Prerequisites
      • Server Configuration (Minimal)
      • Set up development environment
    • Development and Setup
      • API Setup
      • Environment Configuration
      • Store Front Setup
        • Angular Store Front
        • React Store Front
        • Flutter store front
      • Angular Admin Setup
      • Angular Vendor Setup
  • API Deployment and Setup
    • Deployment From Source Code
    • Deployment From Docker
    • Troubleshooting
  • Frontend Deployment Setup
    • Store Front Setup
      • React Store Front
      • Angular Store Front
      • Flutter Store Front
      • Troubleshooting
  • Front End Angular Admin Setup
    • Angular Admin
    • Troubleshooting
  • Front End Angular Vendor Setup
    • Angular Vendor
    • Troubleshooting
  • For Developers
    • Architecture
      • Back End API Architecture
      • Front-end Architecture
      • Technology stack
    • Performance
      • Benchmark
      • Image Optimzation
      • Load Balancing
      • RabbitMQ
      • Clustering
      • Database Load Balancing
    • Security
    • Testing Reports
      • Unit Testing Report
      • E2E Test Report
      • Vulnerability Test Report
        • Spurt Admin Report
        • Spurt Store Report
        • Spurt Vendor Report
      • Functional Test Report
  • How to Guides
    • Store Language Setup
    • Addon Management
    • Spurtcommerce Microservices Deployment
Powered by GitBook
On this page
  • Mail Configuration
  • Environment Variables
  • Database Configuration
  • JWT Configuration
  • Crypto Configuration
  • For S3 storage
  1. Getting Started
  2. Development and Setup

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="spurt123@gmail.com"    #--Your Email Id
MAIL_PASSWORD= "spurt123&"           #--Your Email Password 
MAIL_PORT=465
MAIL_SECURE=true
MAIL_ENCRYPTION=tls
MAIL_FROM="Test-noreply@gmail.com"

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:2345@#$%678$%^&*abndutyth89?)()#$@&naagw) for this variable.

JWT token for authorization will be created with help of this secret key.

JWT_SECRET = "2345@#$%678$%^&*abndutyth89?)()#$@&naagw"   #set your own secret key

Crypto Configuration

Here we are using crypto for encrypting and decrypting of the JWT token

CRYPTO_SECRET ="as$*908wert3@^(&*asdeaassdod3?)()#$@&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 = "s3"          #your aws image server name

set the below urls in .env file.

# after payment success, it will redirect to order list page of react store
STORE_URL = http://localhost:3000/account/myorders
# after payment cancel, it will redirect to home page of react store
CANCEL_URL = http://localhost:4205/
# its is api base url
BASE_URL = http://localhost:8000
# In email template redirection to store
STORE_REDIRECT_URL= https://localhost:3000/
# In email template redirection to admin
ADMIN_REDIRECT_URL= https://localhost:4200/
# In email template redirection to vendor
VENDOR_REDIRECT_URL= https://localhost:5000/
# image resize url
IMAGE_URL= https://localhost:8000/api/media/image-resize/
# Store forget password link
STORE_FORGET_PASSWORD_URL = http://localhost:3000/setPassword/
# Vendor forget password link
FORGET_PASSWORD_URL= http://localhost:5000/#/auth/set-password/

PreviousAPI SetupNextStore Front Setup

Last updated 6 months ago