Skip to content

Arraytics Product Solution Backend πŸš€ Powering Arraytics product solutions with Node.js, Express.js, MongoDB, and more! Seamlessly manage items and users with robust APIs. πŸ”πŸ“¦πŸ‘€ Explore API docs on Postman. View live sites for frontend and backend. Join us in building the future of Arraytics! #FullStack #Backend

NotificationsYou must be signed in to change notification settings

Hamed-Hasan/Building-arraytics-product-solution-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arraytics Product Solution Backend

Overview

Welcome to the Arraytics Product Solution Backend! This project serves as the backbone for handling various functionalities related to Arraytics product solutions. It is built using technologies like Node.js, Express.js, MongoDB with Mongoose, and other essential libraries.

View the live site frontend here.

View the live site backend here.

View the API documentation on Postman here.

Arraytics Product Solution Management System πŸš€

Arraytics Solution

Entity-Relationship Diagram (ERD)


+-------------------+     +-----------------+
|       Item        |     |       User      |
+-------------------+     +-----------------+
| _id: ObjectId     |     | _id: ObjectId   |
| name: String      |     | name: String    |
| created_at: Date  |     | email: String   |
| created_by: String|     | password: String|
+-------------------+     | created_at: Date|
                          | created_by: String|
                          +-----------------+

Arraytics API Endpoints

Main Route

Authentication Routes πŸ›‘οΈ

  • POST /auth/signup: Register a new user. πŸ“
  • POST /auth/login: Log in a user. πŸ”

Item Routes πŸ“¦

  • GET /items: Get all items. πŸ“‹
  • GET /items/:itemId: Get a specific item by ID. πŸ“–
  • POST /items/create-item: Create a new item. ✨
  • PUT /items/:itemId: Update an item by ID. πŸ”„
  • DELETE /items/:itemId: Delete an item by ID. πŸ—‘οΈ

User Routes πŸ‘€

  • GET /users: Get all users. πŸ§‘β€πŸ’Ό
  • GET /users/:userId: Get a specific user by ID. πŸ§‘β€πŸ’»
  • POST /users/create-user: Create a new user. βž•
  • PUT /users/:userId: Update a user by ID. πŸ”„
  • DELETE /users/:userId: Delete a user by ID. πŸ—‘οΈ

API ENDPOINTS & DATA

Certainly! Here are the API endpoints and JSON data for the provided code with emojis:

Authentication Routes

POST /signup: Register a new user. πŸ“

  • Endpoint: /auth/signup
  • JSON Data:
    {
      "username": "example",
      "email": "[email protected]",
      "password": "your_password"
    }

POST /login: Log in a user. πŸ”

  • Endpoint: /auth/login
  • JSON Data:
    {
      "email": "[email protected]",
      "password": "your_password"
    }

Item Routes

GET /items: Get all items. πŸ“‹

  • Endpoint: /items

GET /items/:itemId: Get a specific item by ID. πŸ“–

  • Endpoint: /items/:itemId

POST /items/create-item: Create a new item. πŸ“¦

  • Endpoint: /items/create-item
  • JSON Data:
    {
      "name": "New Item",
      "created_by": "user_id"
    }

PUT /items/:itemId: Update an item by ID. πŸ”„

  • Endpoint: /items/:itemId
  • JSON Data:
    {
      "name": "Updated Item",
      "created_by": "user_id"
    }

DELETE /items/:itemId: Delete an item by ID. πŸ—‘οΈ

  • Endpoint: /items/:itemId

User Routes

GET /users: Get all users. πŸ“Š

  • Endpoint: /users

GET /users/:userId: Get a specific user by ID. πŸ§‘β€πŸ’»

  • Endpoint: /users/:userId

POST /users/create-user: Create a new user. πŸ§‘β€πŸš€

  • Endpoint: /users/create-user
  • JSON Data:
    {
      "name": "New User",
      "email": "[email protected]",
      "password": "user_password",
      "created_by": "admin_id"
    }

