This is the backend API for the EZDebtSolv application, a platform designed to help users manage and solve their debt issues.
- Node.js (v14+)
- MongoDB
- Clone the repository
- Install dependencies:
npm install- Create a
.envfile in the root directory with the following variables:
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/ezdebtsolv
For development:
npm run devFor production:
npm startSwagger documentation is available at /api-docs when the server is running.
POST /api/auth/register- Register a new userPOST /api/auth/login- Login userGET /api/auth/profile- Get user profile (protected)PUT /api/auth/profile- Update user profile (protected)
GET /api/users- Get all users (admin only)GET /api/users/:id- Get a single user (admin only)PUT /api/users/:id- Update a user (admin only)DELETE /api/users/:id- Delete a user (admin only)
GET /api/debts- Get all user debts (protected)GET /api/debts/:id- Get a specific debt (protected)POST /api/debts- Create a new debt (protected)PUT /api/debts/:id- Update a debt (protected)DELETE /api/debts/:id- Delete a debt (protected)GET /api/debts/summary- Get debt summary statistics (protected)
GET /api/plans- Get all payment plans (protected)GET /api/plans/:id- Get a specific payment plan (protected)POST /api/plans- Create a new payment plan (protected)PUT /api/plans/:id- Update a payment plan (protected)DELETE /api/plans/:id- Delete a payment plan (protected)
{
name: String (required),
email: String (required, unique),
password: String (required, min length: 6),
role: String (enum: ['user', 'admin'], default: 'user'),
createdAt: Date,
updatedAt: Date
}ezdebtsolv-backend-app/
├── src/
│ ├── config/ # Configuration files
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Custom middleware
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── utils/ # Utility functions
│ └── server.js # Main application file
├── .env # Environment variables
├── .gitignore # Git ignore file
├── package.json # Project dependencies
└── README.md # Project documentation