Step 1: Install Godspeed CLI
# Install the Godspeed CLI globally
npm install -g @godspeedsystems/cli
This package will install "Godspeed" on your machine.
Step 2: Create a New Godspeed Project
# Create a new Godspeed project
godspeed create <projectName>
Choose one of the following options to proceed, and it will guide you through the prerequisites:
Step 3: Initialize Project
If you choose a Greenfield project:
- Use Godspeed to create the project.
- Install necessary plugins, e.g., Express for HTTP.
- Capture a screenshot of the project creation.
- Open the project in Visual Studio Code (VSCode).
Step 4: Event Handling
Implement HTTP and Kafka event handling:
HTTP events:
# HTTP Event Handling
'http.post./set-redis':
fn: set-redis
body:
content:
application/json:
schema:
type: object
properties:
name:
type: string
required: ['name']
responses:
200:
content:
application/json:
schema:
type: object
properties:
name:
type: string
Kafka events:
# Kafka Event Handling
kafka.kafka_topic.kafka_groupId:
id: kafka__consumer
fn: kafka_con
body:
description: The body of the query
content:
application/json:
schema:
type: string
Step 5: Data Validation
Implement validation for request body, parameters, and response.
Step 6: Workflow Setup
Define your project workflow, including tasks such as:
- Data source integration with Kafka:
id: hello_world_function
summary: Call an API and transform the
tasks:
- id: transform_fn_step1
description: add a message property
fn: com.gs.switch
value: <% inputs.body.name %>
cases:
'ashutosh':
- id: case_ashutosh
fn: com.gs.return
args: |
<% return { name: "Hello Ashutosh!" } %>
'shubham':
- id: case_shubham
fn: com.gs.return
args: |
<% return { name: "Hello Shubham!" } %>
- Utilize inbuilt functions as needed.
- Implement caching mechanisms.
Step 7: JavaScript Integration
- id: step1
description: upload documents
fn: com.gs.http
args:
datasource: httpbin
params:
data: |
<js% {
[inputs.body.entity_type + 'id']: inputs.body.entity_id,
_.omit(inputs.body, ['entity_type', 'entity_id'])}
%>
Step 8: CRUD API Generation
# Generate CRUD APIs
godspeed generate crud-api
Step 9: Front-end Generation
Generate the front-end components as needed for your project.
# Generate UI components
godspeed generate ui
Step 10: Argo CD Installation
Install Godspeed's Argo CD plugin for continuous deployment.
Step 11: Deployment
Use Godspeed to deploy your project using Argo CD or other deployment tools.