💀 REST API/PSR-7 project skeleton based on @nette @apitte @contributte @nettrine
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Controllers: improvements Feb 1, 2019
bin Bump Dec 29, 2018
db
docs/assets Bump Dec 29, 2018
log Bump Dec 29, 2018
temp Bump Dec 29, 2018
tests Tests: added own constraint + validator Jan 26, 2019
www Bump Dec 29, 2018
.editorconfig Bump Dec 29, 2018
.gitignore Bump Dec 29, 2018
LICENSE Bump Dec 29, 2018
Makefile Make: added app-init Jan 25, 2019
README.md Readme: added demo link Jan 28, 2019
composer.json
composer.lock Feature: added symfony/serializer and symfony/validator Jan 25, 2019
phpstan.neon Bump Dec 29, 2018
ruleset.xml Typos Jan 25, 2019

README.md

Forest Project

Forest project is an example project based on Nette Framework and many useful packages by @f3l1x.

Why forest? Because we are building (fo)REST API.

Goal

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

Focused on:

  • nette/* packages
  • 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/*

Demo

http://examples.planette.io/planette/forest-project/

Install

  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 him if you want.

    Default configuration should looks like:

    # Host Config
    parameters:
    
        # Database
        database:
            host: localhost
            dbname: forest
            user: forest
            password: forest
  4. Database is running, application is configure to connect to it. 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 app-init.

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

    PHP server is started by php -S localhost:8000 -t www or use prepared make task make loc-web.

  6. Open http://localhost and enjoy it!

    Take a look at:

Features

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

  • 📦 Packages
    • Nette 2.4
    • 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 detail look 👀 at each single package.

Apitte

Nettrine

Nette

Symfony

Demo