*Transformer APP en API

📦 Blog Posts API (HTML + JSON)

This project serves blog posts two ways:

  1. Traditional server-rendered HTML pages (SSR)
  2. A clean JSON API you can consume with fetch() from any frontend

The goal: show the difference between an "application" that returns HTML and an "API" that returns raw data — and let you easily build your own client.

Git 🚀 https://github.com/dupontdenis/mongoose-API-virtual.git


API UI (Read-Only)

A minimal, dependency-free web UI to view posts from a REST API.

Supported endpoints:

  • GET /api/posts — list all posts
  • GET /api/posts/:id — get one post by ID

Git 🚀https://github.com/dupontdenis/API-Viewer.git

Methodes et Virtual in shema

🎓 Mongoose Virtual & Method Mini Demo

Minimal teaching project to show two core Mongoose schema features:

  1. virtual property url (computed, not stored in MongoDB)
  2. An instance method getSummary(maxLength) (logic with parameters)

🚀 https://github.com/dupontdenis/mongoose-virtual.git

Agregation

Tiny Mongoose walkthrough that models a simple university example and demonstrates two ways to compute an average: an instance method on the document and a MongoDB aggregation pipeline.

git 🚀 https://github.com/dupontdenis/mongoose-agregation.git

API with mongoose !

 

🎯 Learning Objectives

  • Understand REST API principles
  • Learn HTTP methods: GET, POST, PUT, PATCH, DELETE
  • Work with Express.js and MVC pattern
  • Connect to MongoDB
  • Interact with the API using Fetch, curl, or the VS Code REST Client


git 🛩️ https://github.com/dupontdenis/let-s-start-mongoAPI.git


🚀Applications pour tester l'API !

 Pensez à bien lancer le serveur dans un terminal


Simple : https://dupontdenis.github.io/testAPI/


https://dupontdenis.github.io/useAPIBLOGSIMPLE/

Let's start with mongoose !

🎯 Learning Objectives

This repository is a **hands-on tutorial** designed to teach you the fundamentals of Mongoose, the popular MongoDB object modeling library for Node.js. Through practical examples, you'll learn how to: 

  • 📦 Connect to MongoDB databases
  • 📝 Create documents (INSERT operations)
  • 🔍 Read documents with various query methods (SELECT operations)
  • 🎨 Use schemas to structure your data
  • 🔧 Work with ES Modules in a modern Node.js environment

many to one !

git 🛩️

This repository is designed to teach you about two different ways to implement many-to-one relationships in MongoDB using Mongoose. We'll use a classic example: Authors and Books.

 https://github.com/dupontdenis/mongoose-one-two-many.git


Validation avec mongoose

Contrairement à mongodb qui ne permet pas de valider un schéma mongoose propose de nombreuses option de validation

lire : 🚀La validation Mongoose

import CVS

 Follow the Database Tools Installation Guide to install mongoimport.

😈 Run mongoimport from the system command line, not the mongo shell.


Example

🪛Lancez un terminal et ouvrir VisualStudio


>code .

🪛Créez un fichier File1.csv 
name,num,email
you,20240001,you@univ-evry.fr
me,20240002,me@univ-evry.fr

🪛Dans le terminal exécutez la commande

C:\Users\DD>mongoimport --type csv --headerline --db MyFirstDatabase --collection students --file File1.csv

🚀Verification



🪛Avec mongosh

> db.students.find()
[
  {
    _id: ObjectId("65469262c769f35c5f4be3fe"),
    name: 'you',
    num: 20240001,
    email: 'you@univ-evry.fr'
  },
  {
    _id: ObjectId("65469262c769f35c5f4be3ff"),
    name: 'me',
    num: 20240002,
    email: 'me@univ-evry.fr'
  }
]
>

 https://robomongo.org/