TNavigate is a small Express + MongoDB backend for managing shops, products, categories and user favorites. It includes JWT/session authentication, Google OAuth support, OpenAPI docs and a suite of Jest integration tests so contributors can iterate quickly.
- RESTful API for shops, products, categories and user accounts
- Session support (Mongo-backed) and JWT authentication
- Google OAuth integration for login
- OpenAPI (Swagger) documentation served by the app
- Test coverage with Jest and Supertest
- API docs:
https://tnavigate1.docs.apiary.io/# - Tests & coverage: run
npm testandnpm run test:coverage - Source: see the
app/folder for routers andapp/models/for Mongoose models - Additional docs:
API_DOCUMENTATION.md,TESTING.md,TESTING_DOCUMENTATION.md
These steps get the project running locally for development and testing.
Prerequisites
- Node.js (14+ recommended)
- A running MongoDB instance (local or remote)
Install
npm installEnvironment
Create a .env file in the project root (or export env vars in your shell). Common variables the app uses:
DB_URL— MongoDB connection string (required)PORT— server port (defaults to3000)SESSION_SECRET— session secret (for express-session)JWT_SECRET— JWT signing secret (if used by your auth flows)GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET— for Google OAuth (optional)FRONTEND— static frontend folder override (optional)
Example .env (do not commit secrets):
DB_URL=mongodb://localhost:27017/tnavigate
PORT=3000
SESSION_SECRET=your_session_secret
JWT_SECRET=your_jwt_secret
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...Run
Start the server:
npm startStart locally with dotenv (loads .env):
npm run start:localFor development reload helpers you can use the simple dev script:
npm run devTesting
Run the full test suite:
npm testQuick coverage report:
npm run test:coverageThere are also helper scripts in scripts/ for integration testing and development (scripts/test-api.js, scripts/dev-server.js).
The server mounts endpoints under /api/v1. Main route examples:
GET /api/v1/shops— list shopsGET /api/v1/products— list productsGET /api/v1/shopCategories— list categoriesPOST /api/v1/authentications— login/register endpoints (seeapp/authentication.js)GET /api/v1/utentiBase/me— token-protected user info
Example curl (public endpoints):
curl http://localhost:3000/api/v1/shopsAuthenticated requests expect either a session cookie (server-session) or an Authorization: Bearer <token> header depending on the route. See app/authentication.js and app/tokenChecker.js for details.
index.js— bootstrapper: connects to MongoDB, configures sessions & Passport, mounts routersapp/app.js— Express app, middleware, static serving and Swagger setupapp/*.js— routers and auth helpers (shopsRouter.js,productsRouter.js,usersRouter.js,favoritesRouter.js,authentication.js, etc.)app/models/— Mongoose models forshop,product,useranduserFavoritescripts/— convenience scripts for testing and developmentAPI_DOCUMENTATION.md— higher-level API notes (link)TESTING.mdandTESTING_DOCUMENTATION.md— testing notes
TNavigateVue: https://github.com/Sofiaz17/TNavigateVue.git
This project was developed following Agile methodology, using iterative sprint-based planning to ensure continuous delivery and rapid feedback. Key Agile practices used during development:
-
Sprint planning & iteration cycles - Work was organized in short, incremental sprints to keep progress measurable and predictable.
-
User story–driven tasks - Features for shops, products, authentication, and testing were defined as user stories with clear acceptance criteria.
-
Frequent reviews & retrospectives - Each sprint concluded with review meetings to evaluate completed features and retrospectives to refine the workflow.
-
Continuous integration & automated testing - The Jest + Supertest suite provided automated verification for every sprint increment.