ArtHub is a local discussion app for ART Analytics.
The domain model is:
Companies -> Posts -> Comments
Each discussion stream is anchored to a company record with a unique ticker. Users browse companies, open a company page, and discuss the company through posts and comments.
- Backend: Go,
net/http, SQLite - Frontend: Vue 3, TypeScript, Vite
- Routing:
vue-router - Testing: Go
testing, Vitest
Run the backend and frontend in two terminals.
cd backend
go mod download
go run main.goDefault backend URL: http://localhost:8080
The backend creates a local SQLite database at backend/data/arthub.db by default.
Optional backend environment variables:
PORT: backend port. Default:8080DB_PATH: SQLite database path. Default:data/arthub.dbARTHUB_ALLOWED_ORIGINS: comma-separated frontend origins allowed by CORS. Default:http://localhost:3000,http://127.0.0.1:3000ARTHUB_COOKIE_SECURE: set totrueonly when serving over HTTPS. Default:falseARTHUB_COOKIE_SAMESITE:lax,strict, ornone. Default:lax
cd frontend
npm install
npm run devDefault frontend URL: http://localhost:3000
The checked-in local example and local .env point the frontend at:
VITE_API_BASE_URL=http://localhost:8080
cd backend
go test ./...cd frontend
npm run build
npm testPOST /auth/signupPOST /auth/loginPOST /auth/logoutGET /auth/meGET /companiesPOST /companiesGET /companies/:idPUT /companies/:idDELETE /companies/:idGET /companies/:id/postsPOST /companies/:id/postsGET /posts/:idPUT /posts/:idDELETE /posts/:idGET /posts/:id/commentsPOST /posts/:id/commentsPOST /posts/:id/voteDELETE /posts/:id/vote
Successful responses use:
{ "data": "..." }Error responses use:
{ "error": { "message": "...", "code": "..." } }- Sign up and confirm the session is restored on refresh.
- Create a company with a ticker and name.
- Edit the company.
- Create a post under that company.
- Sort company posts by
TopandNew. - Page through company posts.
- Vote on a post.
- Add a comment to the post.
- Delete the post and confirm navigation returns to the company page.
- Delete the company and confirm it disappears from the company list.