This project is the frontend for the Code Push application, which facilitates seamless updates to applications by integrating with a backend service. It is built using modern web technologies to provide a user-friendly interface for managing updates.
- Manage application updates.
- View update history and status.
- Seamless integration with the backend API.
Below is a screenshot of the application:
This frontend is not protected by default. It should be deployed behind an SSO proxy or integrated with your own login system to ensure secure access.
- Node.js (version 16 or higher)
- npm or yarn package manager
-
Clone the repository:
git clone <repository-url> cd code-push-frontend
-
Install dependencies:
npm install # or yarn install -
Start the development server (hot reload):
yarn dev # or npm run devThe app will be available at
http://localhost:3002by default. -
Alternatively, you can start the app in standard mode:
npm start # or yarn start -
Open your browser and navigate to
http://localhost:3002.
To interact with the backend API, you need a valid token. You can generate one using the code-push-standalone CLI:
-
Install the CLI if you haven't already:
npm install -g code-push-standalone
-
Run the following command to generate a token:
code-push access-key add "<description>" -
Copy the generated token and use it in the frontend configuration or as required.
To customize the application, you can use a config.js file, environment variables, or pass parameters at runtime.
-
Create a
.envfile in the project directory to define environment variables:APP_TOKEN=your_token_here BACKEND_URL=https://api.mycodepush.com
-
Alternatively, you can pass these parameters directly when starting the application:
APP_TOKEN=your_token_here BACKEND_URL=https://api.mycodepush.com yarn start
-
You can also create a
config.jsfile in the project root to provide configuration. Seeconfig.example.jsfor the structure and supported fields. -
Restart the application for changes to take effect.
APP_TOKEN: The token generated using thecode-push-standaloneCLI.BACKEND_URL: The base URL of your backend API.
To create a production build, run:
npm run build
# or
yarn buildThe build artifacts will be stored in the dist/ directory.
To build and run the application using Docker:
-
Build the Docker image:
docker build -f Dockerfile . -t codepush-fe -
Run the Docker container:
docker run -p 8083:80 -e APP_TOKEN=your_token_here -e BACKEND_URL=https://api.mycodepush.com codepush-fe
-
Access the application at
http://localhost:8083.
You can also use a .env file for Docker by passing it with the --env-file option:
docker run -p 8083:80 --env-file .env codepush-feContributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push the branch.
- Open a pull request.
