feat: add initial documentation and setup files for YANPM
All checks were successful
Test / test-frontend (pull_request) Successful in 23s
Test / frontend-build (pull_request) Successful in 26s
Verify / verify-generated-code (pull_request) Successful in 53s
Verify / verify-openapi-spec (pull_request) Successful in 6s
Test / test (pull_request) Successful in 1m15s
Test / lint (pull_request) Successful in 1m13s
Verify / verify-frontend-api-client (pull_request) Successful in 8s

This commit is contained in:
GW_MC
2025-12-05 21:09:58 +08:00
parent f9c1cac50f
commit 5668f465bb
6 changed files with 787 additions and 1 deletions

87
doc/development.md Normal file
View File

@@ -0,0 +1,87 @@
# Development
## Dependency
YANPM requires the following dependencies to be installed on your development machine:
- Node.js (version 20.x or later)
- pnpm (version 10.x or later)
- Docker (for running backend dependencies like databases)
- Rust-toolchain (for building the backend)
- Just (for task automation) (optional but recommended)
## Setting Up the Development Environment
To set up the development environment for Yet Another Nginx Proxy Manager (YANPM), follow these steps:
1. **Clone the Repository**:
```bash
git clone <repository-url>
cd yet-another-nginx-proxy-manager
```
2. **Install Dependencies**:
Use pnpm to install the project dependencies:
```bash
pnpm install
cargo install sea-orm-cli
```
3. **Set Up Environment Variables**:
Create a `.env` file in the root directory and configure the necessary environment variables. You can use the provided `.env.example` as a template.
## Backend Development
1. **Run Backend Dependencies**:
Use Docker to run any required backend services, such as databases. You can use the provided cli crate for initializing the dependencies:
```bash
just simulate
```
This command will start the necessary services in Docker containers using test-containers.
2. **Start the API Server**:
In a separate terminal, navigate to the `apps/api` directory and start the backend server:
```bash
cd apps/api
cargo run
```
## Frontend Development
If backend API interactions are required, ensure they are running before starting the frontend.
1. **Set Up Frontend Environment Variables**:
Create a `.env` file in the `apps/frontend` directory and configure the necessary environment variables. You can follow the `.env.example` file as a guide.
2. **Start the Frontend Development Server**:
In another terminal, navigate to the `apps/frontend` directory and start the frontend development server:
```bash
cd apps/frontend
pnpm dev
```
## Generate Artifacts After Modifications
After making changes to the below components, you need to regenerate the corresponding artifacts to keep the frontend and backend in sync.
### Database Entities
After modifying or adding new database entities, you need to regenerate the entity artifacts to keep the frontend in sync with the backend database schema.
```bash
just generate-entity
```
### Backend API routes
After modifying or adding new backend API routes, you need to regenerate the API client artifacts to ensure the frontend can interact with the updated backend.
```bash
just generate-openapi
```