Giter VIP home page Giter VIP logo

be-mini-project-3's Introduction

POS Backend

This is an Express.js application utilizing REST, Sequelize with MySQL, Yup Validation, AWS S3 or local file upload, and authentication/authorization.

Project Structure

Option 1

/my-app
├── node_modules/
├── src/
│   ├── config/
│   │   ├── database.js  // Sequelize MySQL configuration
│   │   ├── s3.js  // AWS S3 configuration
│   │   ├── storage.js  // Local and S3 storage configuration
│   │   ├── auth.js  // Authentication configuration
│   │   └── mail.js  // Email configuration (Nodemailer)
│   ├── models/
│   │   ├── user.js  // Sequelize model
│   │   └── product.js  // Sequelize model for product
│   ├── controllers/
│   │   ├── user.js  // Controller for User
│   │   ├── product.js  // Controller for Product
│   │   └── auth.js  // Controller for Auth related operations
│   ├── middleware/
│   │   └── auth.js  // Middleware for Authentication and Authorization
│   ├── routes/
│   │   ├── user.js  // Route for user
│   │   ├── product.js  // Route for product
│   │   └── auth.js  // Route for auth
│   ├── services/
│   │   ├── upload.js  // Services for File upload (Local and S3)
│   │   └── email.js  // Service for sending emails
│   ├── validators/
│   │   ├── user.js  // Yup validation for User
│   │   ├── product.js  // Yup validation for Product
│   │   └── auth.js  // Yup validation for Auth
│   └── app.js
├── uploads/  // Local storage for development/test environment
├── package.json
├── .env  // Environment variables
├── .gitignore
└── README.md

Option 2

/my-app
├── node_modules/
├── src/
│   ├── config/
│   │   ├── database.js  // Sequelize MySQL configuration
│   │   ├── s3.js  // AWS S3 configuration
│   │   ├── storage.js  // Local and S3 storage configuration
│   │   ├── auth.js  // Authentication configuration
│   │   └── mail.js  // Email configuration (Nodemailer)
│   ├── models/
│   │   ├── user.js  // Sequelize model
│   │   └── product.js  // Sequelize model for product
│   ├── features/
│   │   ├── user/
│   │   │   ├── controller.js  // Controller for User
│   │   │   └── routes.js  // Routes for user
│   │   ├── product/
│   │   │   ├── controller.js  // Controller for Product
│   │   │   └── routes.js  // Routes for product
│   │   └── auth/
│   │       ├── controller.js  // Controller for Auth related operations
│   │       └── routes.js  // Routes for auth
│   ├── middleware/
│   │   └── auth.js  // Middleware for Authentication and Authorization
│   ├── services/
│   │   ├── upload.js  // Services for File upload (Local and S3)
│   │   └── email.js  // Service for sending emails
│   ├── validators/
│   │   ├── user.js  // Yup validation for User
│   │   ├── product.js  // Yup validation for Product
│   │   └── auth.js  // Yup validation for Auth
│   └── app.js
├── uploads/  // Local storage for development/test environment
├── package.json
├── .env  // Environment variables
├── .gitignore
└── README.md

Option 3

/my-app
├── node_modules/
├── src/
│   ├── domain/
│   │   ├── user/
│   │   │   ├── User.js  // User entity
│   │   │   ├── UserController.js  // User operations
│   │   │   ├── UserRepository.js  // Interface for user data access
│   │   │   ├── UserRoutes.js  // User API endpoints
│   │   │   └── UserValidator.js  // Yup validation for user
│   │   ├── product/
│   │   │   ├── Product.js  // Product entity
│   │   │   ├── ProductController.js  // Product operations
│   │   │   ├── ProductRepository.js  // Interface for product data access
│   │   │   ├── ProductRoutes.js  // Product API endpoints
│   │   │   └── ProductValidator.js  // Yup validation for product
│   │   └── auth/
│   │       ├── AuthController.js  // Auth operations
│   │       ├── AuthRoutes.js  // Auth API endpoints
│   │       └── AuthValidator.js  // Yup validation for Auth
│   ├── infrastructure/
│   │   ├── db/
│   │   │   ├── SequelizeUserRepository.js  // Sequelize implementation of user data access
│   │   │   └── SequelizeProductRepository.js  // Sequelize implementation of product data access
│   │   ├── config/
│   │   │   ├── database.js  // Sequelize MySQL configuration
│   │   │   ├── s3.js  // AWS S3 configuration
│   │   │   ├── storage.js  // Local and S3 storage configuration
│   │   │   └── auth.js  // Authentication configuration
│   │   ├── middleware/
│   │   │   └── auth.js  // Middleware for Authentication and Authorization
│   │   └── services/
│   │       ├── upload.js  // Services for File upload (Local and S3)
│   │       └── mail.js  // Services for Email (Nodemailer)
│   └── app.js
├── uploads/  // Local storage for development/test environment
├── package.json
├── .env  // Environment variables
├── .gitignore
└── README.md

Setup

  1. Install dependencies:

    npm install
    
  2. Set environment variables:

    Copy the .env.example file, rename it to .env, and fill out the necessary environment variables.

  3. Run the application:

    npm start
    

Notes

  • This app uses Sequelize to interface with a MySQL database.
  • Authentication and authorization are handled using JWT.
  • AWS S3 or local storage are used for file storage based on the environment.
  • Emails are sent using Nodemailer.
  • Requests are validated using Yup.

be-mini-project-3's People

Contributors

handikha avatar mhafizsir avatar kusmayudaedo avatar

Stargazers

 avatar

Watchers

 avatar  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.