Basic RestAPI for CRM
Hey! I´m Jafar Jabbarzadeh, a wannabe software engineer from Las Palmas de Gran Canaria! https://www.linkedin.com/in/jafarjabbarzadeh/ And this is a no framework PHP project using PDO for a RestApi including Okta Authentication and an example CRM for testing!
These instructions will get you a copy of the project up and running on your local machine with XAMPP for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Import the SQL file located inside the SQL folder (WARNING: Write, update and delete functions will only work with the included DB) and if using Okta OAuth2 create an account and new application to get necessary data, tutorials on how to get your client started are on the official website https://www.okta.com/, further explanation down below!
Make sure your file is inside Drive:\xampp\htdocs if using XAMPP for the local server.
Open “conection.php” inside “php” folder and modify the variables $dsn, $user, $password and $dbName to your data.
If you don´t want to use Okta Auth then delete or ignore the “oauth2.php” file inside the “PHP” folder and go to the file “authetication.php” and comment out or delete this line.
If you wanted to use Okta inside “oauth2.php” change the following variables to your data.
Now go and play with the API, oh, you want to deploy it?
I mean it doesn´t change much. Make sure you get the user and password of the DB your provider provides, insert them into your connection file, don´t forget to import the given SQL, and set up your OAuth2.
In my case https://www.siteground.es/ was used, I added it in a folder at my existing website, visit it if you want a little test https://glytchware.com/ProjectGlytchware/RESTApi/CRM/access.php, access it using the account “user” with password “user”. Just a reminder that there is no mobile version yet. The CRM is only for testing and only works on desktop.
If you want to access the API through a Dev tool like https://www.postman.com/ follow the instructions. This will be expecting your conection.php file to be properly set up with your db and credentials. Everything you´ll receive will be in JSON format.
For any issues regarding the code, be it something not working properly or with my attempts at explaining, even for suggestions, contact directly trough my LinkedIn https://www.linkedin.com/in/jafarjabbarzadeh/. I´m still fairly new to this so issues can exist. Thanks!
This project is licensed under the MIT License - see the LICENSE.md file for details