Skip to content

chamals3n4/iwb25-075-octopipers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NomadPage

NomadPage is a platform designed to support digital nomads who plan to live and work from Sri Lanka. Our goal is to create a centralized hub for all the resources nomads need. This project was developed for the Innovate with Ballerina 2025 competition.

Tech Stack

Frontend: Next.js 15, Tailwind CSS, Shadcn/ui
Backend: Ballerina, PostgreSQL, AWS S3
Additional Services: Flask, BeautifulSoup4 (for news scraping)

Prerequisites

Before you start, make sure you have installed:

Setup Process

1. Clone the forked repository

git clone https://github.com/{username}/iwb25-075-octopipers.git
cd iwb25-075-octopipers

2. Backend Setup (Ballerina Service)

2.1 Configure PostgreSQL

  1. Create a new PostgreSQL database (or Supabase project).
  2. Run the schema file to create tables:
service/resources/schema.sql

2.2 Configure External Services

  • AWS S3 → Create a bucket, IAM user, and note down credentials.
  • Perplexity API → Get your API key from perplexity.ai.
  • OpenWeather API → Get your API key from openweathermap.org.

2.3 Create Config.toml

In the service/ root directory:

[service.utils]
dbHost = "database-host"
dbUser = "database-username"
dbPassword = "database-password"
dbPort = 5432
dbName = "database-name"
accessKeyId = "aws-access-key"
secretAccessKey = "aws-secret-key"
region = "aws-region"
bucketName = "s3-bucket-name"

[service.city_guide]
perplexityApiKey = "perplexity-api-key"

[service.tools]
openWeatherApi = "openweathermap-api-key"

2.4 Run Backend

cd service
bal run

Backend available at: http://localhost:8080

3. Frontend Setup (Next.js)

3.1 Install Dependencies

cd webapp
npm install

3.2 Configure Asgardeo Authentication

  1. Create a new app in Asgardeo Console.
  2. Collect:
    • Client ID
    • Client Secret
    • Organization Name
    • Application Name
  3. Create a .env.local file in webapp/:
AUTH_SECRET=your-secret-key

ASGARDEO_CLIENT_ID=your-client-id
ASGARDEO_CLIENT_SECRET=your-client-secret
AUTH_ASGARDEO_ISSUER="https://api.asgardeo.io/t/{yourorgname}/oauth2/token"

NEXT_PUBLIC_AUTH_ASGARDEO_LOGOUT_URL="https://api.asgardeo.io/t/{yourorgname}/oidc/logout"
NEXT_PUBLIC_AUTH_ASGARDEO_POST_LOGOUT_REDIRECT_URL="http://localhost:3000/auth/sign-out"
  1. Configure Backend Authentication - In your service.bal file, update the JWT validator configuration:
auth: [
    {
        jwtValidatorConfig: {
            issuer: "https://api.asgardeo.io/t/{yourorgname}/oauth2/token",
            audience: ["your-client-id"],
            signatureConfig: {
                jwksConfig: {
                    url: "https://api.asgardeo.io/t/{yourorgname}/oauth2/jwks"
                }
            }
        }
    }
]

3.3 Run Frontend

npm run dev

Frontend available at: http://localhost:3000

4. News Scraper Setup (Flask + BeautifulSoup4)

This service scrapes latest news from newswire.lk and provides live updates.

cd newswired
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate

pip install -r requirements.txt
python app.py

News scraper runs at: http://localhost:5000/latest-news


Running the Application

  • Backend (Ballerina): http://localhost:8080
  • Frontend (Next.js): http://localhost:3000
  • News Scraper (Flask): http://localhost:5000/latest-news
  • WebSocket Services: ws://localhost:9091 (incidents), ws://localhost:9090 (chat)

Features

  • City Rank - Rankings and insights for Sri Lankan cities
  • Incident Report Map - Report and view local incidents
  • Meetups - Connect with local groups and communities
  • Find Remote Jobs - Search and apply for online opportunities
  • Co-working Places - Discover work-friendly spaces
  • Utility Tools - Currency conversion, time zones, weather, and latest news

Ballerina capabilities we used

  • HTTP - RESTful API endpoints with resource functions
  • WebSocket - Real-time bidirectional communication for chat , meetups and incidents
  • PostgreSQL Connector - Database connectivity with connection pooling
  • AWS S3 Connector - Cloud storage integration for file uploads
  • JWT Authentication - Service-level JWT validation with WSO2 Asgardeo OIDC
  • External HTTP Client - Integration with weather, currency, and AI APIs
  • Modular Architecture - Organized service modules with proper separation of concerns

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •