Welcome to TechDot's open-source E-Commerce API project developed by our dedicated team. This TypeScript-based Node.js API leverages the Express framework alongside cutting-edge technologies to offer a robust foundation for crafting seamless online shopping experiences. Below, you'll find detailed information on obtaining the release and initiating the server.
- Project Overview
- Technologies Used
- Getting Started
- API Features
- Code of Conduct
- Security Policy
- Contribution
- Web Service
- License
- Authors
TechDot's E-Commerce API is meticulously crafted to facilitate seamless online shopping experiences, providing a comprehensive set of robust features to efficiently manage a wide array of electronic devices. From computer components to diverse electronic gadgets, this API serves as the foundation for empowering sophisticated e-commerce platforms. Whether you're establishing a specialized platform or a broad marketplace, TechDot's API offers unparalleled versatility and functionality for various electronic devices, ensuring a smooth and user-friendly shopping experience.
- Node.js
- TypeScript
- Express
For the latest stable release, visit the Releases section of this GitHub repository. Choose either the source code or pre-built binaries based on your preference.
To set up and run the server locally, follow these steps:
-
Clone the repository:
git clone https://github.com/cynlik/techdot-backend.git cd techdot-backend -
Install dependecies:
npm install
-
Configure Environment: After installing the dependencies, create a .env file in the root folder of the project and add the following environment variables:
.env
HOST=127.0.0.1 FRONTEND_HOST= PORT=3000 FRONTEND_PORT= DBURL= SECRET= EXPIRESIN=300000 IPGEOAPI= EMAIL= PASSWORD=
Replace the placeholders with your actual configuration.
-
Start your project
npm start
The API will be accessible at http://localhost:3000.
The categories segment electronic products into distinct sections, simplifying the user's exploration of computer peripherals, household appliances, etc.
Subcategories provide more detailed classification within each main category. For example, in the computer components category, we have motherboard, graphics card, processor, etc.
This feature represents individual product available for purchase. Each product contains comprehensive information such as name, description, compatibility details, specifications, images, and prices.
The user feature manages customer accounts, enabling profile creation and management, purchase history viewing, payment information management, and delivery address storage. Additionally, users can:
- Add items to their wishlists for future consideration.
- View all categories available.
- Access all subcategories within each category.
- Browse products listed under each subcategory and category.
Managers/admins possess elevated privileges within the system, enabling them to perform the following tasks:
-
Category Management:
- Creation, modification, and deletion of categories.
- Ability to modify category names.
- Access to a dedicated dashboard for efficient category management.
-
Product Management:
- Creation, modification, and deletion of products.
- Creation, modification, and deletion of subcategories.
Non-users have limited access within the system, allowing them to:
- View products, categories, and subcategories.
Shopping carts enable customers to collect and temporarily store their chosen computer components for purchase. They can add, remove, or modify items in their cart before finalizing their order.
Wish lists allow registered users to save desired products for future consideration, providing a convenient way to track favorite items without immediately adding them to the cart.
Discount codes offer customers the opportunity to receive special discounts on their purchases, whether through percentage-based discounts or fixed monetary discounts.
Promotions encompass special offers or marketing campaigns that may include seasonal discounts, limited-time sales, bundled deals, or offers tied to specific computer component categories or periods.
We welcome contributions to enhance and refine the functionality of this API. If you have ideas, bug reports, or feature requests, please feel free to open an issue or submit a pull request.
The getUserCountry function within this project utilizes the IP Geolocation API to retrieve the country name based on the provided IP address. This functionality is particularly useful for determining the user's location for language customization within the application.
Setting Up API Access To use this functionality, you'll need an API key from IP Geolocation. Follow these steps to obtain your API key:
Sign up for an account on IP Geolocation.
After registration, access your dashboard and locate your unique API key.
In the project's environment variables or configuration file (src/config or .env), set the IPGEOAPI variable to your API key.
Example: IPGEOAPI=YOUR_API_KEY
The API functionality is contained within the src/api/services/geolocation.ts file. Here, you'll find the getUserCountry function utilizing Axios to interact with the IP Geolocation API, fetching the country name based on the provided IP.
This project is licensed under the GPL-3.0 License.