The PurchezTech Server is the backend component for PurchezTech, an e-commerce platform specializing in selling electrical devices. This server manages core functionalities such as:
- User authentication
- Product management
- Order processing
- Payments
- Ensuring a seamless shopping experience
- User Authentication: Secure login and signup using JSON Web Tokens (JWT) and password hashing with bcrypt.
- Product Management: Efficient handling of product data, including creation, updates, and retrieval.
- Order Management: Smooth processing of orders and tracking.
- Payment Integration: Integrated payment handling via SSLCommerz.
- Cloudinary Integration: Product image management and storage.
- Validation: Strong data validation using Zod.
Ensure the following tools are installed on your system:
- Node.js (>=16.x)
- Yarn (for dependency management)
To install Yarn globally, run:
npm install --global yarnFollow these steps to set up and run the server locally:
git clone git@github.com:th-sakib/PurchezTech-server.git
cd PurchezTech-serverUse Yarn to install all dependencies:
yarn installCreate a .env file in the root directory and configure the following variables:
PORT=3000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_URL=your_cloudinary_url
SSL_COMMERZ_STORE_ID=your_store_id
SSL_COMMERZ_STORE_PASSWORD=your_store_password- For production:
yarn start
- For development with live reload (using nodemon):
yarn dev
PurchezTech-server/
├── src/
│ ├── index.js # Entry point of the application
│ ├── routes/ # API route handlers
│ ├── controllers/ # Logic for handling requests
│ ├── models/ # Mongoose models
│ ├── middlewares/ # Custom middleware
├── .env # Environment variables (not included in repo)
├── package.json # Project metadata and scripts
yarn start: Runs the server in production mode.yarn dev: Runs the server in development mode with live reload.
Key dependencies used in this project:
- Express: For creating RESTful APIs.
- Mongoose: For MongoDB interactions.
- JWT: For secure user authentication.
- Bcrypt: For password hashing.
- Cloudinary: For image storage and management.
- SSLCommerz: For payment processing.
-
Live Link: purchezTech
-
Client repo: purchezTech-client
-
server repo: purchezTech-server
TH Sakib
- GitHub: @th-sakib