Skip to content

Latest commit

 

History

693 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sona3: Multi-Vendor Handmade Products and Services App

Crafting a Platform for Handmade Product Vendors


Table of Contents

  1. Prerequisites
  2. Project Structure
  3. Installation
  4. Configuration
  5. Usage
  6. Contributing
  7. License

Prerequisites

Before you begin, ensure you have the following installed:

Node.js (v14 or higher)
MongoDB (local or accessible via connection string)


Project Structure

The project structure is organized as follows:

Sona3/
│
├── configs/
│ ├── database.js # MongoDB connection configuration
│ ├── app.js # Express application configuration
│ ├── server.js # Entry point of the app
│ ├── socket.js # Socket.io Server configuration
│
├── controllers/
│ ├── admin/ # Controllers for the admin panel app (web UI)
│ │ ├── auth.controller.js # Authentication controller
│ │ ├── admin.controller.js # CRUD controllers for admins
│ │ ├── customer.controller.js # CRUD controllers for customers
│ │ ├── seller.controller.js # CRUD controllers for sellers
│ │ ├── product.controller.js # CRUD controllers for products
│ │ # ... Add more controllers as needed
│ ├── customer/ # Controllers for the customer app (mobile and web UI)
│ │ # ... Controllers similar to the admin app
│ ├── seller/ # Controllers for the Seller app (mobile and web UI)
│ │ # ... Controllers similar to the admin app
│
├── helpers/
│ ├── cors.helper.js # Helper methods for custom CORS policies
│ ├── jwt.helper.js # JWT helper methods for token generation and decoding
│ ├── settings.helper.js # Methods for reading and writing data to settings.js
│ ├── uploader.helper.js # Multer method for file upload with validation
│ ├── validation.helper.js # Joi-based validation of request data
│ # ... Add more helper methods as needed
│
├── locales/
│ ├── ar.json # Keys with Arabic translations of messages as values
│ ├── en.json # Keys with English translations of messages as values
│
├── models/
│ ├── Admin/
│ │ ├── admin.model.js # Mongoose schema for admins
│ │ ├── admin.repo.js # Methods for CRUD operations on admin data
│ ├── Customer/
│ │ # ... Models and repos for customers, sellers, products, etc.
│ ├── Seller/
│ │ # ... Models and repos for sellers, categories, coupons, etc.
│ ├── Wishlist/
│ │ # ... Models and repos for wishlists, if applicable
│ # ... Add more models and repos as needed
│
├── tests/ # Unit Tests for all APIs exposed for all apps using jest and supertest
│ ├── admin/
│ │ ├── index.test.js # Aggregates all admin app tests
│ │ ├── auth.test.js # Authentication endpoints
│ │ ├── admin.test.js # Endpoints for admins
│ │ ├── customer.test.js # Endpoints for customers
│ │ ├── seller.test.js # Endpoints for sellers
│ │ ├── product.test.js # Endpoints for products
│ │ # ... Add more test files for other features
│ ├── customer/
│ │ # ... Test files for the customer app
│ ├── seller/
│ │ # ... Test files for the Seller app
│ ├── index.test.js # Aggregates all index.test.js files from all 3 folders
│
├── routes/
│ ├── admin/
│ │ ├── index.route.js # Aggregates all admin app endpoints
│ │ ├── auth.route.js # Authentication endpoints
│ │ ├── admin.route.js # Endpoints for admins
│ │ ├── customer.route.js # Endpoints for customers
│ │ ├── seller.route.js # Endpoints for sellers
│ │ ├── product.route.js # Endpoints for products
│ │ # ... Add more route files for other features
│ ├── customer/
│ │ # ... Route files for the customer app
│ ├── seller/
│ │ # ... Route files for the Seller app
│ ├── index.route.js # Aggregates all endpoints
|
├── sockets/
│ ├── admin/
│ │ ├── admin.socket.js # socket.io events for admins
│ │ # ... Add more socket files for other features
│ ├── customer/
│ │ ├── customer.socket.js # socket.io events for customers
│ │ # ... Add more socket files for other features
│ ├── seller/
│ │ ├── seller.socket.js # socket.io events for sellers
│ │ # ... Add more socket files for other features
│ ├── index.socket.js # Aggregates all sockets
│
├── utils/
│ ├── batchSchedule.util.js # Methods for handling cron jobs and batch processing
│ ├── s3FileStorage.util.js # Methods for reading and writing files to AWS S3
│ ├── stripePayment.util.js # Payment operations with Stripe
│ # ... Add more utility methods for various purposes
│
├── validations/
│ ├── admin.validation.js # Validation schemas for admin data
│ ├── customer.validation.js # Validation schemas for customer data
│ # ... Add more validation schemas as needed
│
├── .env # Environment variables
├── .gitignore # Gitignore file
├── jest.config.js # Jest configuration
├── package-lock.json # Project dependencies lockfile
├── package.json # Project dependencies file
├── Procfile # Heroku deployment configuration
├── README.md # This documentation
├── settings.js # File for storing application settings

Installation

Follow these steps to get started with the Sona3 project:

Follow these steps to get started with the Sona3 project:

  1. Clone this repository:

    git clone https://github.com/Sona3App/APIs.git
    
  2. Navigate to the project directory:

  cd Sona3
  1. Install the required dependencies:
npm install

Configuration

Customize your application's configuration by making changes to the following files:

  1. configs/database.js: Configure your MongoDB connection settings.
  2. configs/app.js: Customize your Express application settings.
  3. Set environment variables in the .env file to store sensitive information like API keys and secrets.

Usage

To run the Sona3 application, execute the following command:

npm start

The application will be accessible at http://localhost:your-port. You can access the API endpoints and the frontend (if applicable) from this URL.

Contributing

We welcome contributions to the Sona3 project. To contribute, please follow these steps:

Fork the repository.

Create a new branch for your feature or bug fix. Implement your changes and thoroughly test them. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License. For more details, see the LICENSE file.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages