https://github.com/ornella-gigante/datanest_mongodb_nodejs
This is my first project using NodeJS and MongoBD as persistence. This will be a simple API-REST app in which I will create a MongoDB database, create a server with NodeJS, use a RESTful client and use a MVC model.
https://github.com/ornella-gigante/datanest_mongodb_nodejs
django django-rest-framework json mongodb nodejs
Last synced: 7 months ago
JSON representation
This is my first project using NodeJS and MongoBD as persistence. This will be a simple API-REST app in which I will create a MongoDB database, create a server with NodeJS, use a RESTful client and use a MVC model.
- Host: GitHub
- URL: https://github.com/ornella-gigante/datanest_mongodb_nodejs
- Owner: Ornella-Gigante
- License: mit
- Created: 2025-01-22T16:45:17.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-28T13:13:24.000Z (7 months ago)
- Last Synced: 2025-03-08T12:47:57.487Z (7 months ago)
- Topics: django, django-rest-framework, json, mongodb, nodejs
- Language: JavaScript
- Homepage:
- Size: 26.1 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π DataNest: MongoDB & Node.js Project
---Welcome to DataNest, my first go-to project using the integration of **MongoDB** and **Node.js** using **Postman**! This will be a simple API-REST app in which I will create a MongoDB database, create a server with NodeJS, use a RESTful client and use a MVC modelπ This repository demonstrates how to build a robust backend application using modern JavaScript technologies. Whether you're a beginner like me or an experienced developer, this project is designed to help you understand the fundamentals and advanced concepts of working with databases and backend development.
---
## π Table of Contents
- [β¨ Features](#-features)
- [π Requirement](#-features)
- [π¦ Technologies Used](#-technologies-used)
- [βοΈ Installation](#οΈ-installation)
- [π Usage](#-usage)
- [π Project Structure](#-project-structure)
- [π₯ Demo](#-demo)
- [π How to Start the App](#-how-to-start-the-app)
- [π€ Contributing](#-contributing)
- [π License](#-license)---
## β¨ Features
βοΈ RESTful API built with **Express.js**
βοΈ CRUD operations (Create, Read, Update, Delete) for managing data
βοΈ MongoDB database integration with **Mongoose**
βοΈ Clean and modular code structure for scalability π οΈ
βοΈ Error handling and middleware implementation
βοΈ Easy-to-follow setup for quick deployment---
## Prerequisites
- Node.js >=18.12
---
## π¦ Technologies Used
| Technology | Description |
|------------------|--------------------------------------|
| **Node.js** | JavaScript runtime for server-side |
| **Express.js** | Web framework for building APIs |
| **MongoDB** | NoSQL database for data storage |
| **Mongoose** | ODM library for MongoDB integration |---
## βοΈ Installation
Follow these steps to get started with DataNest on your local machine:
1. **Clone the repository**:
```bash
git clone https://github.com/Ornella-Gigante/DataNest_MongoDB_NodeJS.git
cd DataNest_MongoDB_NodeJS
```2. **Install dependencies**:
```bash
npm install
```3. **Set up environment variables**:
Create a `.env` file in the root directory and add your MongoDB connection string:
```env
MONGO_URI=your_mongodb_connection_string
PORT=3000
```4. **Run the application**:
```bash
cd DataNest_MongoDB_NodeJS
npm start
```5. Open your browser or API client (like Postman) and navigate to:
```
http://localhost:3000
```---
## π Usage
This project provides a RESTful API that allows you to perform CRUD operations on your data. Below are some example endpoints:
### π Endpoints:
#### 1οΈβ£ **Get all items**
```http
GET /api/items
```#### 2οΈβ£ **Get a single item by ID**
```http
GET /api/items/:id
```#### 3οΈβ£ **Create a new item**
```http
POST /api/items
```
Body (JSON):
```json
{
"name": "Sample Item",
"description": "A brief description of the item"
}
```#### 4οΈβ£ **Update an item**
```http
PUT /api/items/:id
```
Body (JSON):
```json
{
"name": "Updated Item Name"
}
```#### 5οΈβ£ **Delete an item**
```http
DELETE /api/items/:id
```---
## π Project Structure
```plaintext
DataNest_MongoDB_NodeJS/
βββ models/ # Database schemas (Mongoose models)
βββ routes/ # API route handlers
βββ controllers/ # Business logic for routes
βββ middleware/ # Middleware functions (e.g., error handling)
βββ config/ # Configuration files (e.g., database connection)
βββ .env.example # Example environment variables file
βββ server.js # Entry point of the application
βββ README.md # Project documentation (this file!)
```---
## π₯ Demo
π Check out the live demo of this project! You can interact with the API endpoints directly using tools like Postman or curl.
π Demo URL: [https://vimeo.com/1051126415](https://vimeo.com/1051126415)
---
## π How to Start the App
Follow these steps to set up and run the application:
### 1οΈβ£ Start MongoDB
Open a terminal and run the following command to start the MongoDB server:
```bash
mongod
```
Make sure MongoDB is installed and running on its default port (27017).### 2οΈβ£ Install Dependencies
Navigate to the project folder in your terminal and install all required dependencies:
```bash
npm install
```### 3οΈβ£ Start the Application
Once the dependencies are installed, start the server using:
```bash
npm start
```
This will run the app using `nodemon`, which automatically restarts the server when changes are detected.### 4οΈβ£ Access the API
The server will be running on:
```
http://localhost:3700
```
You can now test the API endpoints using tools like Postman or curl.---
## π€ Contributing
We β€οΈ contributions! If you'd like to contribute to this project, follow these steps:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-name`).
3. Commit your changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-name`).
5. Open a pull request.Feel free to report issues or suggest features by opening an issue in this repository.
---
## π License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
---
### π Show Your Support!
If you found this project helpful, please give it a β on GitHub! It helps others discover it too.
Happy coding! π»β¨