Phonebook is a fully functional e-commerce website built using Node.js and Express.js, featuring a responsive design for showcasing products, managing orders, and enabling cart functionality. It includes:
- User Authentication: Login and registration for customers and admin accounts.
- CRUD Functionality: Full Create, Read, Update, and Delete support for products, orders, users, and cart items.
- APIs for Dynamic Content:
- Google Maps API: Displays branch locations on an interactive map.
- GNews API: Fetches and displays the latest news articles.
- Facebook API: Enables posting products to the website's Facebook page.
The project leverages MongoDB as the database for scalable and efficient data management.
- Product Management:
- Admins can add, edit, and delete products.
- Users can view and search for products.
- User Roles:
- Regular users can browse, add to cart, and order.
- Admins have access to additional features like managing products and users.
- Dynamic APIs:
- Integration with external APIs (Google Maps, GNews, Facebook) for dynamic data.
- Real-time Features:
- Socket.io for chat functionality with real-time updates.
To run the project, the following environment variables are required:
PORT=3000
MONGODB_URL=<Your MongoDB Connection String>
API_URL=/api/v1
SECRET=<Your Secret Key>
Create a config folder and inside create a .env.dev file and add the variables above. Ensure these values are secure and not hardcoded into the application.
- Node.js:
- Express: Backend framework for building REST APIs.
- Mongoose: ODM library for MongoDB.
- MongoDB: NoSQL database for storing user data, products, orders, and more.
- APIs:
- Google Maps API: Display branch locations on an interactive map.
- GNews API: Fetch and display news articles.
- Facebook API: Share products to the website's Facebook page.
- Socket.io: Enables real-time chat functionality.
Follow the steps below to set up the project on your local machine:
Ensure you have the following installed:
- Node.js (v14 or later)
- MongoDB (local or cloud-based, e.g., MongoDB Atlas)
-
Fork the Repository: Click the fork button on GitHub to create your copy of the repository.
-
Clone the Repository: Clone your forked repo to your local machine.
-
Install Dependencies: Navigate to the project directory and install the required npm packages:
cd WebApp-Phone-Store npm install -
Set Up Environment Variables: Create a
.env.devfile in theconfigfolder and add your environment variables as outlined above.
To start the application locally:
Run the Development Server:
npm run devVisit the application at http://localhost:5500/views/mainPage.html.
Check out the live demo or watch the preview:
This project was built with the help of the following resources and contributors:
- Learning Resources: StackOverflow, W3Schools, GetBootstrap
- APIs:
- Tech Support: ASUS, OnePlus, Apple, Samsung, Xiaomi, Lenovo, HP.








