Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BACKEND_URL=http://localhost:8000
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*
.env
.env.*
!.env.example

# vercel
.vercel
Expand Down
134 changes: 116 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,134 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
# Kaapi-Frontend

## Getting Started
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
![GitHub issues](https://img.shields.io/github/issues-raw/ProjectTech4DevAI/kaapi-frontend)
[![Discord](https://img.shields.io/discord/717975833226248303.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/BRYzSYha)

First, run the development server:
This is a thin frontend UI for [Kaapi backend](https://github.com/ProjectTech4DevAI/kaapi-backend) — a platform that acts as a middleware layer, enabling platforms like Avni, Glific, and Dalgo to seamlessly integrate AI functionality.

---

## 📋 Table of Contents

- [Pre-requisite](#pre-requisite)
- [Software Dependencies](#software-dependencies)
- [npm (via asdf)](#npm-via-asdf)
- [Kaapi Backend](#kaapi-backend)
- [Clone Frontend Repo](#clone-frontend-repo)
- [Git commands to clone](#git-commands-to-clone)
- [Installation](#installation)
- [Start frontend server](#start-frontend-server)
- [Available Scripts](#available-scripts)
- [Deploying Release on EC2 with CD](#deploying-release-on-ec2-with-cd)
- [Learn More](#learn-more)

---

## Pre-requisite

### Software Dependencies

#### npm (via asdf)

```bash
asdf plugin-add nodejs
asdf install
```

## Clone Frontend Repo

### Git commands to clone

```bash
git clone git@github.com:ProjectTech4DevAI/kaapi-frontend.git
```

---

### Kaapi Backend

You need to set up the [Kaapi backend](https://github.com/ProjectTech4DevAI/kaapi-backend) service and follow the instructions there.

> 💡 Note: Ensure the backend is running and accessible before starting the frontend.

### Kaapi Guardrails Service _(coming soon)_

The Guardrails UI (currently in development) will require the Kaapi Guardrails service to be running alongside the backend. Setup instructions will be added here once the service is available.

> 🚧 No action needed for now — this is a placeholder for when the Guardrails feature lands in `main`.

---

## Installation

1. Copy `.env.example` to `.env` in the project root:

```bash
cp .env.example .env
```

2. **Do not modify `.env`** unless absolutely required.
3. Install dependencies:

```bash
npm install
# or
yarn
```

---

### Start frontend server

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Visit `http://localhost:3000` to open the app.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
## Available Scripts

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
```bash
npm install # Install dependencies
npm run dev # Run app in development mode
npm run build # Create optimized production build
npm run start # Start the production server
npm run lint # Run ESLint
```

## Learn More
---

## Deploying Release on EC2 with CD

Deployments are automated via a GitHub Actions CD pipeline that SSHes into the EC2 instance, pulls the latest code, builds, and restarts the server.

To learn more about Next.js, take a look at the following resources:
### Branch Strategy

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
| Branch | Environment |
| --------- | ----------- |
| `main` | Staging |
| `release` | Production |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think we follow this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are planning to follow this approach once the automation deployment is merged, as discussed in the issue comments. That’s why I’ve added it here as well.

Copy link
Contributor

@AkhileshNegi AkhileshNegi Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean we dont create branch named release, we create a new release. so column name branch is misleading

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, both staging and production are using the same branch. Once the automation deployment is set up, any push to main would directly get deployed to production as well.

To avoid this, the idea was to keep main and release branch separate. This way, any changes pushed to main will go to staging, and whenever we want to deploy to production, we can sync main with release brach. After merging, the release branch will then be used for production deployment.

We’re planning to merge the automation PR soon, so I had updated the README accordingly.


You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
### Pipeline Steps

On every push to `main` or `release`, the pipeline automatically:

1. SSHes into the EC2 instance
2. Runs `git pull` to fetch the latest code
3. Runs `npm run build` to create an optimized production build
4. Restarts the server to apply the new build

---

## Learn More

## Deploy on Vercel
- 🌐 [Kaapi](https://projecttech4dev.org/kaapi/)
- 📄 [One Pager](https://docs.google.com/document/d/15ulZt-tNnMlK3jjk2Ey2FfJ6Q3iX_8O3qfBE7Lt0spY/edit?usp=sharing)
- 📄 [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- 📄 [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
### Chat With Us

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
- 💬 [Discord](https://discord.gg/BRYzSYha)