Reddit-like web forum with a React (TypeScript) frontend and a Go (Gin) backend.
- Node.js 18+ and npm
- Go 1.21+
- PostgreSQL (local or hosted)
frontend/- React + Vite appbackend/- Go API server
- Create
backend/.env:
PORT=3000 # or port of your choice
SECRET=<Secret> # JWT secret
DB_URI=<SUPABASE_SESSION_POOLER_CONN_STRING>
# Ex: DB_URI=postgresql://<user>:[YOUR-PASSWORD]@host:<port>/<database>- Run database migrations:
cd backend
go run migrate/migrate.go- Start the API server:
cd backend
go run main.goThe server will start on the default Gin port (usually :8080).
- Install dependencies:
cd frontend
npm install- Create
frontend/.env:
VITE_BACKEND_URL=<BACKEND_URL>- Start the dev server:
cd frontend
npm run devFor more details on linting and building go to the README in the frontend folder
- API routes are listed in
backend/README.md. - The frontend API client is configured in
frontend/src/auth/client.ts. - CORS is configured in
backend/main.gofor local and deployed frontend origins.