This is a simple server tracking and managesment system which provides functionalities for users to create, read and delete servers including ram modules.
- PHP 8.0.5
- PHPUnit 9.5
- Symfony 5.4
- Respect Validation 2.2
- MySQL 8.0
- Vue3
- Axios
- Docker
- Docker-Compose
- Create a server
- Get all servers
- Get a server by assetId
- Delete servers
- Add ram modules to server
- Get ram modules of a server
- Remove ram modules from server
- List all servers
- Delete servers
- List ram modules of a server
- Delete ram modules of a server (Until only one ram module is left)
- Create servers
- Docker
- Docker-Compose
- Install Docker and Docker-Compose (Refer https://docs.docker.com/engine/install/ubuntu/ and https://docs.docker.com/compose/install/).
- Clone this repository.
- Navigate in to the server directory in the cloned directory.
cd server-tracking-erp-system/server
- First copy the file .env.template by the name .env by executing the following command. (Ideally the mysql credentials should not be put in the file. But as I configured the mysql container with some default DB properties, I added them in to the .env.template file for your ease of installation).
cp .env.template .env
- Now you can build and up the containers by executing the following command inside the server-tracking-erp-system root directory,
docker-compose up -d --build
- After that access the php container by executing,
docker exec -it erp_php bash
- Navigate to the server directory.
cd /server
- Install the dependencies by executing,
composer install
- To execute the DB migrations, in the same directory execute the following command. This will create the database tables and add default data to necessary tables.
php bin/console doctrine:migrations:migrate
- Now all things are set and you can access the backend server at,
http://localhost:8080/
- Access the adminer console to view the database by typing the below URL in your web browser. (Provide the relevant credentials in the login screen of adminer)
- Access the web application at,
-
Unit Tests - Added for entity classes.
- For running the unit tests, in the server directory in the php container execute,
php bin/phpunit tests
or
./vendor/bin/phpunit tests
- Install Docker Desktop (Refer https://docs.docker.com/docker-for-windows/install/ or https://docs.docker.com/docker-for-mac/install/).
- Follow the above Ubuntu installation process. With docker, you won't have to do any other OS specific installation steps. Use the docker terminal to run the above commands.
- After cloning, navigate in to the apidoc directory in the server directory and open the index.html file in that directory in a web browser.
- You will see an ordered, detailed description of the APIs with the details and examples of parameters that should be passed to the APIs, responses that will be received, along with success and error codes.
- Navigate in to the postman directory which is in the server directory and open the file Server App.postman_collection.json.
- Copy the content inside the file.
- Open postman app and click on File->Import and in the opened window, select Raw Text.
- Then paste the copied content and click on continue button. By doing this, the api collection with sample request parameters will be imported to your postman.
- Now you can send requests to the APIs and see how they behave.
- Once you navigate to http://localhost:4200/ you will arrive at an interface as follows. This is the All Servers view where the details of all the servers are listed.
- You can delete a server by clicking on the Delete Server button.
- When you click on the Ram Details button, you'll be directed to the following interface. This is where all the ram modules of the particular server are listed.
- Here you can delete ram modules of the particular server by clicking on the Delete Ram button, but until only one ram module is left. When only one ram module is left the Delete Ram button will be disabled as a server must contain at least one ram.
- When you click on the Create Server link on the top you'll be directed to the server creation interface which looks like the following image.
- Here you can create servers by adding relevant details.
- Important points to keep in mind when creating servers
- As the front end validations are not yet implemented, please keep in mind the following things when inputting the relevant values.
- Asset ID - Give an integer with maximum 9 digits. (ex:- 123456780)
- Brand - Provide a valid string value.
- Name - Provide a valid string value.
- Price - Provide a valid float value. (ex:- 600.50)
- Remember to select at least one ram module with a quantity for it.
- Quantity - Provide a valid integer value. (ex:- 4)
- As the front end validations are not yet implemented, please keep in mind the following things when inputting the relevant values.
- After adding proper values you can create a server by clicking on the Create Server button. Once the server is successfully created, you'll be redirected to the All Servers view where you can verify the created server is listed properly.
- Implement user registration functionality.
- Implement user aunthentication mechanism (ex:- Using access tokens)
- Check api accessibility using the authentication mechanism to secure the APIs.
- Add more tests.
- Add front end validations.
- Make the front end more attractive by styling.
- Email:- ttcphilips@gmail.com