High Level Architecture
As a Small or Medium Business or a Developer looking to build the next app, the cost of building and setting the Cloud Infrastructure, Database scalability, Network and Traffic routing, Authorization & Authentication and Permissions framework, is too high. This can take months of development and maintainence efforts.
Securex World makes building, deploying and maintaining applications in cloud Easy. saving Time and Cost.
As a user of Securex World, you can deploy pre-built application and APIs with in minutes and available to use. Also control the usage by scaling up for peak times usage or scheduled a scale down time.
Building Applications
Login to Securex World platform. You can build applications with just few buttons clicks.
You can choose from many pre-built apps or a custom application. It takes few minutes to deploy application and build the traffic routing and encrypt database access. Once ready, you can manage users and other actions from settings page.
Note
API Keys are generated and displayed only Once on the platform. Please take a note and keep it secure.
Manage Application Users
Securex World is built to enable SMB and individual developers to focus on their business and the next idea by providing complex application and infrastructure ready to be deployed in minutes.
As a user on Securex World, you can deploy pre-built application and manage its users and their access. Or bring your own custom application and run at scale.
Add users account on your application
As an application administrator, you can use the application api key to add user account.
POST /account/add
curl --location '${BASE_APP_URL}/account/add' \
--header 'Content-Type: application/json' \
--header 'Authorization: ${API_KEY}' \
--data-raw "{
"email" : "EMAIL_ADDRESS"
}"
This will send an invitation email to EMAIL_ADDRESS to register on your application with account id and temporary one time access key which can be used by user to register to your application. Template of email can be customized.
Note
This action can also be performed from the settings page on securex.world Dashboard.
Note
To disable default registration, set "defaultRegistration" to false. This will block the app user to register from /users/register page and you can build your custom registration logic with rest api as decribed below.
Register for Application
( UI & API based )
Add users account on your application
Registration for application is a two step process.
1. Application administrator sends invite to users from Securex World dashboard. This will send a registration email to respective users with access key.
2. Users of your application can use the one time access key and account id to register. The registration process can either be completed on the UI for the app OR via rest api as below
POST /users/register
curl --location 'https://BASE_APP_URL/users/register' \
--header 'Content-Type: application/json' \
--header 'Authorization: ONE_TIME_KEY' \
--data-raw '{
"email" : "EMAIL_ADDRESS",
"accountId" : "ACCOUNT_ID",
"firstName" : "FIRST_NAME",
"lastName" : "LAST_NAME",
"password" : "PASSWORD"
}'
Once successfull, users of application , can login via REST call to generate Auth Token.
Note
Registration is active with UI and Rest API by default.
Generate Application Token
Registered users of application can generate auth token. Administrator of applications can set access control from App Settings page.
POST /users/token
curl --location 'https://BASE_APP_URL/users/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"email" : "EMAIL_ADDRESS",
"password" : "PASSWORD"
}'
Once successfull, users of application , can login via REST call to generate Auth Token.
Create DB Schema
Registered users of application can generate auth token. Administrator of applications can set access control from App Settings page.
POST /db/schema
curl --location 'https://BASE_APP_URL/db/schema?userName=USERNAME' \
--header 'Content-Type: application/json' \
--header 'Authorization: BEARER_TOKEN' \
--data '{
"schemaName" : "DB_SCHEMA_NAME",
"schemaDetails" : [
{
"name" : "COLUMN_NAME",
"type" : "COLUMN_TYPE"
}
],
"index" : [
{
"name" : "COLUMN_NAME",
"type" : "INDEX_TYPE"
}
]
}'
schemaName* - (String) Name of the schema. This is mandatory field.
schemaDetails* - (List) All column names. This is mandatory field.
COLUMN_NAME - (String) unique name for the column.
COLUMN_TYPE - (String) Column Type. Supported Values are
- string
- array ( This starts with ["ABC","XYZ"] )
- number
- boolean
- object ( This starts with { "key" : "value" } )
- date ( For every row, you get 'created' and 'Last modified' dates by default )
- pointer ( This is a pointer to another row for quick reference and retrieval. More details on this later)
index - (List) All column indexes. This is an optional field.
INDEX_TYPE - (String) Supported Values are
- asc
- desc
Note - we create default indexes on every create DB request.
USERNAME - Username of the user requesting the operation. This can be retrieved with token generation call as described here.
Update DB Schema
Any existing DB Schema's can be updated to "add" more column.
Any existing column with data cannot be update
PUT /db/schema
curl --location --request PUT 'https://BASE_APP_URL/db/schema?userName=USERNAME' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer BEARER_TOKEN' \
--data '{
"schemaName" : "DB_SCHEMA_NAME",
"schemaDetails" : [
{
"name" : "COLUMN_NAME",
"type" : "COLUMN_TYPE"
}
]
}'
schemaName* - (String) Name of the schema. This is mandatory field.
schemaDetails* - (List) All column names. This is mandatory field.
COLUMN_NAME - (String) unique name for the column.
COLUMN_TYPE - (String) Column Type. Supported Values are
- string
- array ( This starts with ["ABC","XYZ"] )
- number
- boolean
- object ( This starts with { "key" : "value" } )
- date ( For every row, you get 'created' and 'Last modified' dates by default )
- pointer ( This is a pointer to another row for quick reference and retrieval. More details on this later)
USERNAME - Username of the user requesting the operation. This can be retrieved with token generation call as described here.
index - (List) All column indexes. This is an optional field.
INDEX_TYPE - (String) Supported Values are
- asc
- desc
Note - we create default indexes on every create DB request.
Get DB Schema
Any existing DB Schema's can be updated to "add" more column.
But an existing column with data cannot be update
GET /db/schema
curl --location 'https://BASE_APP_URL/db/schema?schemaName=DB_SCHEMA_NAME&userName=USERNAME' \
--header 'Authorization: Bearer BEARER_TOKEN
DB_SCHEMA_NAME - (String) Name of the schema to retrieve. Replace this field with -1 to fetch all the available schema names.
USERNAME - Username of the user requesting the operation. This can be retrieved with token generation call as described here.
Add Data
Adding data to schema is a rest api call that takes a list of records and authenticates, authorizes every insert. Data added by one user will not be available to other users for the same applications. Access can be amended by original user.
POST /db/data
curl --location 'https://BASE_APP_URL/db/data?userName=USERNAME' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer BEARER_TOKEN' \
--data '{
"schemaName" : "DB_SCHEMA_NAME",
"data" : [
{
"COLUMN_NAME" : "VALUE",
....
}
......
],
"uniqueCheck" : true
}'
DB_SCHEMA_NAME - (String) Name of the schema to retrieve. Replace this field with -1 to fetch all the available schema names.
data - (list) List of records. column name and value must match for the schema.
USERNAME - Username of the user requesting the operation. This can be retrieved with token generation call as described here.
uniqueCheck - Boolean field to check if any of the records in list already exists, if so, a duplicate entry will not be made. Defaults to true
Get Data
Data retrieval is secure based on the authenticated user. i.e if two users added similar data set then on retrieval only one data entry is retrieved to schema is a rest api call that takes a list of records and authenticates, authorizes every insert. Data added by one user will not be available to other users for the same applications. Access can be amended by original user.
GET /db/data
curl --location 'https://BASE_APP_URL/db/data?schemaName=DB_SCHEMA_NAME&userName=USERNAME&COLUMN_NAME=COLUMN_VALUE' \
--header 'Authorization: Bearer BEARER_TOKEN'
DB_SCHEMA_NAME - (String) Name of the schema to retrieve data.
USERNAME - (String) Username of the user requesting the operation. This can be retrieved with token generation call as described here.
COLUMN_NAME - Provide multiple parameters to filter data on.
Note : when searching for number value in COLUMN_VALUE field, add an 'i', so to search 1234, it should i1234 in COLUMN_VALUE field.
Patch Data
Update existing data operation. This w delete is done based on unique 'id' that's returned with every GET. Pass the 'id' in parameters to delete. If the user is authorized to delete, the data will be deleted.
PATCH /db/data
curl --location --request PATCH 'https://BASE_APP_URL/db/data?userName=USERNAME' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer BEARER_TOKEN' \
--data '{
"schemaName" : "DB_SCHEMA_NAME",
"data" : [
{
"id" : "DATA_ID",
"COLUMN_NAME" : "VALUE"
...
}
],
"uniqueCheck" : true
}'
DB_SCHEMA_NAME - (String) Name of the schema to retrieve data.
USERNAME - (String) Username of the user requesting the operation. This can be retrieved with token generation call as described here.
DATA_ID - Unique data id to delete the data. This can be retrieved as a part of this call.
Delete Data
Data delete is done based on unique 'id' that's returned with every GET. Pass the 'id' in parameters to delete. If the user is authorized to delete, the data will be deleted.
DELETE /db/data
curl --location --request DELETE 'https://BASE_APP_URL/db/data?schemaName=DB_SCHEMA_NAME
&userName=USERNAME&id=DATA_ID' --header 'Authorization: Bearer BEARER_TOKEN'
DB_SCHEMA_NAME - (String) Name of the schema to retrieve data.
USERNAME - (String) Username of the user requesting the operation. This can be retrieved with token generation call as described here.
DATA_ID - Pass in a comma separated unique data id to delete the data. This can be retrieved as a part of this call. Eg. 4tDLc631gy,RLhAUpxvJN
Drop DB Schema
Dropping schema is irreversible action. You can only drop an empty schema and this operation will fail if there's data available in schema.
DELETE /db/schema
curl --location --request DELETE 'https://BASE_APP_URL/db/schema?schemaName=DB_SCHEMA_NAME
&userName=USERNAME&id=DATA_ID' --header 'Authorization: Bearer BEARER_TOKEN'
DB_SCHEMA_NAME - (String) Name of the schema to retrieve data.
USERNAME - (String) Username of the user requesting the operation. This can be retrieved with token generation call as described here.