DEV Community

Cover image for Village Square: A Tiny Go‑Powered Hub for My Rural Community
Karlis
Karlis

Posted on • Edited on

Village Square: A Tiny Go‑Powered Hub for My Rural Community

DEV Weekend Challenge: Community

This is a submission for the DEV Weekend Challenge: Community

The Community

I built Village Square for my own rural village community.
Most people are neighbors, small local producers (fishermen, farmers, crafters), and families who meet several times a year, especially during our annual Village Day.

Right now, coordination happens through word of mouth, scattered chat groups, and printed posters. It’s easy to miss who is selling what, which events are happening when, or who needs help with something practical. Village Square tries to give us one simple place to share offers, requests, and Village Day activities.

What I Built

Village Square is a small community web app that acts like a digital village square. Logged‑in villagers can:

  • Register and log in with a simple account.
  • Post offers, requests, and announcements (e.g., fresh fish, potatoes, help with a fence, road closure).
  • Filter the feed by type and category (fish, produce, crafts, services, other).
  • Use a dedicated Village Day view to see garage sales, sports, and gatherings in a time‑based timeline. ​

For the challenge, I focused on a clean, mobile‑friendly interface and realistic seeded data so it feels like a real village snapshot rather than an empty prototype.

It’s a single Go + SQLite binary that can run on a small VPS or services like Google Cloud Run.

Demo

Here’s a short intro video of Village Square in action (login, feed, and Village Day screens):
https://github.com/user-attachments/assets/cd99a68b-b613-4101-8467-571a12c5924e

You can also run it locally:

Code

The full source code is on GitHub:

GitHub logo AcaciaMan / village-square

Digital village square for local announcements, garage sales, and connections between neighbors and suppliers.

Village Square

A community web app for a rural village — connecting villagers, local producers (fishermen, farmers, crafters), and the yearly Village Day celebration.

Built with Go (stdlib only) + SQLite + plain HTML/CSS/JS — no frameworks, no build step.

Short introduction video https://github.com/user-attachments/assets/cd99a68b-b613-4101-8467-571a12c5924e

Quick Start

# Prerequisites: Go 1.22+, GCC (for SQLite cgo)

# Clone and build
git clone https://github.com/<you>/village-square.git
cd village-square
go build -o village-square.exe .

# Seed with demo data (8 users, 18 posts, 6 events)
./village-square.exe --seed

# Start the server
./village-square.exe
# → http://localhost:8080
Enter fullscreen mode Exit fullscreen mode

Demo login: jan@village.nl / jan123 (or any seeded user — see db/seed.go)

Features

Phase 1 — Foundation & Auth

  • User registration and login with bcrypt-hashed passwords
  • Server-side sessions via secure HttpOnly cookies
  • Auth guard on protected pages (auto-redirect if not logged in)
  • GET /api/me returns the current user

Phase 2 — Posts & Marketplace

  • Create, view…

How I Built It

I wanted to keep the stack minimal and approachable for small communities to self‑host, so I went with:

  • Backend: Go standard library (net/http, database/sql, crypto/rand, bcrypt) with a small handler + middleware structure.
  • Database: SQLite via github.com/mattn/go-sqlite3, with migrations and a seeding command that creates demo users, posts, and Village Day events.
  • Frontend: Plain HTML, CSS, and vanilla JavaScript served from a /static folder (no frameworks, no build step).
  • Auth: Email + password with bcrypt hashing and server‑side session tokens stored in HttpOnly cookies, plus an auth guard for the dashboard and Village Day pages. ​

I structured the work in phases: foundation/auth, posts & marketplace, Village Day events, and finally polish/hardening (shared CSS/JS, toast notifications, responsive layout, logging, and limits). That made it achievable within a weekend while still feeling like a complete, coherent app for my village.

Since I had a bit more time, I didn’t just build a marketplace—I also added small features that nudge villagers to talk and help each other, like the new ‘I’m interested / I can help’ buttons.

Top comments (0)