planette/forest-project

Forest project is opinionated API-based kit based on Nette Framework + Apitte and many useful packages by @f3l1x.

Installs: 14 570

Dependents: 0

Suggesters: 0

Security: 0

Stars: 21

Watchers: 1

Forks: 8

Open Issues: 0

Type:project

dev-master 2021-01-25 05:44 UTC

This package is auto-updated.

Last update: 2021-01-25 05:45:48 UTC


README

Forest project is opinionated API-based kit based on Nette Framework + Apitte and many useful packages by @f3l1x. Why forest? Because we are building (fo)REST API.

Take a look at demo examples.contributte.org/planette/forest-project/

screenshot1.png

68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f706c616e657474652f666f726573742d70726f6a6563742f6d61737465723f63616368653d333030 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f706c616e657474652f666f726573742d70726f6a656374 68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f706c616e657474652f666f726573742d70726f6a656374 68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f6769747465722f6379616e 68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f666f72756d2f79656c6c6f77 68747470733a2f2f62616467656e2e6e65742f62616467652f73706f6e736f722f646f6e6174696f6e732f463936383534

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

Goal

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

Focused on:

  • latest PHP 7.4 & 8.0
  • nette/* packages
  • build PSR-7 API via apitte/*
  • Doctrine ORM via nettrine/*
  • Symfony components via contributte/*
  • codestyle checking via CodeSniffer and ninjify/*
  • static analysing via phpstan
  • unit / integration tests via Nette Tester and ninjify/*

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

Demo

https://examples.contributte.org/planette/forest-project/

Install with docker

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

    composer create-project planette/forest-project
    
  2. After that, you have to setup Postgres >= 10 database. You can start it manually or use docker image postgres:10.

    docker run -it -p 5432:5432 -e POSTGRES_PASSWORD=forest -e POSTGRES_USER=forest postgres:10
    

    Or use make task, make loc-postgres.

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

    Default configuration should look like:

    # Host Config
    parameters:
    
        # Database
        database:
            host: localhost
            dbname: forest
            user: forest
            password: forest
  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 loc-api.

  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 planette/forest-project
    
  2. Modify app/config/config.local.neon and set host to database

    Default configuration should look like this:

    # Host Config
    parameters:
    
        # Database
        database:
            host: database
            dbname: forest
            user: forest
            password: forest
  3. Run docker-compose up

  4. Open http://localhost and enjoy!

    Take a look at:

Features

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

  • PHP 7.4+
  • 📦 Packages
    • Nette 3.0
    • Apitte
    • Contributte
    • Nettrine
  • 🌳 Structure
    • app
      • config - configuration files
        • env - prod/dev/test environments
        • app - application configs
        • ext - extensions configs
        • config.local.neon - local runtime config
        • 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
    • log - runtime and error logs
    • temp - 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.

Apitte

Nettrine

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.