Skip to content

SenithVijayantha/simple-crud-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple CRUD App

A RESTful API application built with Node.js, Express, and MongoDB that implements CRUD (Create, Read, Update, Delete) operations for managing products.

Technologies Used

  • Node.js
  • Express.js
  • MongoDB with Mongoose
  • dotenv for environment variables

Prerequisites

Before running this project, make sure you have:

  • Node.js installed
  • MongoDB installed and running
  • Git (optional, for cloning)

Installation

  1. Clone the repository:
git clone https://github.com/SenithVijayantha/simple-crud-app.git
  1. Navigate to the project directory:
cd simple-crud-app
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with the following variables:
PORT=your_port_number
MONGO_URI=your_mongodb_connection_string

Running the Application

To start the development server with nodemon:

npm run dev

API Endpoints

The API provides the following endpoints for managing products:

  • GET /api/products - Get all products
  • GET /api/products/:id - Get a single product by ID
  • POST /api/products - Create a new product
  • PUT /api/products/:id - Update a product
  • DELETE /api/products/:id - Delete a product

Project Structure

├── controllers/
│   └── productControllers.js
├── models/
│   └── Product.js
├── routes/
│   └── productRoutes.js
├── server.js
├── package.json
└── README.md

License

This project is licensed under the ISC License.

Author

SenithVijayantha

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

simple API to practise CRUD operations with MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published