Giter Site home page Giter Site logo

imkrrish / mern-kontact-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 132 KB

Efficient Contact Management System using the MERN stack for easy organization and accessibility of contacts.

Home Page: https://kontact-one.vercel.app/

TypeScript 97.95% JavaScript 0.40% CSS 1.65%
crud-application express mern-project mern-stack mongodb nextjs node-js typescript

mern-kontact-app's Introduction

Kontact - Simple MERN CRUD App

Kontact is a simple MERN (MongoDB, Express, React, Node.js) stack CRUD application for managing contacts.

Prerequisites

Before you begin, ensure you have met the following requirements:

Getting Started

Clone the repository:

git clone https://github.com/imkrrish/mern-kontact-app.git
cd mern-kontact-app

Backend (Node.js)

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    Create a .env file in the backend directory with following environment variables to your .env file:

    MONGODB_URI=mongodb://127.0.0.1:27017/Kontact
    NODE_ENV=dev
    PORT=5000
    RATE_LIMIT_TIME=3000
    RATE_LIMIT_REQUEST=100
  4. Start the development server:

    npm run start:dev

Frontend (Next.js)

  1. In a new terminal, navigate back to the project root folder (where the frontend folder is located) and Install frontend dependencies:

    cd frontend
    npm install
  2. Set up environment variables: Create a .env.local file in the frontend directory with following environment variables to your .env file:

    NEXT_PUBLIC_API_BASE_URL=http://localhost:5000
  3. Start the development server:

    npm run dev

Usage

Access the frontend application at http://localhost:3000

The backend API is available at http://localhost:5000

API Endpoints

  • GET /api/contacts - Retrieve all contacts.
  • GET /api/contacts/:id - Retrieve a specific contact by ID.
  • POST /api/contacts - Create a new contact.
  • PUT /api/contacts/:id - Update an existing contact.
  • DELETE /api/contacts/:id - Delete a contact.

Sorting and Filtering

  • To retrieve contacts sorted by name in ascending order: /api/contacts?sortBy=name&sortOrder=ASC

  • To filter contacts by name: /api/contacts?name=anyname

Scripts

Backend (Node.js)

  • npm run build: Build the TypeScript code.
  • npm start: Start the production server.
  • npm run lint: Run ESLint to lint TypeScript files.
  • npm run lint-and-fix: Run ESLint with automatic fixes.
  • npm run prettier-format: Format TypeScript files using Prettier.
  • npm test: Run tests (if available).

Frontend (Next.js)

  • npm run build: Build the Next.js application.
  • npm run start: Start the production Next.js server.
  • npm run lint: Run ESLint to lint TypeScript and React files.

🤩Feel free to give this repo a ⭐ if you like this repo

Contributions are welcomed!

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.