Skip to content

Commit 579768f

Browse files
committed
Merge branch 'dev' of github.com:contentstack/migration-v2-node-server into feature/migration-wordpress-integration
2 parents 146a797 + 5437675 commit 579768f

File tree

134 files changed

+62531
-7977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+62531
-7977
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* @contentstack/tso-migration-pr-reviewers
2+
.github/workflows/sca-scan.yml @contentstack/security-admin
3+
.github/workflows/sast-scan.yml @contentstack/security-admin
4+
.github/workflows/jira.yml @contentstack/security-admin
5+
**/.snyk @contentstack/security-admin

.github/workflows/jira.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Create JIRA ISSUE
2+
on:
3+
pull_request:
4+
types: [opened]
5+
jobs:
6+
security-jira:
7+
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}}
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Login into JIRA
12+
uses: atlassian/gajira-login@master
13+
env:
14+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
15+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
16+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
17+
- name: Create a JIRA Issue
18+
id: create
19+
uses: atlassian/gajira-create@master
20+
with:
21+
project: ${{ secrets.JIRA_PROJECT }}
22+
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
23+
summary: |
24+
${{ github.event.pull_request.title }}
25+
description: |
26+
PR: ${{ github.event.pull_request.html_url }}
27+
28+
fields: "${{ secrets.JIRA_FIELDS }}"
29+
- name: Transition issue
30+
uses: atlassian/gajira-transition@v3
31+
with:
32+
issue: ${{ steps.create.outputs.issue }}
33+
transition: ${{ secrets.JIRA_TRANSITION }}

.github/workflows/sast-scan.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: SAST Scan
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security-sast:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Semgrep Scan
11+
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}:/src" returntocorp/semgrep semgrep scan --config auto

.github/workflows/sca-scan.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Source Composition Analysis Scan
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security-sca:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- name: Run Snyk to check for vulnerabilities
11+
uses: snyk/actions/node@master
12+
env:
13+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
14+
with:
15+
args: --all-projects --fail-on=all

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*.user
1010
*.userosscache
1111
*.sln.docstates
12-
package-lock*
1312

1413
# User-specific files (MonoDevelop/Xamarin Studio)
1514
*.userprefs
@@ -353,7 +352,6 @@ MigrationBackup/
353352

354353
upload-api/node_modules
355354
upload-api/build
356-
package-lock.json
357355
ui/.env
358356
upload-api/sitecoreMigrationData
359357
upload-api/cmsMigrationData

README.md

Lines changed: 188 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,189 @@
1-
# migration-v2
1+
# Migration v2
2+
## Overview
3+
The migration-v2 project is designed to facilitate the migration of assets and related functionalities. This project includes multiple components such as API, UI, and upload API.
24

