This repository is the superproject that groups two submodules: the Next.js frontend and the Node.js backend. It contains shared documentation, high-level project structure, and optional shared packages.
Contents
frontend/— Next.js client application (Git submodule)backend/— Node.js/Express API server (Git submodule)docs/— Academic and planning documentationpackages/— Optional shared utilities or TypeScript types
Getting started (high-level)
- Clone the superproject:
git clone https://github.com/FullStack-course-pace/TrueFeed.git- Initialize submodules:
git submodule update --init --recursiveDone cloning the project now you can open either frontend or backend folder to start working on them.
-
Install and run each subproject separately (see subproject README files):
cd frontendand follow that READMEcd backendand follow that README
Notes
- This superproject can host shared utilities under
packages/when multiple submodules require the same code or types.
This structure is designed for maximum clarity, separation of concerns, and scalability, aligning with the Git Submodule architecture.
This is the main Git repository that contains references (submodules) to your two independent applications.
/ ├── frontend/ # Git Submodule: Next.js Client Application ├── backend/ # Git Submodule: Node.js/Express API Server ├── docs/ # FMP Academic and Planning Documentation │ ├── 01_Research/ If you want to push the backend Docker image to Docker Hub manually, build and push with these commands (replace <DOCKERHUB_USERNAME>):
cd backend
docker build -t <DOCKERHUB_USERNAME>/truefeed-backend:latest .
docker push <DOCKERHUB_USERNAME>/truefeed-backend:latestTo automate pushes from GitHub Actions the repository needs two secrets set:
DOCKERHUB_USERNAME— your Docker Hub usernameDOCKERHUB_TOKEN— a Docker Hub access token (preferred) or password
The repo contains a workflow at .github/workflows/docker-publish.yml that will build and push the image on pushes to main.
│ ├── 02_Design_Documents/
│ └── FMP_Report.pdf # Final written dissertation/report
├── .git/ # Superproject Git history
├── .gitmodules # Configuration linking the two submodules
├── README.md # Project setup and guide
└── package.json # Optional: Can be used for shared scripts (e.g., npm run lint:all)
### 2. Frontend Structure (/frontend)
This structure follows modern Next.js App Router conventions, separating UI components from data fetching logic.
/frontend ├── src/ │ ├── app/ # Main App Router (Pages & Layouts) │ │ ├── (auth)/ # Group for authentication routes (login, register) │ │ ├── dashboard/ # Main application views │ │ └── layout.tsx # Root layout and global providers │ ├── components/ # Reusable UI components │ │ ├── modules/ # Complex, stateful components (UserTable, ProjectCard) │ │ └── ui/ # Atomic, style-focused components (Button, Input) │ ├── lib/ # Client-side helpers and API logic │ ├── api/ # Specific functions for calling the Node.js backend │ │ ├── userApi.js │ │ └── projectApi.js │ ├── hooks/ # Custom React hooks (e.g., useDebounce, useAuth) │ ├── styles/ # Global CSS, Tailwind setup │ └── public/ # Static assets (images, fonts, favicon) ├── package.json # Frontend dependencies ├── next.config.js ├── tsconfig.json └── .env.local # NEXT_PUBLIC_API_URL
### 3. Backend Structure (/backend)
This structure implements a robust Layered Architecture (Controller-Service-Model), which is essential for maintainability and testing the business logic independently.
/backend ├── src/ │ ├── controllers/ # Handle HTTP request/response. Calls services. │ │ ├── authController.js │ │ └── projectsController.js │ ├── services/ # Business Logic Layer. Contains core application logic. │ │ ├── authService.js │ │ └── projectsService.js │ ├── models/ # Database Schemas and Definitions (Mongoose/Prisma/Sequelize models) │ │ ├── User.js │ │ └── Project.js │ ├── routes/ # Define API endpoints and map them to controllers. │ │ ├── api.js # Main route entry point │ │ └── v1/ # API versioning │ │ ├── authRoutes.js │ │ └── projectRoutes.js │ ├── middleware/ # Functions run before controllers (e.g., JWT validation, CORS) │ ├── config/ # Database connection, logging setup │ ├── server.js # Application entry point, starts the server │ └── tests/ # Unit and Integration Tests ├── package.json # Backend dependencies (Express, DB driver, Auth library) └── .env.local # PORT, DATABASE_URL, JWT_SECRET
---
Notes
- Keep business logic in `services/` so it can be tested independently of HTTP concerns.
- Use `routes/` as thin mappings to controllers; controllers should remain small and delegate to services.
- Place shared TypeScript types or utility libraries in the superproject `packages/` folder if multiple submodules need them.