Skip to content

raviyatechnical/learn-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Learning Node.js

This project creates a learning of Node.js frontend and backend.

mongodb and chat system using socket

💰 Support by donating or sponsoring us.,

sponsor Patreon Buymeacoffee Ko-Fi

Features

  • REST API using MySQL (Sequelize)
  • REST API with Caching using node-cache

Run Locally

/project-root
│── /src
│   ├── /config
│   │   ├── database.js        # Sequelize MySQL Connection
│   │   ├── mongoose.js        # MongoDB Mongoose Connection
│   ├── /models
│   │   ├── /sequelize         # Sequelize Models (MySQL)
│   │   │   ├── index.js       # Sequelize ORM Setup
│   │   │   ├── user.model.js  # Example Sequelize Model
│   │   │   ├── order.model.js # Example Sequelize Model
│   │   ├── /mongoose          # Mongoose Models (MongoDB)
│   │   │   ├── index.js       # Mongoose Models Import
│   │   │   ├── category.model.js  # Example Mongoose Model
│   │   │   ├── product.model.js   # Example Mongoose Model
│   ├── /enums
│   │   ├── Status.js          # Common Status Enum
│   │   ├── UserRole.js        # Common User Role Enum
│   ├── /migrations            # Sequelize Migrations
│   ├── /seeders               # Sequelize Seed Data
│   ├── /repositories          # Data Access Layer (For Clean Code)
│   │   ├── user.repository.js # Repository for Sequelize (MySQL)
│   │   ├── category.repository.js # Repository for Mongoose (MongoDB)
│   ├── /services              # Business Logic Layer
│   │   ├── user.service.js    # User Service (MySQL)
│   │   ├── category.service.js # Category Service (MongoDB)
│   ├── /controllers           # Controllers (Express.js Routes)
│   │   ├── user.controller.js # Handles Sequelize Models
│   │   ├── category.controller.js # Handles Mongoose Models
│   ├── /routes
│   │   ├── user.routes.js     # Routes for MySQL (Sequelize)
│   │   ├── category.routes.js # Routes for MongoDB (Mongoose)
│   ├── /middlewares           # Express.js Middlewares
│   ├── /utils                 # Helper Functions
│   ├── app.js                 # Main Express App
│   ├── server.js              # Start Server
│── /tests                     # Unit & Integration Tests
│── .env                       # Environment Variables
│── package.json               # Dependencies
│── README.md                  # Project Documentation

Run Locally

Clone the project

  git clone https://github.com/raviyatechnical/learn-nodejs

Go to the project directory

  cd learn-nodejs

Copy .env.example to .env

  cp .env.example .env

Install dependencies

  npm install

Start the server for development

  npm run dev

Run Server

Start the server

  npm run start

JWT Token

  node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Tech Stack

Client: Coming Soon

Server: Node, Express

Database: MongoDB, MySQL (Sequelize)

Authors

Lessons Learned

What did you learn while building this project? What challenges did you face and how did you overcome them?

LEARN.md

License

MIT