Welcome to the backend repository for Giver's Heaven, a comprehensive web application built to streamline the process of donating to disaster relief efforts. This repository contains the backend server code responsible for handling API requests, interacting with the database, and managing the overall functionality of the platform.
- Introduction
- Technologies Used
- Project Overview
- Key Features
- API Documentation
- Getting Started
- Contributing
This backend repository serves as the core of Giver's Heaven, providing a robust and secure backend server to handle various functionalities such as user authentication, donation post management, statistics generation, and more. The server is built using Node.js, Express.js, and MongoDB for the database.
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT (JSON Web Tokens) for authentication
- bcrypt for password hashing
The backend server is designed to provide a RESTful API that interacts with the frontend client of Giver's Heaven. It offers endpoints for managing user authentication, donation posts, statistics generation, testimonials, community wall, and other essential functionalities. The server ensures data integrity, security, and efficient communication with the client-side application.
-
User Authentication:
- Register new users securely.
- Authenticate users with JWT tokens.
- Implement password hashing for enhanced security.
-
Donation Post Management:
- Create, read, update, and delete donation posts.
- Implement CRUD operations for donation transactions.
-
Statistics Generation:
- Calculate and provide statistics on total donations.
- Generate monthly donation totals for a given year.
- Retrieve top donors based on total donation amounts.
-
Testimonial Management:
- Create, read, update, and delete donor testimonials.
- Allow users to post their experiences and feedback.
-
Community Gratitude Wall:
- Enable users to post comments of appreciation and support.
- Provide a platform for users to share positive messages.
-
Secure APIs:
- Implement middleware for route protection and user authorization.
- Validate input data to ensure data integrity.
For detailed information on the available API endpoints and their usage, please refer to the Postman API Documentation.
-
Clone the repository:
git clone https://github.com/iibrahim70/givers-heaven-server
-
Navigate to the project directory:
cd givers-heaven-server
- Install dependencies:
pnpm i
- Set up environment variables:
- Create a
.env
file in the root directory. - Define the following variables:
PORT=5000
DATABASE_URL=your_database_connection_url
DB_Name=your_database_name
BCRYPT_SALT_ROUNDS=12
JWT_SECRET=your_jwt_secret_key
EXPIRES_IN=1d
- Run the server:
pnpm start:dev
The server will start running at http://localhost:5000.
Contributions are welcome! If you have any suggestions, improvements, or new features to add, please fork the repository and submit a pull request.