A web-based expense tracking and business management platform built for local vendors who operate on paper. LejaSmart digitizes the financial record-keeping process — expenses, inventory, sales, and profit & loss — with role-based access for vendors, accountants, and business owners.
LejaSmart helps local vendors and small business owners replace paper ledgers with a simple web app for tracking expenses, inventory, sales, and profit & loss. It supports three roles (vendor, accountant, owner) and uses PostgreSQL for persistence.
LejaSmart/
├── main.go
├── go.mod
├── README.md
├── db/
├── models/
├── handlers/
├── static/
└── templates/
Clone and run:
git clone https://github.com/yourusername/LejaSmart.git
cd LejaSmart
go mod tidy
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/lejasmart?sslmode=disable
export OWNER_DATABASE_URL=postgres://postgres:postgres@localhost:5432/lejasmart_owner?sslmode=disable
go run main.goVisit http://localhost:8080
The app now uses PostgreSQL. If OWNER_DATABASE_URL is not provided, the app will fall back to DATABASE_URL.
Start the app with local Postgres using Docker Compose:
docker compose up -dThis starts two services:
lejasmartweb apppostgreslocal Postgres server
The Compose setup uses DATABASE_URL and OWNER_DATABASE_URL to connect to two databases on the same Postgres server.
On Render, use a managed Postgres instance and set these environment variables in your service:
LejaSmart uses environment variables for configuration. Create a .env file in the project root for local development.
PORT=8080
DATABASE_URL=postgresql://username:password@hostname/lejasmart_postgres
OWNER_DATABASE_URL=postgresql://username:password@hostname/lejasmart_postgresAdd these in your Render Web Service → Environment tab:
| Key | Description |
|---|---|
PORT |
Port the server listens on (Render sets this automatically) |
DATABASE_URL |
Internal PostgreSQL URL for vendors and accountants database |
OWNER_DATABASE_URL |
Internal PostgreSQL URL for owner database |
Note: For Render deployment, use the Internal Database URL from your PostgreSQL service for
DATABASE_URLandOWNER_DATABASE_URL— it is faster since both services run on Render's network. Use the External Database URL only in your local.envfile.
- Go to your Render dashboard
- Click your PostgreSQL service
- Scroll to the Connections section
- Copy Internal Database URL → use for Render environment variables
- Copy External Database URL → use in your local
.envfile
- Never commit your
.envfile to GitHub — it contains your database password - Confirm
.envis listed in your.gitignore - Reset your database password on Render after sharing it anywhere — go to PostgreSQL service → Settings → Reset Password
If you need to create the databases with psql, run:
psql $DATABASE_URL -f db/create_databases.sqlThen start the app.