Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 2.5 KB

File metadata and controls

78 lines (59 loc) · 2.5 KB

Developer Guide

Repository Layout

frontend/   React + Vite SPA
backend/    Go API + SQLite persistence

Prerequisites

  • Node.js ≥ 20, npm ≥ 10
  • Go ≥ 1.23
  • Local MinIO/S3 endpoint (optional but required for presign/upload tests)

Frontend

cd frontend
npm install
npm run dev      # Vite dev server
npm run build    # tsc -b + vite build
npm run test     # Vitest

Key files:

  • src/api/backend.ts – REST helpers + caching.
  • src/lib/crypto.ts / src/lib/e2ee.ts – client-side crypto primitives.
  • vite.config.ts – React plugin + base path (customizable via VITE_BASE_PATH).
  • vitest.config.ts – isolated test configuration.

Backend

cd backend
go test ./...
go run ./cmd/server

Environment variables:

Variable Purpose
ENTEGRAM_ADDR HTTP listen address (default :8080)
ENTEGRAM_DB_PATH SQLite path (default entegram.db)
ENTEGRAM_ENV test switches to test buckets + stricter limits
ENTEGRAM_S3_BUCKET Primary upload bucket
ENTEGRAM_S3_TEST_BUCKET Bucket used under test
ENTEGRAM_S3_REGION AWS region (defaults to us-east-1)
ENTEGRAM_S3_ENDPOINT Custom endpoint (e.g., http://localhost:9000)
ENTEGRAM_S3_FORCE_PATH_STYLE Set to 1 for MinIO

Set AWS credentials for MinIO/S3 compatibility:

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...

API Surface (current)

  • Auth: POST /api/register, POST /api/login
  • Uploads: POST /api/uploads/presign
  • Follow graph: POST /api/follow/request, GET /api/follow/requests, POST /api/follow/approve, POST /api/follow/reject, POST /api/follow/unfollow, GET /api/follow/shares
  • Walls: POST /api/walls/bio
  • Posts: POST /api/posts, GET /api/posts, DELETE /api/posts/{id}, POST /api/posts/{id}/like, GET /api/assets/redirect
  • Community: GET /api/community

Testing Notes

  • Integration tests spin up temporary SQLite files and exercise full flows (registration, multi-device login, follow approvals, post creation, like toggling).
  • For presigned URL tests, configure ENTEGRAM_S3_TEST_BUCKET and point ENTEGRAM_S3_ENDPOINT to your local MinIO cluster at http://localhost:9000.

House Rules

  • Never commit database files, binaries, or build artifacts (covered by .gitignore).
  • Always drop/reset dev databases before/after feature spikes, per hackathon guidance.
  • Every frontend screen must show the “Made by ente.io” banner linking to https://ente.io/?utm_source=entegram.