https://github.com/svp1989/symfony-api-skeleton
rest api skeleton based on symfony-flex, api-platform, fosuserbundle etc.
https://github.com/svp1989/symfony-api-skeleton
fosuserbundle jwt rest-api symfony-flex symfony4
Last synced: 3 months ago
JSON representation
rest api skeleton based on symfony-flex, api-platform, fosuserbundle etc.
- Host: GitHub
- URL: https://github.com/svp1989/symfony-api-skeleton
- Owner: svp1989
- License: mit
- Created: 2018-03-22T15:02:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T11:25:20.000Z (almost 8 years ago)
- Last Synced: 2023-07-16T01:06:02.739Z (over 2 years ago)
- Topics: fosuserbundle, jwt, rest-api, symfony-flex, symfony4
- Language: PHP
- Homepage:
- Size: 175 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# symfony-api-skeleton
JSON REST API simple skeleton based on symfony-flex, JWT, api-platform, fosuserbundle etc.
## Installation
### 1. Clone repository
Create project :
```bash
composer create-project svp1989/symfony-api-skeleton:@dev
```
Or clone repository from GitHub:
```bash
git clone https://github.com/svp1989/symfony-api-skeleton.git
```
### 2. Dependencies installation
Install all needed dependencies:
```bash
composer install
```
### 3. Create JWT auth keys
Create JWT auth keys and configure `.env`:
```bash
ssh-keygen -t rsa -b 4096 -f private.pem
openssl rsa -in private.pem -pubout -outform PEM -out public.pem
```
### 4. Configuration
Create `.env` file, which contains all the necessary
environment variables that application needs:
```bash
cp .env.dist .env
```
### 5. Create database
Create database and upload fixtures:
```bash
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console doctrine:fixtures:load
```
### 6. Start server
Start server and open in the browser http://127.0.0.1:8000/api/doc:
```bash
bin/console server:start
```
## Authorisation
Go to route /api/login:
**ROLE_USER**:
--username:**user**
--password:**user**
**ROLE_ADMIN**
--username:**admin**
--password:**admin**