This repository functions as the backend for the E-Fash e-commerce app, serving E-Fashion Flutter and Kotlin applications. Built with TypeScript, Express.js, and MongoDB utilizing Mongoose, the project adheres to clean architecture principles, ensuring modularity and scalability at its core
We aimed to minimize reliance on third-party services, prioritizing in-house solutions wherever possible.
- Express.js
- Mongoose
- Socket.io
- Winston
- Busboy
- Dotenv
- Firebase-Admin
- Joi
- Jsonwebtoken
- Nodemailer
- Stripe
- Swagger-jsdoc
- Swagger-ui-express
- Axios
- Bcrypt
Before running the app, ensure that you have the following:
- Node.js and npm
- Mongodb
- Create brevo account, you'll need this for SMTP email services
- Install Stripe Cli for testing payments during development.
- Generate public and private key token
- Create new Firebase project for notification
-
Clone the project repository: Use Git to clone the project repository to your local machine.
git clone https://github.com/Bit-Camp-IO/E-Fashion_BackEnd.git
-
Navigate to the Project Directory Change your current directory to the project folder.
cd E-Fashion_BackEnd
-
Set up environment variables:
Simply add the environment variables in your application by creating a .env file based on the provided .env.example template and replacing the example values with your actual configuration.
-
Create or update the
firebase.json
file with your Firebase Hosting configuration -
Install project dependencies: Use npm to install the project dependencies specified in the package.json file.
npm install
Use npm ci to install the project dependencies specified in the package-lock.json file. This command is recommended for a more efficient and reproducible installation process.
npm ci
-
Build the project:
npm build
-
Start the project:
npm run start
This project includes Swagger documentation for the API endpoints. You can access it at:
The Swagger documentation provides details about the available API endpoints, request and response formats, and how to use the API effectively.
-
JWT Tokens: Secure user authentication and authorization using JSON Web Tokens for implementing refresh and access tokens.
-
Google Authentication: Enable users to log in seamlessly with their Google accounts.
-
Password Reset: Allow users to reset their passwords using email-based one-time passwords (OTPs).
- Filter and sort products by category, gender, price, and brand.
- Search functionality to find specific products.
- View detailed information for each product, including images, description, price, and available sizes and colors.
- Add products to a shopping cart.
- Adjust product quantities and remove items from the cart.
- Calculate the total order amount.
Checkout and Payment with Stripe
- Secure and streamlined checkout process .
- Multiple payment options (credit/debit cards, cash).
- Shipping and delivery options.
- User profiles with personal information and order history.
- Edit user details and change passwords.
- Save favorite products to a favorites list.
- Read and write product reviews and ratings.
- Track the status of orders.
- Receive real-time updates on order processing and shipping.
- Real-time Notifications: Send instant notifications to users.
- Various Notification Types: Differentiate between general, message, and order status notifications.
- User-Centric: Address specific users or broadcast messages to everyone.
- Notification History: Store notifications for future reference.
E-Fash backend supports real-time chat functionality for customer support using Socket.io. This feature fosters seamless communication between users.
Email Integration with brevo
We've integrated email capabilities for various essential functions, such as order confirmations, password resets, and important notifications. This integration ensures that you receive critical information in your inbox promptly.
npm start
: Start the application in development mode.npm run start-production
: Start the application in production mode.npm run start-watch
: Start the application with Nodemon for auto-reloading in development.npm run build
: Build the TypeScript code.npm test
: Run tests
This project is licensed under the Apache-2 License.
If you have any questions, suggestions, or feedback, please contact the project maintainer:
Email: mahmoudkhaled1215@gmail.com GitHub: Bit-Camp-IO