This is a demo project that showcases how to use Express.js with MongoDB Atlas to build a simple CRUD application. The application allows you to manage a list of restaurants, including their names, locations, and cuisines.
To install and run the application, follow these steps:
- Clone the repository:
git clone https://github.com/eladjmc/express-mongo-demo.git
- Navigate to the project directory:
cd express-mongo-demo
- Install the dependencies:
npm install
- Set the environment variables:
echo MONGODB_URI=your-mongodb-atlas-uri > config/config.env
- Start the server:
nodemon server.js
The application uses MongoDB Atlas to store the restaurant information. The database is structured as follows:
The restaurants
collection contains documents that represent individual restaurants. Each document has the following fields:
_id
: A unique identifier for the restaurant.name
: The name of the restaurant.location
: The location of the restaurant.cuisine
: The type of cuisine served at the restaurant.
This application was created by Elad Harel.