How adilsss/brainex-test-task works
Project type and purpose
• This is a full-stack web application “test task for brainex” with:
• A React/TypeScript single-page client
• A Node.js/Express server serving a small JSON datastore
• Purpose: Display and filter a list of games (CRUD-style interactions)
File structure
• Top-level directories:
• client/ – React app
• server/ – Node/Express API
• client/ patterns:
• public/ – static assets (index.html, manifest, robots.txt)
• src/ – React components, pages, hooks, global CSS
• Components follow a directory-per-component pattern with CSS modules
• pages/ – route-linked pages (Auth, Games, NotFound)
• server/ patterns:
• index.js – Express server entrypoint
• data.json – makeshift database
• .env – environment variables (PORT, etc.)
README for additional insights
• client runs on localhost:3000
• server runs on localhost:3001
• Simple npm scripts, no external cloud services
a. Main components
1. User’s browser (React SPA)
2. Frontend client
3. Backend API server
4. JSON “database” (data.json)
5. (Optional) Authentication/authorization middleware
b. Relationships & interactions
• Browser ⇄ React client code
• React client → HTTP calls (fetch/axios) → Express API endpoints (/games, /auth)
• Express → reads/writes data.json → responds JSON
• React client renders UI based on API responses
c. Architectural patterns/design principles
• Client-Server (two-tier): clear separation of concerns
• SPA routing: React Router + PrivateRoute guard
• Component-based UI with reusable CSS modules
• Single source of truth for data on server side
d. Key technologies
• Frontend: React, TypeScript, CSS Modules, React Router
• Backend: Node.js, Express, dotenv
• Data: flat file (JSON)
• Build tools: npm, package-lock, tsconfig.json