3-
This is the migration V2 Code.
5+
## Installation
6+
Clone the repository:
7+
```
8+
git clone https://github.com/contentstack/migration-v2.git
9+
cd migration-v2
10+
```
11+
12+
Check for readme.md files and install dependencies for folders
13+
14+
## Migration-v2 API
15+
16+
This is the migration V2's node server.
17+
18+
### Environment Variables
19+
The following environment variables are used in this project:
20+
21+
- `APP_TOKEN_KEY`: The token key for the application. Default is `MIGRATION_V2`.
22+
- `PORT`: The port number on which the application runs. Default is `5001`.
23+
24+
Make sure to set these variables in a `.env` file at the root of your project.
25+
26+
1. To run the development server, create a `./development.env` file and add environment variables as per `./example.env`
27+
2. To run the production server, create a `./production.env` file and add environment variables as per `./example.env`
28+
29+
### To start the server
30+
Run `npm run dev`
31+
32+
33+
## Migration UI
34+
35+
Migration UI is a web application designed to facilitate the migration of content. It provides a user-friendly interface for managing and migrating content efficiently.
36+
37+
### Features
38+
- User-friendly interface for content migration
39+
- Integration with Contentstack
40+
- State management with Redux Toolkit
41+
- Comprehensive testing with Testing Library
42+
43+
### Installation
44+
45+
1. Navigate to the project directory:
46+
```sh
47+
cd ui
48+
```
49+
50+
2. Install the dependencies:
51+
```sh
52+
npm install
53+
```
54+
55+
### Environment Variables
56+
57+
The following environment variables are used in this project:
58+
59+
- `REACT_APP_WEBSITE_BASE_URL`: The base URL for the website. Default is `http://localhost:3000/`.
60+
- `REACT_APP_BASE_API_URL`: The base URL for the API. Default is `http://localhost:5001/`.
61+
- `REACT_APP_API_VERSION`: The version of the API. Default is `v2`.
62+
- `REACT_APP_HOST`: The host URL for the application. Default is `http://localhost:3000`.
63+
- `REACT_APP_UPLOAD_SERVER`: The URL for the upload server. Default is `http://localhost:4002/`.
64+
- `REACT_APP_OFFLINE_CMS`: A flag to indicate if the CMS is offline. Default is `true`.
65+
66+
Make sure to set these variables in a `.env` file at the root of your ui project.
67+
68+
### Usage
69+
Start the development server:
70+
```sh
71+
npm start
72+
```
73+
74+
Open your browser and navigate to http://localhost:3000.
75+
76+
### Dependencies
77+
- @contentstack/json-rte-serializer: ^2.0.5
78+
- @contentstack/venus-components: ^2.2.4
79+
- @reduxjs/toolkit: ^2.2.5
80+
- @testing-library/jest-dom: ^5.17.0
81+
- @testing-library/react: ^13.4.0
82+
- @testing-library/user-event: ^13.5.0
83+
- @types/react: ^18.2.28
84+
- @types/react-dom: ^18.2.13
85+
- @types/react-redux: ^7.1.33
86+
87+
## Migration v2 upload-api
88+
### Overview
89+
The migration-v2 upload-api project is designed to facilitate the migration of different CMS to Contentstack functionalities.
90+
91+
### Installation
92+
Navigate to the project directory:
93+
```
94+
cd migration-v2/upload-api
95+
```
96+
Install dependencies:
97+
```
98+
npm install
99+
```
100+
101+
### Environment Variables
102+
103+
The following environment variables are used in this project:
104+
105+
- `PORT`: The port number on which the application runs. Default is `4002`.
106+
- `NODE_BACKEND_API`: The backend API endpoint. Default is `http://localhost:5001`.
107+
108+
Make sure to set these variables in a `.env` file at the root of your project.
109+
110+
### Configuration
111+
Please refer sample.config.json and provide this config in index.ts of config folder of upload-api/src
112+
The following configuration is used in this project:
113+
114+
- `plan.dropdown.optionLimit`: The limit for dropdown options. Default is `100`.
115+
- `cmsType`: The type of CMS used. Default is `sitecore`.
116+
- `isLocalPath`: A flag to indicate if the path is local. Default is `true`.
117+
118+
#### AWS Data
119+
- `awsRegion`: The AWS region. Default is `us-east-2`.
120+
- `awsAccessKeyId`: The AWS access key ID.
121+
- `awsSecretAccessKey`: The AWS secret access key.
122+
- `awsSessionToken`: The AWS session token.
123+
- `bucketName`: The name of the AWS S3 bucket. Default is `migartion-test`.
124+
- `buketKey`: The key for the AWS S3 bucket. Default is `project/package 45.zip`.
125+
126+
#### Local Path
127+
- `localPath`: The local path to the extracted files. for example `/upload-api/extracted_files/package 45.zip`.
128+
129+
## Cli
130+
Navigate to the project directory
131+
1. Install pnpm
132+
Since pnpm is required, you need to install it globally if it's not already installed:
133+
```
134+
npm install -g pnpm
135+
```
136+
2. Run the Setup Script
137+
Now, run the main setup script specified in the package.json:
138+
```
139+
npm run setup-repo
140+
```
141+
142+
## Scripts
143+
- `npm start`: Starts the main server by running index.js.
144+
- `npm run api`: Navigates to the api directory and runs the development server.
145+
- `npm run upload`: Navigates to the upload-api directory and starts the upload API server.
146+
- `npm run ui`: Navigates to the ui directory and starts the UI server.
147+
- `npm run env`: Starts the main server by running npm start.
148+
- `npm run postinstall`: Installs dependencies for the api, ui, and upload-api directories.
149+
- `npm test`: Displays an error message indicating that no tests are specified.
150+
151+
## Repository
152+
- Type: git
153+
- URL: https://github.com/contentstack/migration-v2.git
154+
155+
## Bugs and Issues
156+
- URL: https://github.com/contentstack/migration-v2/issues
157+
158+
## Homepage
159+
- URL: https://github.com/contentstack/migration-v2#readme
160+
161+
## DevDependencies
162+
- husky: ^4.3.8
163+
- prettier: ^2.4.1
164+
- rimraf: ^3.0.2
165+
- validate-branch-name: ^1.3.0
166+
167+
## Husky Configuration
168+
```
169+
"husky": {
170+
"hooks": {}
171+
}
172+
```
173+
174+
- Branch Name Validation
175+
```
176+
"validate-branch-name": {
177+
"pattern": "^(feature|bugfix|hotfix)/[a-z0-9-]{5,30}$",
178+
"errorMsg": "Please add valid branch name!"
179+
}
180+
```
181+
182+
## License
183+
This project is licensed under the ISC License.
184+
185+
## Author
186+
The author information is not specified.
187+
188+
## Contact
189+
For further assistance, please contact the project maintainer through the issues page on GitHub.

api/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ MigrationBackup/
356356
error.log
357357
combine.log
358358

359-
package-lock.json
360359

361360
!example.env
362361

api/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
# migration-v2-node-server
2-
3-
This is the TSO migration V2's node server.
4-
5-
## To start the server
6-
7-
1. Run `npm i`
8-
2. Install & start MongoDB
9-
3. To run dev server, create `./development.env` file and add env variables as per `./example.env`
10-
4. To run prod server, create `./production.env` file and add env variables as per `./example.env`

0 commit comments

Comments
 (0)