Central repository for the eNationalLibrary web application, a group project for the Introduction to Software Engineering course.
This repository is a lightweight container that pulls in the two real codebases as Git submodules:
The actual source code does not live in this repository. Clone the submodules (see below) to get a runnable copy.
┌────────────────────┐ HTTP / JSON ┌────────────────────┐
│ React + Vite SPA │ ─────────────────────▶ │ NestJS REST API │
│ (frontend/) │ Bearer JWT in header │ (backend/) │
│ port 5173 │ ◀───────────────────── │ port 3000 │
└────────────────────┘ └────────┬───────────┘
│ TypeORM
▼
┌────────────────────┐
│ PostgreSQL DB │
└────────────────────┘
- The frontend never talks to the database directly — everything goes through the backend's REST API.
- Authentication is JWT-based. The token is stored in the browser's
localStorageand attached to every API call by an Axios interceptor. - CORS on the backend is preconfigured to accept requests from the frontend's Vite dev server (
http://localhost:5173).
eNationalLibrary/
├── backend/ # Git submodule → eNationalLibrary-Web-Backend
├── frontend/ # Git submodule → eNationalLibrary-Web-Frontend
├── .gitmodules
├── CLAUDE.md
└── README.md
The submodules are pinned to specific commits. After cloning this repo you must initialize and update them before anything will work.
You'll need the following to run the full stack locally:
- Git — to fetch the submodules
- Node.js ≥ 18 and npm ≥ 9
- PostgreSQL ≥ 14, running locally on port
5432
git clone https://github.com/ImmortalZeus/eNationalLibrary.git
cd eNationalLibrary
git submodule update --init --recursiveIf you already cloned without --recurse-submodules, this command fetches everything you need.
# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm installThe backend needs a .env file. A template is provided at backend/.env.example:
cp backend/.env.example backend/.envThen edit backend/.env and fill in your PostgreSQL credentials and a JWT_SECRET.
The frontend does not require any environment variables by default. It will connect to http://localhost:3000/api out of the box. To override that, create frontend/.env:
VITE_API_URL=http://localhost:3000/api# Create a default admin account
node backend/scripts/seed-admin.js
# → email: test@test.com, password: test
# Then start the backend and populate sample books/authors/etc.Open two terminals:
# Terminal 1 — backend
cd backend
npm run start:dev
# → http://localhost:3000/api# Terminal 2 — frontend
cd frontend
npm run dev
# → http://localhost:5173Open http://localhost:5173 in your browser. You should see the eNationalLibrary home page.
The submodules are pinned to specific commits in their own repositories. To pull the latest changes from each:
# Update both to the latest commit on their default branch
git submodule update --remote --merge
# Or update a specific one
cd backend
git pull origin main
cd ..
git add backend
git commit -m "chore: update backend submodule to latest commit"A new commit in this main repository just means a submodule pointer was moved. The submodule repositories themselves hold the actual history.
For setup details, API reference, and module listings, see the README in each submodule repository:
- Backend → eNationalLibrary-Web-Backend
- Frontend → eNationalLibrary-Web-Frontend
- Đặng Trung Anh — 20235583
- Hoàng Gia Nam Anh — 20235584
- Phạm Đức Duy — 20235588
- Nguyễn Thái Anh Minh — 20235605
- Trần Tiến Sơn — 20235620
✍️ Group project for the Introduction to Software Engineering course.