|
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. |
2 | 4 |
|
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. |
0 commit comments