@intranefr/superbackend 1.7.7 → 1.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.beads/.br_history/issues.20260314_212352_900045509.jsonl +0 -0
- package/.beads/.br_history/issues.20260314_212352_900045509.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_212353_087140743.jsonl +1 -0
- package/.beads/.br_history/issues.20260314_212353_087140743.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_212353_285881504.jsonl +2 -0
- package/.beads/.br_history/issues.20260314_212353_285881504.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_212353_473915419.jsonl +3 -0
- package/.beads/.br_history/issues.20260314_212353_473915419.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_212353_659476307.jsonl +4 -0
- package/.beads/.br_history/issues.20260314_212353_659476307.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_212353_869998925.jsonl +5 -0
- package/.beads/.br_history/issues.20260314_212353_869998925.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_212354_054785029.jsonl +6 -0
- package/.beads/.br_history/issues.20260314_212354_054785029.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213336_175893691.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213336_175893691.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213336_338509797.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213336_338509797.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213336_515443192.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213336_515443192.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213336_676417592.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213336_676417592.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213336_839182422.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213336_839182422.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213337_004349113.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213337_004349113.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213337_179824080.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213337_179824080.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213701_705075332.jsonl +7 -0
- package/.beads/.br_history/issues.20260314_213701_705075332.jsonl.meta.json +1 -0
- package/.beads/.br_history/issues.20260314_213706_783128702.jsonl +8 -0
- package/.beads/.br_history/issues.20260314_213706_783128702.jsonl.meta.json +1 -0
- package/.beads/config.yaml +4 -0
- package/.beads/issues.jsonl +8 -0
- package/.beads/metadata.json +4 -0
- package/.env.example +8 -0
- package/autochangelog/.env.example +36 -0
- package/autochangelog/README.md +412 -0
- package/autochangelog/config/database.js +27 -0
- package/autochangelog/package.json +47 -0
- package/autochangelog/public/landing.html +581 -0
- package/autochangelog/server.js +104 -0
- package/autochangelog/src/app.js +181 -0
- package/autochangelog/src/config/database.js +26 -0
- package/autochangelog/src/controllers/auth.js +488 -0
- package/autochangelog/src/controllers/changelog.js +682 -0
- package/autochangelog/src/controllers/project.js +580 -0
- package/autochangelog/src/controllers/repository.js +780 -0
- package/autochangelog/src/middleware/auth.js +386 -0
- package/autochangelog/src/models/Changelog.js +443 -0
- package/autochangelog/src/models/Project.js +226 -0
- package/autochangelog/src/models/Repository.js +366 -0
- package/autochangelog/src/models/User.js +223 -0
- package/autochangelog/src/routes/auth.routes.js +32 -0
- package/autochangelog/src/routes/changelog.routes.js +42 -0
- package/autochangelog/src/routes/github-auth.routes.js +102 -0
- package/autochangelog/src/routes/project.routes.js +50 -0
- package/autochangelog/src/routes/repository.routes.js +54 -0
- package/autochangelog/src/services/changelog.js +722 -0
- package/autochangelog/src/services/github.js +243 -0
- package/autochangelog/utils/logger.js +77 -0
- package/autochangelog/views/404.ejs +18 -0
- package/autochangelog/views/dashboard.ejs +596 -0
- package/autochangelog/views/index.ejs +231 -0
- package/autochangelog/views/layouts/main.ejs +44 -0
- package/autochangelog/views/login.ejs +104 -0
- package/autochangelog/views/partials/footer.ejs +20 -0
- package/autochangelog/views/partials/navbar.ejs +51 -0
- package/autochangelog/views/register.ejs +109 -0
- package/autochangelog-cli/README.md +266 -0
- package/autochangelog-cli/bin/autochangelog +120 -0
- package/autochangelog-cli/package.json +46 -0
- package/autochangelog-cli/src/cli/commands/auth.js +291 -0
- package/autochangelog-cli/src/cli/commands/changelog.js +619 -0
- package/autochangelog-cli/src/cli/commands/project.js +427 -0
- package/autochangelog-cli/src/cli/commands/repo.js +557 -0
- package/autochangelog-cli/src/cli/commands/stats.js +706 -0
- package/autochangelog-cli/src/cli/utils/config.js +277 -0
- package/autochangelog-cli/src/cli/utils/errors.js +307 -0
- package/autochangelog-cli/src/cli/utils/logger.js +75 -0
- package/autochangelog-cli/src/cli/utils/output.js +357 -0
- package/package.json +8 -3
- package/plugins/supercli/README.md +108 -0
- package/plugins/supercli/plugin.json +123 -0
- package/server.js +1 -1
- package/src/cli/api.js +380 -0
- package/src/cli/direct/agent-utils.js +61 -0
- package/src/cli/direct/cli-utils.js +112 -0
- package/src/cli/direct/data-seeding.js +307 -0
- package/src/cli/direct/db-admin.js +84 -0
- package/src/cli/direct/db-advanced.js +372 -0
- package/src/cli/direct/db-utils.js +558 -0
- package/src/cli/direct/help.js +195 -0
- package/src/cli/direct/migration.js +107 -0
- package/src/cli/direct/rbac-advanced.js +132 -0
- package/src/cli/direct/resources-additional.js +400 -0
- package/src/cli/direct/resources-cms-advanced.js +173 -0
- package/src/cli/direct/resources-cms.js +247 -0
- package/src/cli/direct/resources-core.js +253 -0
- package/src/cli/direct/resources-execution.js +367 -0
- package/src/cli/direct/resources-health.js +152 -0
- package/src/cli/direct/resources-integrations.js +182 -0
- package/src/cli/direct/resources-logs.js +204 -0
- package/src/cli/direct/resources-org-rbac.js +187 -0
- package/src/cli/direct/resources-system.js +236 -0
- package/src/cli/direct.js +556 -0
- package/src/controllers/admin.controller.js +4 -0
- package/src/controllers/auth.controller.js +148 -1
- package/src/controllers/waitingList.controller.js +130 -1
- package/src/models/RbacRole.js +1 -1
- package/src/models/User.js +39 -5
- package/src/routes/auth.routes.js +6 -0
- package/src/routes/waitingList.routes.js +12 -2
- package/src/routes/waitingListAdmin.routes.js +3 -0
- package/src/services/email.service.js +1 -0
- package/src/services/github.service.js +255 -0
- package/src/services/rateLimiter.service.js +29 -1
- package/src/services/waitingListJson.service.js +32 -3
- package/views/admin-waiting-list.ejs +386 -3
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
# AutoChangelog
|
|
2
|
+
|
|
3
|
+
AutoChangelog is a powerful, self-hosted changelog generation service that automatically creates beautiful, comprehensive changelogs from your GitHub repositories. Built with Node.js, Express, and MongoDB, it provides a complete solution for tracking and documenting your project's evolution.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### 🚀 Core Features
|
|
8
|
+
- **Automatic Changelog Generation**: Generate changelogs for any time period from your GitHub repositories
|
|
9
|
+
- **Multiple Output Formats**: Support for Markdown, HTML, and JSON formats
|
|
10
|
+
- **GitHub Integration**: Seamless integration with GitHub repositories and pull requests
|
|
11
|
+
- **Conventional Commits Support**: Parse and categorize commits using conventional commit standards
|
|
12
|
+
- **Multi-Project Support**: Manage multiple projects and repositories in one dashboard
|
|
13
|
+
- **Subscription-Based Limits**: Flexible plans with usage limits for projects, repositories, and changelogs
|
|
14
|
+
|
|
15
|
+
### 🔐 Authentication & Security
|
|
16
|
+
- **JWT Authentication**: Secure token-based authentication
|
|
17
|
+
- **GitHub OAuth**: Easy sign-up and authentication via GitHub
|
|
18
|
+
- **Role-Based Access**: Project ownership and access control
|
|
19
|
+
- **Rate Limiting**: API rate limiting to prevent abuse
|
|
20
|
+
- **CORS Protection**: Configurable CORS settings for frontend integration
|
|
21
|
+
|
|
22
|
+
### 📊 Project Management
|
|
23
|
+
- **Project Organization**: Create and manage multiple projects
|
|
24
|
+
- **Repository Management**: Connect and sync multiple GitHub repositories per project
|
|
25
|
+
- **Usage Tracking**: Monitor subscription usage and limits
|
|
26
|
+
- **Statistics & Analytics**: Detailed statistics for projects and repositories
|
|
27
|
+
- **Search & Filter**: Advanced search and filtering capabilities
|
|
28
|
+
|
|
29
|
+
### 🔄 Automation & Integration
|
|
30
|
+
- **GitHub Webhooks**: Automatic changelog generation on commits
|
|
31
|
+
- **API-First Design**: Complete REST API for integration with other tools
|
|
32
|
+
- **Webhook Support**: Receive changelog generation events
|
|
33
|
+
- **Scheduled Generation**: Plan and schedule changelog generation
|
|
34
|
+
|
|
35
|
+
### 🎨 Customization
|
|
36
|
+
- **Multiple Templates**: Different changelog templates (default, Angular, Conventional)
|
|
37
|
+
- **Custom Formatting**: Configure commit categorization and formatting
|
|
38
|
+
- **Branding Options**: Customize changelog appearance and branding
|
|
39
|
+
- **Shareable Links**: Generate shareable links for public changelogs
|
|
40
|
+
|
|
41
|
+
## Tech Stack
|
|
42
|
+
|
|
43
|
+
### Backend
|
|
44
|
+
- **Node.js** - JavaScript runtime
|
|
45
|
+
- **Express.js** - Web application framework
|
|
46
|
+
- **MongoDB** - NoSQL database
|
|
47
|
+
- **Mongoose** - MongoDB object modeling
|
|
48
|
+
- **JWT** - Authentication tokens
|
|
49
|
+
- **Axios** - HTTP client for GitHub API
|
|
50
|
+
- **Winston** - Logging library
|
|
51
|
+
|
|
52
|
+
### Frontend (Integration Ready)
|
|
53
|
+
- **React/Vue/Angular** - Framework agnostic
|
|
54
|
+
- **REST API** - Full API for frontend integration
|
|
55
|
+
- **CORS Support** - Cross-origin resource sharing
|
|
56
|
+
|
|
57
|
+
### DevOps
|
|
58
|
+
- **Docker** - Containerization
|
|
59
|
+
- **Environment Variables** - Configuration management
|
|
60
|
+
- **Rate Limiting** - API protection
|
|
61
|
+
- **Security Headers** - Helmet.js for security
|
|
62
|
+
|
|
63
|
+
## Installation
|
|
64
|
+
|
|
65
|
+
### Prerequisites
|
|
66
|
+
- Node.js (v16 or higher)
|
|
67
|
+
- MongoDB (local or cloud instance)
|
|
68
|
+
- GitHub account for OAuth integration
|
|
69
|
+
|
|
70
|
+
### Quick Start
|
|
71
|
+
|
|
72
|
+
1. **Clone the repository:**
|
|
73
|
+
```bash
|
|
74
|
+
git clone <repository-url>
|
|
75
|
+
cd autochangelog
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. **Install dependencies:**
|
|
79
|
+
```bash
|
|
80
|
+
npm install
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
3. **Set up environment variables:**
|
|
84
|
+
```bash
|
|
85
|
+
cp .env.example .env
|
|
86
|
+
# Edit .env with your configuration
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
4. **Initialize the database:**
|
|
90
|
+
```bash
|
|
91
|
+
npm run init:db
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
5. **Start the server:**
|
|
95
|
+
```bash
|
|
96
|
+
npm start
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Environment Configuration
|
|
100
|
+
|
|
101
|
+
Create a `.env` file with the following variables:
|
|
102
|
+
|
|
103
|
+
```env
|
|
104
|
+
# Server Configuration
|
|
105
|
+
NODE_ENV=development
|
|
106
|
+
PORT=5000
|
|
107
|
+
FRONTEND_URL=http://localhost:3000
|
|
108
|
+
|
|
109
|
+
# Database
|
|
110
|
+
MONGODB_URI=mongodb://localhost:27017/autochangelog
|
|
111
|
+
MONGODB_URI_TEST=mongodb://localhost:27017/autochangelog_test
|
|
112
|
+
|
|
113
|
+
# Authentication
|
|
114
|
+
JWT_SECRET=your-super-secret-jwt-key
|
|
115
|
+
JWT_EXPIRES_IN=7d
|
|
116
|
+
|
|
117
|
+
# GitHub Integration
|
|
118
|
+
GITHUB_CLIENT_ID=your-github-client-id
|
|
119
|
+
GITHUB_CLIENT_SECRET=your-github-client-secret
|
|
120
|
+
GITHUB_CALLBACK_URL=http://localhost:5000/api/auth/github/callback
|
|
121
|
+
GITHUB_API_BASE_URL=https://api.github.com
|
|
122
|
+
|
|
123
|
+
# Logging
|
|
124
|
+
LOG_LEVEL=info
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## API Documentation
|
|
128
|
+
|
|
129
|
+
### Authentication Endpoints
|
|
130
|
+
|
|
131
|
+
#### POST /api/auth/register
|
|
132
|
+
Register a new user account.
|
|
133
|
+
|
|
134
|
+
**Request:**
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"email": "user@example.com",
|
|
138
|
+
"password": "password123",
|
|
139
|
+
"name": "John Doe"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### POST /api/auth/login
|
|
144
|
+
Login with email and password.
|
|
145
|
+
|
|
146
|
+
**Request:**
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"email": "user@example.com",
|
|
150
|
+
"password": "password123"
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### GET /api/auth/github/login
|
|
155
|
+
Get GitHub OAuth URL for authentication.
|
|
156
|
+
|
|
157
|
+
#### GET /api/auth/github/callback
|
|
158
|
+
Handle GitHub OAuth callback.
|
|
159
|
+
|
|
160
|
+
### Project Endpoints
|
|
161
|
+
|
|
162
|
+
#### POST /api/projects
|
|
163
|
+
Create a new project.
|
|
164
|
+
|
|
165
|
+
**Headers:** `Authorization: Bearer <token>`
|
|
166
|
+
|
|
167
|
+
**Request:**
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"name": "My Project",
|
|
171
|
+
"description": "A description of my project",
|
|
172
|
+
"tags": ["web", "api"],
|
|
173
|
+
"settings": {
|
|
174
|
+
"defaultBranch": "main",
|
|
175
|
+
"changelogTemplate": "default"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
#### GET /api/projects
|
|
181
|
+
Get all projects for the authenticated user.
|
|
182
|
+
|
|
183
|
+
#### GET /api/projects/:id
|
|
184
|
+
Get a specific project.
|
|
185
|
+
|
|
186
|
+
#### PUT /api/projects/:id
|
|
187
|
+
Update a project.
|
|
188
|
+
|
|
189
|
+
#### DELETE /api/projects/:id
|
|
190
|
+
Delete a project (soft delete).
|
|
191
|
+
|
|
192
|
+
### Repository Endpoints
|
|
193
|
+
|
|
194
|
+
#### POST /api/repositories
|
|
195
|
+
Connect a GitHub repository to a project.
|
|
196
|
+
|
|
197
|
+
**Request:**
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"projectId": "project-id",
|
|
201
|
+
"githubRepoId": "12345678",
|
|
202
|
+
"githubRepoName": "my-repo",
|
|
203
|
+
"githubRepoUrl": "https://github.com/user/my-repo",
|
|
204
|
+
"githubRepoOwner": "user",
|
|
205
|
+
"githubRepoFullName": "user/my-repo",
|
|
206
|
+
"name": "My Repository",
|
|
207
|
+
"description": "A description of my repository"
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
#### GET /api/repositories/:projectId
|
|
212
|
+
Get all repositories for a project.
|
|
213
|
+
|
|
214
|
+
#### POST /api/repositories/:id/sync
|
|
215
|
+
Sync repository data from GitHub.
|
|
216
|
+
|
|
217
|
+
### Changelog Endpoints
|
|
218
|
+
|
|
219
|
+
#### POST /api/changelogs
|
|
220
|
+
Generate a new changelog.
|
|
221
|
+
|
|
222
|
+
**Request:**
|
|
223
|
+
```json
|
|
224
|
+
{
|
|
225
|
+
"projectId": "project-id",
|
|
226
|
+
"repositoryId": "repository-id",
|
|
227
|
+
"month": "03",
|
|
228
|
+
"year": "2024",
|
|
229
|
+
"format": "markdown",
|
|
230
|
+
"template": "default",
|
|
231
|
+
"includeCommitsWithoutPR": true
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### GET /api/changelogs/project/:projectId
|
|
236
|
+
Get all changelogs for a project.
|
|
237
|
+
|
|
238
|
+
#### GET /api/changelogs/repository/:repositoryId
|
|
239
|
+
Get all changelogs for a repository.
|
|
240
|
+
|
|
241
|
+
#### GET /api/changelogs/:id
|
|
242
|
+
Get a specific changelog.
|
|
243
|
+
|
|
244
|
+
#### POST /api/changelogs/:id/share
|
|
245
|
+
Make a changelog publicly shareable.
|
|
246
|
+
|
|
247
|
+
#### GET /api/changelogs/share/:shareToken
|
|
248
|
+
Get a public changelog by share token.
|
|
249
|
+
|
|
250
|
+
## Database Schema
|
|
251
|
+
|
|
252
|
+
### User Model
|
|
253
|
+
- **email**: Unique user email
|
|
254
|
+
- **password**: Hashed password
|
|
255
|
+
- **name**: User's display name
|
|
256
|
+
- **GitHub Integration**: GitHub OAuth tokens and user info
|
|
257
|
+
- **Subscription**: Plan type and usage limits
|
|
258
|
+
- **Usage Tracking**: Current usage statistics
|
|
259
|
+
- **Preferences**: User preferences and settings
|
|
260
|
+
|
|
261
|
+
### Project Model
|
|
262
|
+
- **name**: Project name
|
|
263
|
+
- **description**: Project description
|
|
264
|
+
- **slug**: URL-friendly project identifier
|
|
265
|
+
- **Ownership**: User and organization ownership
|
|
266
|
+
- **Settings**: Project-specific configuration
|
|
267
|
+
- **Metadata**: Statistics and tracking data
|
|
268
|
+
- **Tags**: Project categorization tags
|
|
269
|
+
|
|
270
|
+
### Repository Model
|
|
271
|
+
- **GitHub Information**: Repository metadata from GitHub
|
|
272
|
+
- **Authentication**: GitHub access tokens
|
|
273
|
+
- **Configuration**: Repository-specific settings
|
|
274
|
+
- **Sync Status**: Last sync information and status
|
|
275
|
+
- **Webhook**: GitHub webhook configuration
|
|
276
|
+
- **Features**: Enabled GitHub features (issues, PRs, releases)
|
|
277
|
+
|
|
278
|
+
### Changelog Model
|
|
279
|
+
- **Content**: Generated changelog content
|
|
280
|
+
- **Format**: Output format (markdown, html, json)
|
|
281
|
+
- **Status**: Generation status and metadata
|
|
282
|
+
- **Version Information**: Semantic versioning data
|
|
283
|
+
- **Sharing**: Public sharing configuration
|
|
284
|
+
- **Statistics**: Generation and view statistics
|
|
285
|
+
|
|
286
|
+
## Development
|
|
287
|
+
|
|
288
|
+
### Running in Development
|
|
289
|
+
|
|
290
|
+
1. **Start MongoDB:**
|
|
291
|
+
```bash
|
|
292
|
+
# If using Docker
|
|
293
|
+
docker run -d -p 27017:27017 mongo:latest
|
|
294
|
+
|
|
295
|
+
# Or start local MongoDB instance
|
|
296
|
+
mongod
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
2. **Start the development server:**
|
|
300
|
+
```bash
|
|
301
|
+
npm run dev
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
3. **Run database initialization:**
|
|
305
|
+
```bash
|
|
306
|
+
npm run init:db
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Available Scripts
|
|
310
|
+
|
|
311
|
+
- `npm start` - Start the production server
|
|
312
|
+
- `npm run dev` - Start the development server with nodemon
|
|
313
|
+
- `npm run init:db` - Initialize the database and create indexes
|
|
314
|
+
- `npm test` - Run tests (when implemented)
|
|
315
|
+
- `npm run lint` - Run linting (when configured)
|
|
316
|
+
|
|
317
|
+
### Project Structure
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
autochangelog/
|
|
321
|
+
├── src/
|
|
322
|
+
│ ├── app.js # Main application file
|
|
323
|
+
│ ├── server.js # Server entry point
|
|
324
|
+
│ ├── config/
|
|
325
|
+
│ │ └── database.js # Database configuration
|
|
326
|
+
│ ├── controllers/ # Route controllers
|
|
327
|
+
│ │ ├── auth.js
|
|
328
|
+
│ │ ├── project.js
|
|
329
|
+
│ │ ├── repository.js
|
|
330
|
+
│ │ └── changelog.js
|
|
331
|
+
│ ├── middleware/ # Custom middleware
|
|
332
|
+
│ │ └── auth.js
|
|
333
|
+
│ ├── models/ # Mongoose models
|
|
334
|
+
│ │ ├── User.js
|
|
335
|
+
│ │ ├── Project.js
|
|
336
|
+
│ │ ├── Repository.js
|
|
337
|
+
│ │ └── Changelog.js
|
|
338
|
+
│ ├── routes/ # Route definitions
|
|
339
|
+
│ │ ├── auth.routes.js
|
|
340
|
+
│ │ ├── project.routes.js
|
|
341
|
+
│ │ ├── repository.routes.js
|
|
342
|
+
│ │ └── changelog.routes.js
|
|
343
|
+
│ ├── services/ # Business logic services
|
|
344
|
+
│ │ ├── github.js
|
|
345
|
+
│ │ └── changelog.js
|
|
346
|
+
│ └── utils/ # Utility functions
|
|
347
|
+
│ └── logger.js
|
|
348
|
+
├── scripts/ # Database scripts
|
|
349
|
+
├── logs/ # Application logs
|
|
350
|
+
├── public/ # Static files
|
|
351
|
+
├── package.json
|
|
352
|
+
├── .env.example # Environment variables template
|
|
353
|
+
└── README.md
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## Deployment
|
|
357
|
+
|
|
358
|
+
### Docker Deployment
|
|
359
|
+
|
|
360
|
+
1. **Build the Docker image:**
|
|
361
|
+
```bash
|
|
362
|
+
docker build -t autochangelog .
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
2. **Run with Docker Compose:**
|
|
366
|
+
```bash
|
|
367
|
+
docker-compose up -d
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Production Deployment
|
|
371
|
+
|
|
372
|
+
1. **Set production environment variables**
|
|
373
|
+
2. **Build and optimize the application**
|
|
374
|
+
3. **Set up a production MongoDB instance**
|
|
375
|
+
4. **Configure reverse proxy (nginx)**
|
|
376
|
+
5. **Set up SSL/TLS certificates**
|
|
377
|
+
6. **Configure monitoring and logging**
|
|
378
|
+
|
|
379
|
+
## Contributing
|
|
380
|
+
|
|
381
|
+
We welcome contributions! Please follow these steps:
|
|
382
|
+
|
|
383
|
+
1. Fork the repository
|
|
384
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
385
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
386
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
387
|
+
5. Open a Pull Request
|
|
388
|
+
|
|
389
|
+
## License
|
|
390
|
+
|
|
391
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
392
|
+
|
|
393
|
+
## Support
|
|
394
|
+
|
|
395
|
+
- **Documentation**: [API Documentation](#api-documentation)
|
|
396
|
+
- **Issues**: [GitHub Issues](https://github.com/your-repo/autochangelog/issues)
|
|
397
|
+
- **Discussions**: [GitHub Discussions](https://github.com/your-repo/autochangelog/discussions)
|
|
398
|
+
|
|
399
|
+
## Contributing
|
|
400
|
+
|
|
401
|
+
Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
402
|
+
|
|
403
|
+
## License
|
|
404
|
+
|
|
405
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
406
|
+
|
|
407
|
+
## Acknowledgments
|
|
408
|
+
|
|
409
|
+
- [GitHub API](https://docs.github.com/en/rest) - For providing access to repository data
|
|
410
|
+
- [Conventional Commits](https://www.conventionalcommits.org/) - For commit message standards
|
|
411
|
+
- [Express.js](https://expressjs.com/) - For the web framework
|
|
412
|
+
- [Mongoose](https://mongoosejs.com/) - For MongoDB object modeling
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const logger = require('../utils/logger');
|
|
3
|
+
|
|
4
|
+
const connectDB = async () => {
|
|
5
|
+
try {
|
|
6
|
+
const conn = await mongoose.connect(process.env.MONGODB_URI, {
|
|
7
|
+
useNewUrlParser: true,
|
|
8
|
+
useUnifiedTopology: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
logger.info(`MongoDB Connected: ${conn.connection.host}`);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
logger.error('Database connection error:', error);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const disconnectDB = async () => {
|
|
19
|
+
try {
|
|
20
|
+
await mongoose.disconnect();
|
|
21
|
+
logger.info('MongoDB disconnected');
|
|
22
|
+
} catch (error) {
|
|
23
|
+
logger.error('Error disconnecting from MongoDB:', error);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
module.exports = { connectDB, disconnectDB };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "autochangelog",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Micro SaaS for generating changelogs from GitHub repositories",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node server.js",
|
|
8
|
+
"dev": "nodemon server.js",
|
|
9
|
+
"test": "jest"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"changelog",
|
|
13
|
+
"github",
|
|
14
|
+
"git",
|
|
15
|
+
"automation",
|
|
16
|
+
"saas"
|
|
17
|
+
],
|
|
18
|
+
"author": "AutoChangelog Team",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@intranefr/superbackend": "file:/home/jarancibia/ai/superbackend",
|
|
22
|
+
"axios": "^1.13.2",
|
|
23
|
+
"bcryptjs": "^2.4.3",
|
|
24
|
+
"conventional-changelog": "^5.0.0",
|
|
25
|
+
"conventional-commits-parser": "^5.0.0",
|
|
26
|
+
"cors": "^2.8.5",
|
|
27
|
+
"dotenv": "^16.3.1",
|
|
28
|
+
"ejs": "^3.1.9",
|
|
29
|
+
"express": "^4.18.2",
|
|
30
|
+
"express-rate-limit": "^7.1.5",
|
|
31
|
+
"express-validator": "^7.0.1",
|
|
32
|
+
"helmet": "^7.1.0",
|
|
33
|
+
"jsonwebtoken": "^9.0.2",
|
|
34
|
+
"mongoose": "^8.0.0",
|
|
35
|
+
"morgan": "^1.10.1",
|
|
36
|
+
"multer": "^1.4.5-lts.1",
|
|
37
|
+
"node-cron": "^4.2.1",
|
|
38
|
+
"simple-git": "^3.22.0",
|
|
39
|
+
"uuid": "^9.0.1",
|
|
40
|
+
"winston": "^3.11.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"jest": "^29.7.0",
|
|
44
|
+
"nodemon": "^3.0.1",
|
|
45
|
+
"supertest": "^7.1.4"
|
|
46
|
+
}
|
|
47
|
+
}
|