Nava is web application with RESTFUL API created for NAVA interview homework.
Nava handles CRUD operation
- Create images
- Read image
- Update already created images
- Delete images
NAVA project uses a number of open source projects:
Requirements:
-
PHP version 7.3 or newer is required, with the *intl* extension and *mbstring* extension installed.
-
The following PHP extensions should be enabled on your server: php-json, php-mysqlnd, php-xml
-
MySQL (5.1+) via the MySQLi driver
-
Composer package manager installed. (minimum version 2.1.6)
Install the MYSQL dump
cd nava
mysql -u [username] -p
CREATE DATABASE database_name;
USE database_name;
SOURCE dump.sql;
Install the dependencies and start the server.
cd nava/backend
composer install
Create the .env file based on the env file in the nava/backend directory.
Set the database configuration in the .env file under the # DATABASE comment. And after that we can start the server:
php spark serve
Newest Node version is required.
cd nava/frontend
npm install
Copy the nava/frontend/src/envExample.js to nava/frontend/src and rename it to: env.js After that go back to the frontend root directory and we can start the server:
npm start
Nava contains the following routes to provide response:
URL | HTTP Verb | Action | Description |
---|---|---|---|
/images | GET | Index | Show all images |
/images | POST | Create | Create a new image |
/images/:id | GET | Show | Show image with :id |
/images/:id | PUT | Update | Update image with :id |
/images/:id | DELETE | Destroy | Delete image with :id |