# 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 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 ```