PUT /users/:userId: Update a user by ID. πŸ”„

  • Endpoint: /users/:userId
  • JSON Data:
    {
      "name": "Updated User",
      "email": "[email protected]",
      "password": "updated_password",
      "created_by": "admin_id"
    }

DELETE /users/:userId: Delete a user by ID. πŸ—‘οΈ

  • Endpoint: /users/:userId

Model Definitions

User Model: πŸ‘€

{
  "name": "String",
  "email": "String",
  "password": "String",
  "created_at": "Date",
  "created_by": "String"
}

Item Model: πŸ“¦

{
  "name": "String",
  "created_at": "Date",
  "created_by": "String"
}

Backend Features and Technologies πŸš€

Features:

  • Custom Authentication with JWT πŸ”
  • Role-Based Access Control (RBAC) πŸ›‘οΈ
  • Item Management API πŸ“¦
  • User Management API πŸ‘€
  • Authentication Routes πŸ›‘οΈ

Technologies:

  • Node.js πŸ’»
  • Express.js ⚑
  • MongoDB with Mongoose 🐘
  • Bcrypt for password hashing πŸ”‘
  • Body-parser for parsing incoming request bodies πŸ“
  • CORS for enabling cross-origin resource sharing βš™οΈ
  • Dotenv for environment variable management 🌐
  • Nodemon for development server auto-reloading πŸ”„
  • Zod for TypeScript-first schema declaration and validation πŸ—οΈ

Frontend Features and Technologies 🌐

Features:

  • User Interface for Arraytics Product Solution Management System πŸš€
  • Authentication UI πŸ›‘οΈ
  • Item Management UI πŸ“¦
  • User Management UI πŸ‘€

Technologies:

  • React for building user interfaces βš›οΈ
  • Vite for frontend tooling and development πŸ› οΈ
  • Chakra UI for building accessible and themeable UI components πŸ‘©β€πŸŽ¨
  • Emotion for styling components with JavaScript πŸ’…
  • Axios for making HTTP requests 🌐
  • Framer Motion for creating smooth animations πŸ”„
  • React Query for data fetching and state management πŸ“Š
  • React Router for navigation 🚦
  • React Icons for including popular icon sets 🎨
  • Yup for form validation πŸ“
  • SweetAlert2 for displaying beautiful alerts 🍬
  • Tailwind CSS for utility-first styling 🎨

Installation Frontend - Backend

To make the installation process for both the frontend and backend repositories attractive, you can follow these steps:

Backend Installation

  1. Clone the Repository:

    git clone https://.com/Hamed-Hasan/Building-arraytics-product-solution-backend
    cd arraytics-product-solution-backend
  2. Install Dependencies:

    npm install
  3. Set Environment Variables: Create a .env file in the root directory and add the necessary environment variables like MONGODB_URI, JWT_SECRET, etc.

  4. Run the Application:

    npm start

    This will start the backend server.

  5. Verify Backend Installation: Open your browser and go to http://localhost:5000 to verify that the backend server is running.

Frontend Installation

  1. Clone the Repository:

    git clone https://.com/Hamed-Hasan/Building-arraytics-product-solution-frontend
    cd arraytics-product-solution-frontend
  2. Install Dependencies:

    npm install
  3. Set Backend API URL: In the .env file or in your configuration, set the REACT_APP_API_URL to the backend API URL (e.g., http://localhost:5000).

  4. Run the Application:

    npm run dev

    This will start the frontend development server.

  5. Verify Frontend Installation: Open your browser and go to http://localhost:5471 to verify that the frontend application is running.

Now, you have both the backend and frontend up and running. You can explore the Arraytics Product Solution Management System by navigating through the provided routes and endpoints.

Feel free to reach out if you encounter any issues during the installation process or if you have any questions about the codebase!

About

Arraytics Product Solution Backend πŸš€ Powering Arraytics product solutions with Node.js, Express.js, MongoDB, and more! Seamlessly manage items and users with robust APIs. πŸ”πŸ“¦πŸ‘€ Explore API docs on Postman. View live sites for frontend and backend. Join us in building the future of Arraytics! #FullStack #Backend

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published