Write. Discover. Discuss. Connect. CrossRoad is an open-source space for publishing articles and discussing ideas. The repository contains a working fullstack slice and a separate static demo. It is an active rebuild, not a complete community platform.
The editorial UI uses a cobalt and coral palette, large reading typography, and responsive layouts for desktop and mobile. Readers can search articles and filter by popular topics directly above the feed. The interface includes light and dark themes; the selected theme is saved in the browser.
Article pages keep the reading column focused and place discussion below the story. The writing screen shows field guidance and character counts. Keyboard users have a skip link and visible focus states, and motion is reduced when requested by the operating system. The demo browser tests cover a 320 px viewport and theme persistence; they do not constitute a full accessibility audit.
- Read published articles, search their text, authors and tags, comment, and save bookmarks.
- Register and sign in in fullstack mode. Passwords use scrypt; short-lived access JWTs are kept in browser memory. Rotating refresh tokens are hashed in PostgreSQL and sent only as HttpOnly cookies. Server checks ownership for drafts and comments.
- Create a draft, edit it with a version check, and publish it. The first editor stores plain text safely; rich text is on the roadmap.
- Run the same reader and writing flow as an explicit browser-only demo on GitHub Pages. Demo writes remain on the current device and are not accounts or server data.
- Export compatible
crossroad.posts.v2records as JSON and raw demo data as text without deleting or uploading either key.
The larger product brief includes follows, communities, recommendations, moderation, notifications, rich text, profiles, and analytics. Those are not implemented yet; see the prioritized roadmap.
| Area | Current implementation |
|---|---|
| Web | React 18, TypeScript, Vite, React Router, TanStack Query, local font assets |
| API | NestJS 11, REST, Zod validation, Swagger, Pino request logs |
| Data | PostgreSQL, Prisma 6 migrations, full text index |
| Tests | Vitest, isolated PostgreSQL integration runner, Playwright demo flow |
| Delivery | pnpm workspace, Docker Compose files, GitHub Actions demo deployment |
apps/web contains routes and both repository adapters; apps/api owns persistence and authorization; packages/contracts holds shared validation and response types. Architecture explains the boundaries.
Requires Node.js 22.12+ and pnpm 10.34.4.
pnpm install --frozen-lockfile pnpm build:demo pnpm --filter @crossroad/web preview
Open http://localhost:4173. During development, pnpm dev serves the demo at http://localhost:5173 by default. The browser stores demo records under crossroad.demo.v3.
- Create
.envfrom.env.example; set a randomSESSION_SECRETof at least 32 bytes and a unique database password. Never commit.env. - Start PostgreSQL 16 and set
DATABASE_URLfor that instance. - Run:
pnpm install --frozen-lockfile pnpm db:generate pnpm db:migrate pnpm build pnpm dev:api
In another terminal, run pnpm dev:api-web. The root .env supplies the API URL and mode. The API is at http://localhost:3000; API docs are at /docs.
docker compose up --build is also configured for a local fullstack stack at http://localhost:8080 after .env is set. Docker was unavailable in the audit environment, so this Compose path still needs an external smoke test. See deployment notes.
pnpm lint
pnpm format:check
pnpm typecheck
pnpm test
pnpm test:integration
pnpm test:e2e
pnpm test:fullstack
pnpm build
pnpm check:budgetThe typecheck command builds shared contracts before checking the API and web packages, so it works after a clean checkout. The integration command starts an isolated PostgreSQL instance, applies the migration, starts the compiled API, and exercises the main flow. The E2E command checks the static demo in Chromium. test:fullstack runs the API and browser together against isolated PostgreSQL. See testing.
- Audit and baseline
- Development
- Architecture decisions
- API reference
- Roadmap
- Contributing, security, code of conduct
Code retains its MIT license. Existing sample content retains CC-BY-NC-SA-4.0.
