Git Product home page Git Product logo

shimork04 / node.js-_microservices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sazamansari/node.js-_microservices

0.0 0.0 0.0 2.26 MB

Express.js is a framework of Node.js for building efficient, scalable Node.js server-side applications. It uses modern JavaScript, is built with JavaScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).

Home Page: https://www.npmjs.com/package/user-auth-microservice

License: MIT License

JavaScript 99.19% Dockerfile 0.81%

node.js-_microservices's Introduction

node.js-_microservices


Description

Express.js is indeed a popular framework for building efficient and scalable server-side applications using Node.js. It is designed to work with modern JavaScript and can be used with pure JavaScript as well. Express.js combines elements of Object-Oriented Programming (OOP), Functional Programming (FP), and Functional Reactive Programming (FRP) to provide a flexible and robust development environment.

While Node.js itself provides compatibility with various libraries, Express.js stands out as a lightweight and flexible framework that simplifies the development of server-side applications. It allows developers to handle routing, middleware, and other server-related tasks with ease.

In recent years, JavaScript has gained significant popularity as a language for both front-end and back-end development, thanks to frameworks like Angular, React, and Vue. However, on the server-side, finding a suitable architecture for Node.js applications has been a challenge.

User_Auth Microservices aims to address this problem by providing an out-of-the-box application architecture. This architecture focuses on creating highly testable, scalable, loosely coupled, and easily maintainable applications. It takes inspiration from the Node.js ecosystem and leverages the power of Express.js along with other libraries and tools to provide a robust solution.

By using User_Auth Microservices, developers can benefit from a pre-defined architecture that promotes best practices and reduces the effort required to build complex server-side applications. This allows developers to focus more on application logic and functionality rather than spending time designing and implementing the underlying architecture.

Overall, Express.js and User_Auth Microservices provide developers with powerful tools and frameworks to build efficient, scalable, and maintainable server-side applications using Node.js and JavaScript.

  1. Make your Changes: Make the necessary changes and improvements to the codebase.

  2. Commit your Changes: Once you're satisfied with your changes, commit them with a meaningful message describing your updates.

git add .
git commit -m 'Add a new feature: detailed explanation'
  1. Push to your Fork: Push your changes to your forked repository on GitHub.
git push origin your-branch-name

License

Include the license information for your project. For example, you can use the MIT License:

This project is licensed under the terms of the MIT License. Feel free to contribute to this repo.

INSTALL

locally, usually for use as a module:

npm i user-auth-microservice

Authors

License

MIT License

API Reference

Get all items

  GET /api/items
Parameter Type Description
api_key string Required. Your API key

Get item

  GET /api/items/${id}
Parameter Type Description
id string Required. Id of item to fetch

Mongoose Connect

config/db.js

import mongoose from "mongoose";

const connectDB = async () => {
  let uri = process.env.MONGO_URI;

  try {
    await mongoose
      .connect(uri, {
        useNewUrlParser: true,
        useUnifiedTopology: true,
        useCreateIndex: true,
      })
      .catch((error) => {
        console.log("connection in error:::", error);
      });

        console.log("mongo DB connected");


      mongoose.set('debug', function(collectionName, method, query, doc, options) {

        console.log(collectionName + '.' + method, JSON.stringify(query), doc)

        // log.info({
        //     dbQuery: set
        // });
    });

  } catch (e) {
    console.error(e, "error");
  } finally {
    // await client.close();
  }
};

export default connectDB;
/>

#### Get all items


#### add(num1, num2)

Takes two numbers and returns the sum.




## To Run The Project

To Run The Project

```bash
  npm run dev

Contributing

Contributions are always welcome!

Note:

  1. Don't Create Pull Request to update "readme.md" File.
  2. Maintain proper folder structure.
  3. In case you need to add an external package, install it by using npm. Don't push the complete package file here

Steps to run the project

  • Fork the repo
  • Clone into local
  • Run npm install
  • Run npm run dev

Issues to fix:

  • Fix all the buttons
  • Improve box-shadow in light mode
  • Make dark mode as default

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

Tech Stack

Server: Node.js, Express.js Auth, JwToken

Examples

// Import necessary modules and routes
import CONSTANTS from "../constants/index.js";
import UserRoutes from "../modules/user/user.routes";

/**
 * Configure routes for the Express.js app.
 *
 * @param {object} app - Express.js application instance
 */
const configureRoutes = (app) => {
  // Mount the UserRoutes under the specified API URI
  app.use(`${CONSTANTS.API_URI}/user`, UserRoutes);

  // You can add more routes here as needed
  // Example: app.use(`${CONSTANTS.API_URI}/posts`, PostsRoutes);
};

// Export the configureRoutes function for usage
export default configureRoutes;

(Back to top)

node.js-_microservices's People

Contributors

sazamansari avatar dependabot[bot] avatar anujsrivastava1234 avatar azmatraza avatar hereisswapnil avatar rish-02 avatar s-ishita avatar sagnik3788 avatar sumitkr2000 avatar lovetyagi-17 avatar harmeetsingh11 avatar anurag-int avatar abhinav-m22 avatar satyamsinghk avatar rks-031 avatar nishitbaria avatar narendrakoya999 avatar imrannawar avatar divyanshinarang avatar k-deepak04 avatar abdul535 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.