Giter VIP home page Giter VIP logo

symfony-sample-backend's Introduction

Sample Project

===================

This Application based on the php, nginx and sqlite as database engine.

Requirements

Installation

This installation guide expects that you're using docker-compose.

1. Start containers

For this just run following command:

docker-compose up -d --build

2. Using application

Connect to the php container container:

docker-compose exec php bash

Run following command to generate SSH keys:

openssl genpkey -out config/jwt/private.pem -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096
openssl pkey -in config/jwt/private.pem -out config/jwt/public.pem -pubout

Copy passphrase and past it to your .env.local file

2. Create .env.local

Create .env.local based on the .env file template. Pass passphrase from the previous step to the JWT_PASSPHRASE variable.

Usage

  1. Open / url to see the full list of available actions.
  2. Register new user with username and password on the /api/register route.
  3. Get JWT token for new user on the /api/login_check route.
  4. Pass the token to the Authorize section of the NelmioApiDoc.
  5. Enjoy.

Tests

Application has two types of tests:

  • Unit
  • Functional

1. Running Unit tests

vendor/bin/phpunit --testsuite Unit

2. Running Functional tests

Before this you need to create test DB as Functional tests use database.

bin/console doctrine:database:create -e test
bin/console doctrine:schema:create -e test

First command creates database based on parameters from .env.test. Second command creates schema.

Command to run function tests only:

vendor/bin/phpunit --testsuite Functional

Useful commands

make cache-clear - Runs clear cache command make cs-check - Runs PHP-CS-Fixer in dry run mode make cs-fix - Runs PHP-CS-Fixer and fix all possible issues. make - Shows available commands

symfony-sample-backend's People

Contributors

sidz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.