项目作者: patykmar

项目描述 :
IP 4/6 calculator, Backend: Symfony PHP Frontend: React
高级语言: PHP
项目地址: git://github.com/patykmar/ip-calc.git
创建时间: 2021-05-09T19:26:35Z
项目社区:https://github.com/patykmar/ip-calc

开源协议:

下载


IPv4 and IPv6 calculator

Web application which provide you a details about IP v4 and v6 network subnet. This project is divided to two parts:

  • Frontend (FE) - React application which is calling methods from Backend part
  • Backend (BE) - PHP - Symfony application which is providing methods for calculate information regarding IP subnet via
    API.

How to use it - development

Download and unzip project file in to your folder or use git.

git clone https://github.com/patykmar/ip-calc.git

Download FE dependencies

For download dependencies please use npm tool.

  • cd <project-folder>/frontend
  • npm install

Download BE dependencies

For download dependencies please use composer tool. You should have PHP CLI interpret installed
on your computer/container.

  • cd <project-folder>/backend
  • composer install

Start BE part of application

Change directory to backend cd <project-folder>/backend. For start application you have two options:

  • run via symfony tool symfony server:start
  • or via PHP php -S 127.0.0.1:8000 -t public

You can check, if everything is working fine, when open your web browser and go
to http://localhost:8000 address.

Start FE part of application

Change directory to frontend cd <project-folder>/frontend.

  • run via npm tool npm start

You can check, if everything is working fine, when open your web browser and go
to http://localhost:3000 address.

How to use it in production

Deploy FE

Modify API URL based on your system

Open files:

  • <project-folder>/frontend/src/components/ipcalc/Ipv4Layout.js
  • <project-folder>/frontend/src/components/ipcalc/Ipv6Layout.js

Change API_URL value based on your system IP o domain.

  1. const API_URL = "http[s]://<location-of-backend-part>/";

Download dependencies

  • cd <project-folder>/frontend
  • npm install
  • npm run build

Copy all files from folder <project-folder>/frontend/build to www/public folder on your server.

Deploy BE

Before you start download dependencies, update file <project-folder>/backend/.env or create new file <project-folder>/backend/.env.local where change value APP_ENV=dev to APP_ENV=prod.
For more information please visit How to Deploy a Symfony Application

Download dependencies

  • cd <project-folder>/backend
  • composer install --no-dev --optimize-autoloader

Copy all files from folder <project-folder>/backend to www/public folder on your server. Most probably to different folder as FE part.

For example:

  • <app-name> for front end
  • <app-name-api> for back end

Where you can find CLI tools

CI

PHPStan

  1. ./vendor/bin/phpstan analyse src --memory-limit 256m --level 9