This backend for the subscription management application is built using Node.js and MongoDB, following a clean architecture approach. It includes functionalities such as creating and managing subscription groups, adding members to groups, and tracking payments. The backend uses Express for handling HTTP requests and Mongoose for interacting with MongoDB.
- User Management: CRUD operations for user accounts
- Group Management: Create and manage subscription groups
- Member Management: Add and manage group members
- Payment Tracking: Record and track payments related to group members
- Node.js
- Express.js
- MongoDB
- Mongoose
- Node.js and npm installed
- MongoDB installed and running
- Clone the repository:
git clone https://github.com/your-username/subscription-management-backend.git
- Navigate to the project directory:
cd subscription-management-backend
- Install the dependencies:
npm install
- Create a .env file in the root directory and add the following environment variables:
MONGO_URI=mongodb://your_mongo_db_uri
PORT=5000
Running the Application
- Start the server:
npm start
- The backend server will be running at http://localhost:5000.
User Endpoints
- Create User:
POST /api/users
- Get All Users:
GET /api/users
- Get User By ID:
GET /api/users/:userId
- Update User:
PUT /api/users/:userId
- Delete User:
DELETE /api/users/:userId
Group Endpoints
- Create Group:
POST /api/groups
- Get All Groups:
GET /api/groups
- Get Group By ID:
GET /api/groups/:groupId
- Update Group:
PUT /api/groups/:groupId
- Delete Group:
DELETE /api/groups/:groupId
- Fork the repository.
- Create a new branch: git checkout -b feature-branch-name
- Make your changes and commit them: git commit -m 'Add some feature'
- Push to the branch: git push origin feature-branch-name
- Open a pull request.