Clean up for mini: remove other envs, add devbox/direnv

This commit is contained in:
Chris Rai
2026-01-13 21:24:46 -05:00
parent 33da34151d
commit d2c361de4a
23 changed files with 40 additions and 1010 deletions

View File

@@ -1,69 +1,38 @@
# Fisker Admin Portal
# OTA Admin Portal
Front-end web application for administrating services.
Front-end web application for OTA administration.
# Setup
## Setup
Running locally
```bash
# Install dependencies
npm install
1. Install Node 16
2. Run `npm install`
3. Copy .env.template to .env and edit the service urls for authentication and api services
4. Run `./run.sh` from the terminal
5. Access portal at localhost:3000
# Run locally
npm start
# Access at http://localhost:3000
```
Running Docker container
## Build & Deploy
1. Copy .env.template to .env and edit the service urls for authentication and api services
2. Build the image `docker build --build-arg ENVIRONMENT=local -t fiskerinc/portal .`
3. Start the container `docker run -p 3000:80 fiskerinc/portal`
4. Access portal at localhost:3000
```bash
# Build for mini environment
npm run build
## Available Scripts
# Build Docker image
docker build --build-arg ENVIRONMENT=mini -t gitea.mini.cloud.fiskerinc.com/admin/ota-admin-portal:latest .
In the project directory, you can run:
# Push to Gitea registry
docker push gitea.mini.cloud.fiskerinc.com/admin/ota-admin-portal:latest
```
### `npm start`
## Environment
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
- `.env.local` - Local development
- `.env.mini` - Mini cluster (Mac Mini)
The page will reload if you make edits.\
You will also see any lint errors in the console.
## Deployment
### `npm test`
Deployed via ArgoCD from `k8s/` helm chart with `values-mini.yaml`.
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
URL: https://ota-admin.mini.cloud.fiskerinc.com