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.
+-------------------+ +-----------------+
| 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|
+-----------------+
- POST /auth/signup: Register a new user. π
- POST /auth/login: Log in a user. π
- 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. ποΈ
- 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. ποΈ
Certainly! Here are the API endpoints and JSON data for the provided code with emojis:
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" }
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
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
User Model: π€
{
"name": "String",
"email": "String",
"password": "String",
"created_at": "Date",
"created_by": "String"
}
Item Model: π¦
{
"name": "String",
"created_at": "Date",
"created_by": "String"
}
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 ποΈ
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 π¨
To make the installation process for both the frontend and backend repositories attractive, you can follow these steps:
Clone the Repository:
git clone https://.com/Hamed-Hasan/Building-arraytics-product-solution-backend cd arraytics-product-solution-backend
Install Dependencies:
npm install
Set Environment Variables: Create a
.env
file in the root directory and add the necessary environment variables likeMONGODB_URI
,JWT_SECRET
, etc.Run the Application:
npm start
This will start the backend server.
Verify Backend Installation: Open your browser and go to http://localhost:5000 to verify that the backend server is running.
Clone the Repository:
git clone https://.com/Hamed-Hasan/Building-arraytics-product-solution-frontend cd arraytics-product-solution-frontend
Install Dependencies:
npm install
Set Backend API URL: In the
.env
file or in your configuration, set theREACT_APP_API_URL
to the backend API URL (e.g.,http://localhost:5000
).Run the Application:
npm run dev
This will start the frontend development server.
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!