Foo Rum

A Next.js forum application built as a frontend hiring assignment for Atlys. Features in-memory mock database with login and signup functionality and unit tests. Note: the DB resets to its initial state on page reload. Built with Next.js and TypeScript.

Foo rum Screenshot

Foo Rum is a forum web application developed as a frontend hiring assignment for Atlys. Built with Next.js and TypeScript, it demonstrates a clean, production-minded approach to building interactive, multi-page applications with modern tooling and strong type safety.

The application features an in-memory mock database that powers user authentication — including login and signup flows — as well as forum content. This approach keeps the project self-contained and dependency-light, making it straightforward to run and evaluate without any external backend or database setup.

A suite of unit tests is included to validate core functionality and demonstrate a commitment to code quality. It is worth noting a known limitation: because the database is held in memory, all data resets to its initial state upon page reload. This is an intentional trade-off for the scope of the assignment.

Auth-gated actions without a route guard

There's no login page a visitor gets bounced to. Posting or reacting is wrapped in withAuthCheck — a small higher-order function that takes the action you actually wanted (post this, like that) and runs it only if the visitor is authenticated; otherwise it opens the auth modal in place and leaves the action unrun. Global state — who's logged in, whether the modal is open — is a single React Context + useReducer store (AppStateProvider), which is all an app this size needs; there's no Redux or Zustand pulled in for four pieces of state.

A database that's honestly just two arrays

db.ts is the entire backend: a users array and a posts array, module-level, seeded with two demo accounts and a handful of lorem-ipsum posts. login(), signup(), getAllPosts(), and addPost() are plain array operations against that seed data — no ORM, no schema, no network call, which is exactly why the app runs with zero setup and exactly why a page refresh wipes it back to that seed state. Components are split atoms/molecules/organisms, the same layering Task Tracker Dashboard uses.

demo login — github.com/jatinrao/foo-rumtext
email:    [email protected]
password: password123

db.test.ts covers that mock backend directly with Jest: signup creates a user with a generated id and a placeholder profile image, login round-trips the right user back given matching credentials, a wrong password or an unknown email both fail closed, and a second signup/login pair confirms the id returned at signup is the same id login later finds — five small, specific assertions rather than one broad smoke test.

Screenshot desktop view of foo rum