Skip to content

A Slim-based application skeleton for implementing REST-based Web services.

License

Notifications You must be signed in to change notification settings

frostybee/slim-template

Repository files navigation

Slim-Based Application Skeleton

This repository contains an application skeleton for creating REST-based Web services. The latest version of the Slim micro framework is being used.

How Do I Use/Deploy this Template?

Follow the instructions below in the specified order:

  1. Download this repository as .zip file.
  2. Extract the downloaded slim-template-main.zip file locally.
  3. Copy the slim-template-main folder into your Web server's document root (that is, htdocs)
  4. Rename the slim-template-main folder to [project_name]-api. For example, worldcup-api
  5. Open your [project_name]-api folder in VS Code
  6. Open a terminal window in VS Code (hit Ctrl+`), and run the following command to install or update the required dependencies in a VS Code terminal window (hit Ctrl+`)
composer.bat update

NOTE: You can always clone this repository. However, if you do, you need to remove the .git hidden directory before you copy this template over to htdocs

How Do I Connect to a Database?

The database credentials info are stored in app/config/app_config.php.

  • Change the value of DB_NAME constant to reflect the name of the database to be used by your slim app.
  • You may also want to change the database connection credentials in that file.

On Using Environment Variables

Do not use .env files for storing environment specific application settings/configurations. Dotenv is not meant to be used in production

Just Google: "DB_PASSWORD" filetype:env Google

Instead, follow the instructions that are detailed in config/env.example.php

Dependencies


The following dependencies have been already added to this template.

  1. slim/slim:"4.*"
  2. guzzlehttp/guzzle
  3. vlucas/phpdotenv
  4. firebase/php-jwt
  5. monolog/monolog

Optional: you can use composer to either update the referenced dependencies or add additional ones based on your implementation's requirements.

VS Code Extensions


Listed below are recommended VS Code extensions for Web development. However, most of them are already included in .vscode/extensions.json

PHP, HTML, and JavaScript

  1. Thunder Client
  2. Path Intellisense
  3. GitLens — Git supercharged
  4. PHP IntelliSense
  5. PHP Intelephense
  6. PHP Debug
  7. PHP Extension Pack
  8. ESLint
  9. JavaScript (ES6) code snippets
  10. HTML Snippets

Markdown

  1. Markdown All in One
  2. markdownlint
  3. Markdown Preview Github Styling
  4. Markdown PDF

Productivity

  1. Code Spell Checker
  2. Bookmarks

Appearance

  1. Material Icon Theme

Dark Themes

  1. Evondev Dracula
  2. Tokyo Night
  3. Dracula Official

About

A Slim-based application skeleton for implementing REST-based Web services.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages