2.5 KiB
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:
-
Clone the Repository:
git clone <repository-url> cd yet-another-nginx-proxy-manager -
Install Dependencies: Use pnpm to install the project dependencies:
pnpm install cargo install sea-orm-cli -
Set Up Environment Variables: Create a
.envfile in the root directory and configure the necessary environment variables. You can use the provided.env.exampleas a template.
Backend Development
-
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:
just simulateThis command will start the necessary services in Docker containers using test-containers.
-
Start the API Server: In a separate terminal, navigate to the
apps/apidirectory and start the backend server:cd apps/api cargo run
Frontend Development
If backend API interactions are required, ensure they are running before starting the frontend.
-
Set Up Frontend Environment Variables: Create a
.envfile in theapps/frontenddirectory and configure the necessary environment variables. You can follow the.env.examplefile as a guide. -
Start the Frontend Development Server: In another terminal, navigate to the
apps/frontenddirectory and start the frontend development server: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.
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.
just generate-openapi