Skip to content

kdefarge/BileMoAPI

Repository files navigation

BileMoAPI

SymfonyInsight Codacy Badge

BileMoAPI is a Symfony API application with api-platform

Table of Contents

Installation

install BileMoAPI with composer

git clone [email protected]:kdefarge/BileMoAPI.git
cd BileMoAPI
composer install

Setup

Update .env file

# Config database
# MariaDB (dont forget version X.X.X with your version)
DATABASE_URL="mysql://USER:PASSWRD@SERVER:PORT/DB_NAME?serverVersion=mariadb-X.X.X"

Install database

# Doctrine can create the DB_NAME database for you
php bin/console doctrine:database:create
# Create database schema
php bin/console doctrine:schema:create

Generate the SSL keys

You need OpenSLL and run this command to generate the SSL keys

php bin/console lexik:jwt:generate-keypair

Update jwt config in your .env

###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=b11c0ae29c7f88b75d5e71281f38ac69
###< lexik/jwt-authentication-bundle ###

Running BileMo API

cd BileMoAPI
symfony server:start

Open your browser and navigate to http://localhost:8000/. If everything is working, you’ll see a welcome page. Later, when you are finished working, stop the server by pressing Ctrl+C from your terminal.

To access the API documentation navigate to https://localhost:8000/docs

Fixture

Run dev fixture

# load all the 'dev' fixtures
php bin/console hautelook:fixtures:load

Test

Select your PHPUnit version

<!-- phpunit.xml.dist -->
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5.4" />

Run all test

php bin/phpunit

Run one part test

php bin/phpunit --filter testLoginJWT
php bin/phpunit --filter testMobile
php bin/phpunit --filter testCustumer
php bin/phpunit --filter testUsers
php bin/phpunit --filter testCommands

Test other database

Update .env.test and DATABASE_URL then create the database with schema

php bin/console doctrine:database:create --env=test
php bin/console doctrine:schema:create --env=test

Tools used

Maintainers

@kdefarge

License

MIT © Kévin DEFARGE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published