A progressive Node.js framework for building efficient and scalable server-side applications.
Welcome to Donor Nest, a robust platform designed to connect generous donors with meaningful campaigns. Our system enables users to easily create, manage, and donate to campaigns, ensuring that every cause gets the support it deserves. With secure authentication, seamless Stripe integration for payments, and comprehensive campaign management features, Donor Nest is your go-to solution for crowdfunding and donations.
- User Authentication: Secure login and registration using email and password.
- JWT and Refresh Tokens: Enhanced security with JWT for access tokens and refresh tokens for session management.
- Admin Verification: Campaign creation is gated by admin verification to ensure legitimacy.
- Campaign Management: Create, view, update, and delete campaigns with ease.
- Donation Management: Facilitate donations with detailed tracking and status updates.
- Stripe Integration: Seamlessly handle payments and transactions.
- File Uploads: Upload and manage official IDs using Multer and Uploadcare.
- Role-Based Access Control: Fine-grained access control using roles and permissions.
- Automatic Status Updates: Campaign status updates automatically when funding goals are met.
- NestJS: A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- NestJS Modules: Modular structure for organizing the application.
- NestJS Controllers: Handle incoming requests and return responses.
- NestJS Services: Business logic and data handling.
- NestJS Guards: Role-based access control.
- NestJS Pipes: Input validation and transformation.
- NestJS Decorators: Custom decorators for cleaner code.
- SQLite: A lightweight database engine.
- Prisma: ORM for database interactions.
- Stripe: Payment processing platform.
- Multer: Middleware for handling multipart/form-data.
- Uploadcare: Service for handling file uploads.
- PassportJS: Authentication middleware for Node.js.
- JWT: JSON Web Tokens for securing APIs.
- Docker: Containerization platform for development and deployment.
Create a .env
file in the root of your project with the following variables:
PORT=3001
DATABASE_URL="your-db-url"
STRIPE_SECRET_KEY="your-stripe-secret-key"
STRIPE_WEBHOOK_SECRET="your-stripe-webhook-secret"
UPLOADCARE_PUBLIC_KEY="your-uploadcare-public-key"
UPLOADCARE_SECRET_KEY="your-uploadcare-secret-key"
JWT_SECRET="your-jwt-secret"
- Clone the repository:
git clone https://github.com/your-username/donor-nest.git
cd donor-nest
- Install dependencies:
npm install
- Set up Prisma:
npm run db:push
- Start the application:
npm run start:dev
- Clone the repository:
git clone https://github.com/your-username/donor-nest.git
cd donor-nest
- Start services with Docker Compose:
docker-compose up
-
Register a new user
- Description: Register a new user.
- Method: POST
- Route: /api/v1/users/
- Access: Public
- Output: Success message
-
Authenticate a user
- Description: Authenticate a user and get JWT token.
- Method: POST
- Route: /api/v1/auth/login
- Access: Public
- Output: JWT token
-
Logout a user
- Description: Logout a user.
- Method: POST
- Route: /api/v1/auth/logout
- Access: Private
- Output: Success message
-
Refresh the access token
- Description: Refresh the access token.
- Method: GET
- Route: /api/v1/auth/refresh
- Access: Private
- Output: Access token
-
Get all Users
- Description: get all users.
- Method: GET
- Route: /api/v1/users
- Access: Private (admins)
- Output: users
-
Get a user
- Description: get a user.
- Method: GET
- Route: /api/v1/users/:id
- Access: Private
- Parameters:
- id (string): User ID.
- Output: user
-
Update a user
- Description: update a user.
- Method: PUT
- Route: /api/v1/users/:id
- Access: Private
- Parameters:
- id (string): User ID.
- Output: user
-
Delete a user
- Description: Delete a user.
- Method: DELETE
- Route: /api/v1/users/:id
- Access: Private
- Parameters:
- id (string): User ID.
- Output: Success message
-
Verfiy a user
- Description: Verfiy a user by his official ID.
- Method: PUT
- Route: /api/v1/users/:id/verfiy
- Access: Private
- Parameters:
- id (string): User ID.
- Output: Success message
-
Get all Campaigns
- Description: get all Campaigns.
- Method: GET
- Route: /api/v1/campaigns
- Access: Public
- Query Parameters:
- full (number): page. Optional. for pagination.Defaul 1.
- purpose (string): Optional. to filter by Campaign purpose.
- search (string): Optional. to by Campaign name.
- Output: Campaigns
-
Add a Campaign
- Description: Add a Campaign.
- Method: POST
- Route: /api/v1/campaigns/:id
- Access: Private
- Parameters:
- id (string): Campaign ID.
- Output: campaign
-
Get a Campaign
- Description: get a Campaign.
- Method: GET
- Route: /api/v1/campaigns/:id
- Access: Public
- Parameters:
- id (string): Campaign ID.
- Output: campaign
-
Update a Campaign
- Description: update a Campaign.
- Method: PUT
- Route: /api/v1/campaigns/:id
- Access: Private
- Parameters:
- id (string): Campaign ID.
- Output: Campaign
-
Delete a Campaign
- Description: Delete a campaign.
- Method: DELETE
- Route: /api/v1/campaigns/:id
- Access: Private
- Parameters:
- id (string): Campaign ID.
- Output: Success message
-
Donate
- Description: Create a new donation for a campaign.
- Method: POST
- Route: /api/v1/campaigns/:id/donations
- Access: Public
- Parameters:
- id (string): Campaign ID.
- Output: donation
-
Get Donations
- Description: Get all donations for a campaign.
- Method: GET
- Route: /api/v1/campaigns/:id/donations
- Access: Private
- Parameters:
- id (string): Campaign ID.
- Output: donations
This project is licensed under the MIT licensed.