Skip to content

Latest commit

 

History

History
161 lines (120 loc) · 6.63 KB

README.md

File metadata and controls

161 lines (120 loc) · 6.63 KB

Server Tracking ERP System

This is a simple server tracking and managesment system which provides functionalities for users to create, read and delete servers including ram modules.

Technologies Used

  • PHP 8.0.5
  • PHPUnit 9.5
  • Symfony 5.4
  • Respect Validation 2.2
  • MySQL 8.0
  • Vue3
  • Axios
  • Docker
  • Docker-Compose

Key Functionalities - Backend

  • 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

Key Functionalities - Frontend

  • 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

Pre-requisites

  • Docker
  • Docker-Compose

Installation (on Ubuntu)

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)

http://localhost:9001/

  • Access the web application at,

http://localhost:4200/

Tests Added

  • 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

Installation (on Windows or Mac)

API Details

  • 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.

Test APIs On Postman

  • 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.

image

  • 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.

Frontend Walkthrough

  • 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.

image

  • 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.

image

  • 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.

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)
  • 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.

Further Improvements If Time Permitted - Backend

  • 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.

Further Improvements If Time Permitted - Frontend

  • Add front end validations.
  • Make the front end more attractive by styling.

Contact Details