Mapit is an open-source mapping tool that makes it easy for organizers to manage and share points-of-interest for their events.
Mapit is built with Go 1.19, Next.js 12, and Protocol Buffers v3. The client offers a highly interactive map using Leaflet and map tiles from OpenStreetMap. Client-server communication is handled by Connect to generate gRPC APIs. The server talks to a Supabase instance running PostgreSQL. It uses Ent to manage migrations and perform simple CRUD operations. Authentication is managed by Supabase as well, providing easy integration within both the client and server. Mapit employs the Nominatim geocoding service for address lookup and caches results in Redis.
The ./server
directory contains a .env
file which holds PostgreSQL and Redis connection info. You can get the PostgreSQL info from Supabase. It's important that Supabase must be used because Mapit depends on it for authentication.
Mapit can use any Redis instance. We currently use an Upstash free tier.
The ./client
directory contains a .env.local
file which holds Supabase connection info for authentication.
Command | Description |
---|---|
buf lint |
Lint all protocol buffer files |
yarn gen-proto |
Generate the latest client code based on the protobuf files |
Command | Description |
---|---|
migrate create -ext sql -dir db/migrations -seq <MIGRATION_NAME> |
Creates empty up and down migration files |
go generate ./ent |
Generates DB client and applies migrations |
go run main.go |
Starts the server on port 8080 |
flyctl deploy |
Deploy the latest code to fly.io |
Command | Description |
---|---|
yarn dev |
Starts the client on port 3000 |
ANALYZE=true yarn build |
Build and analyze the client bundle |
Command | Description |
---|---|
yarn build |
Build the mapit-embed package |
yarn publish |
Publish the latest build to NPM |