Giter VIP home page Giter VIP logo

crud-couchdb-nodejs's Introduction

CouchDB CRUD with Node.js, Express, and TypeScript

This project demonstrates a simple CRUD (Create, Read, Update, Delete) application using Node.js, Express, TypeScript, and CouchDB. It includes a script to import data from a CSV file into CouchDB.

Prerequisites

Before running this application, ensure you have the following prerequisites installed:

Installation

First, you need instance of couchdb on your pc, you can download it here make sure to check the line install windows service when installing couchdb (you can uninstall it later)

Follow these steps to install and run the application:

  1. Clone this repository:

    git clone https://github.com/MehdiSeddik/crud-couchdb-nodejs.git
  2. Install the dependencies:

    yarn install
  3. Setup database

    Before running the application, you need to configure the CouchDB connection settings. in the .env file, edit the couchdb url and port according to your couchdb configuration.

    To create the databases, head on to http://localhost:5984/_utils/, login with the admin credentials you created when installing couchdb, and create two new databases with the following names: contacts and gadm

  4. Data import

Warning Please make sure the databases contacts and gadm exist

to import data into the couchDB instance, you can run the following command

yarn imp

it will run a script that parse csv and json files and insert the data into the databases.

Usage

To start the application, run the following command:

yarn dev

The application will be accessible at http://localhost:[PORT].

API Endpoints The following API endpoints are available:

Method Endpoint Description
GET /contacts Retrieve all items.
GET /contact/:id Retrieve a specific item by ID.
POST /contact Create a new item.
PUT /contact/:id Update an existing item.
DELETE /contact/:id Delete an item.

A postman collection is available in the assets folder

crud-couchdb-nodejs's People

Contributors

mhd-sdk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.