Skip to content

Tedev555/laobrt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BRT Vientiane

Bus Rapid Transit information app for the Dongdok–Talat Sao corridor in Vientiane, Laos.

Tech Stack

  • Backend: Go (net/http, pgx)
  • Frontend: Next.js, React, TypeScript, Tailwind CSS
  • Database: PostgreSQL 16

Prerequisites

Quick Start

# Install frontend dependencies (first time only)
cd frontend && npm install && cd ..

# Start everything (database, migrations, backend, frontend)
./dev.sh

Manual Setup

# Start database
docker compose up -d db

# Run migrations
cd backend && go run cmd/migrate/main.go up

# Start backend
cd backend && go run cmd/server/main.go

# Start frontend (in another terminal)
cd frontend && npm run dev

API Endpoints

Method Path Description
GET /api/health Health check
GET /api/stations List all stations
GET /api/stations/{id} Get station by ID
GET /api/schedules List all schedules

Project Structure

├── backend/
│   ├── cmd/
│   │   ├── server/          Entry point
│   │   └── migrate/         Migration runner
│   ├── internal/
│   │   ├── config/          Environment config
│   │   ├── database/        Connection pool
│   │   ├── handler/         HTTP handlers
│   │   ├── model/           Data structs
│   │   └── repository/      Database queries
│   └── migrations/          SQL migrations
├── frontend/
│   ├── app/                 Next.js pages
│   ├── components/          React components
│   └── lib/                 API client & types
├── docker-compose.yml       PostgreSQL
├── dev.sh                   Start everything
└── Makefile                 Individual commands

Configuration

Copy .env.example to .env and adjust as needed:

DATABASE_URL=postgres://brt:brt_dev_password@localhost:5435/brt_vientiane?sslmode=disable
BACKEND_PORT=8080
NEXT_PUBLIC_API_URL=http://localhost:8080

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors