planette/forest-project

This package is abandoned and no longer maintained. The author suggests using the contributte/apitte-skeleton package instead.

🎁 API / REST API / JSON API / PSR-7 / Middlewares project skeleton based on Nette Framework (@nette), Apitte (@apitte), Doctrine (@nettrine) and Contributte (@contributte) libraries by @f3l1x.

Installs: 14 589

Dependents: 0

Suggesters: 0

Security: 0

Stars: 40

Watchers: 3

Forks: 18

Open Issues: 6

Type:project

dev-master 2024-04-19 01:55 UTC

README

68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f636f6e74726962757474652f6170697474652d736b656c65746f6e2f6d6173746572 68747470733a2f2f62616467656e2e6e65742f636f766572616c6c732f632f6769746875622f636f6e74726962757474652f6170697474652d736b656c65746f6e 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f646d2f636f6e74726962757474652f6170697474652d736b656c65746f6e 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f636f6e74726962757474652f6170697474652d736b656c65746f6e

68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f636f6e74726962757474652f6170697474652d736b656c65746f6e 68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f636f6e74726962757474652f6170697474652d736b656c65746f6e 68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f6769747465722f6379616e 68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f666f72756d2f79656c6c6f77 68747470733a2f2f62616467656e2e6e65742f62616467652f73706f6e736f722f646f6e6174696f6e732f463936383534

Website 🚀 contributte.org | Contact 👨🏻‍💻 f3l1x.io | Twitter 🐦 @contributte

68747470733a2f2f6170692e6d6963726f6c696e6b2e696f3f75726c3d68747470732533412532462532466578616d706c65732e636f6e74726962757474652e6f72672532466170697474652d736b656c65746f6e253246266f7665726c61792e62726f777365723d6c696768742673637265656e73686f743d74727565266d6574613d66616c736526656d6265643d73637265656e73686f742e75726c

Goal

Main goal is to provide best prepared API starter-kit project for Nette-Apitte developers.

Focused on:

  • PHP 8.2+
  • nette/* packages
  • build PSR-7 API via contributte/apitte
  • Doctrine ORM via nettrine/*
  • Symfony components via contributte/*
  • codestyle checking via CodeSniffer and contributte/qa
  • static analysing via phpstan and contributte/phpstan
  • unit / integration tests via Nette Tester and contributte/tester

You can try it out yourself either by running it with docker, or more easily with docker-compose.

Demo

https://examples.contributte.org/apitte-skeleton/

Install with docker

  1. At first, use composer to install this project.

    composer create-project -s dev contributte/apitte-skeleton
  2. After that, you have to setup database.

    1. Setup PostgreSQL 10. You can start it manually or use docker image dockette/postgres:15.

      docker run -it -p 5432:5432 -e POSTGRES_PASSWORD=contributte -e POSTGRES_USER=contributte dockette/postgres:15

      Or use make task, make docker-postgres.

    2. Setup MariaDB 10.4. You can start it manually or use docker image mariadb:10.4.

      docker run -it -d -p 3306:3306 -e MARIADB_ROOT_PASSWORD=contributte -e MARIADB_PASSWORD=contributte -e MARIADB_USER=contributte -e MARIADB_DATABASE=contributte mariadb:10.4

      Or use make task, make docker-mariadb.

  3. Custom configuration file is located at config/local.neon. Edit it if you want.

    Default configuration should look like this. Pick PostgreSQL or MariaDB.

    # Host Config
    parameters:
    
        # Database
        database:
    
            # Postgres
            driver: pdo_pgsql
            host: database
            dbname: contributte
            user: contributte
            password: contributte
            port: 5432
    
            # MariaDB
            driver: pdo_mysql
            host: database
            dbname: contributte
            user: contributte
            password: contributte
            port: 3306
  4. Ok database is now running and application is configured to connect to it. Let's create initial data.

    Run NETTE_DEBUG=1 bin/console migrations:migrate to create tables. Run NETTE_DEBUG=1 bin/console doctrine:fixtures:load --append to create first user(s).

    Or via task make build.

  5. Start your devstack or use PHP local development server.

    You can start PHP server by running php -S localhost:8000 -t www or use prepared make task make dev.

  6. Open http://localhost and enjoy!

    Take a look at:

Install with docker compose

  1. At first, use composer to install this project.

    composer create-project -s dev contributte/apitte-skeleton
    
  2. Modify config/local.neon and set host to postgres or mariadb

    Default configuration should look like this. There is preconfigured database. Pick PostgreSQL or MariaDB.

    # Host Config
    parameters:
    
        # Database
        database:
    
            # Postgres
            driver: pdo_pgsql
            host: database
            dbname: contributte
            user: contributte
            password: contributte
            port: 5432
    
            # MariaDB
            driver: pdo_mysql
            host: database
            dbname: contributte
            user: contributte
            password: contributte
            port: 3306
  3. Run docker-compose up

  4. Open http://localhost and enjoy!

    Take a look at:

(Optional) REST API documentation

Since we have OpenAPI specification available at /api/public/v1/openapi/meta you just need to add UI for it (e.g. to www/doc directory or as a standalone application).

Available options are:

Features

Here is a list of all features you can find in this project.

  • PHP 8.2+
  • 📦 Packages
    • Nette 3+
    • Contributte
  • 🌳 Structure
    • app
      • config - configuration files
        • env - prod/dev/test environments
        • app - application configs
        • ext - extensions configs
        • local.neon - local runtime config
        • local.neon.dist - template for local config
      • domain - business logic and domain specific classes
      • model - application backbone
      • module - API module
      • resources - static content for mails and others
      • bootstrap.php - Nette entrypoint
    • bin - console entrypoint (bin/console)
    • db - database files
      • fixtures - PHP fixtures
      • migrations - migrations files
    • docs - documentation
    • vae
      • log - runtime and error logs
      • tmp - temp files and cache
    • tests - test engine and many cases
      • tests/cases/E2E - PhpStorm's requests files (api.http)
      • tests/cases/Integration
      • tests/cases/Unit
    • vendor - composer's folder
    • www - public content
  • ❗ Tracy
    • Cool error 500 page

Composer packages

Take a detailed look 👀 at each single package.

Doctrine

Nette

Symfony

Demo

Development

See how to contribute to this package.

This package is currently maintaining by these authors.

538058?v=3&s=80

Consider to support contributte development team. Also thank you for using this project.