Skip to content

POC of Symfony CSV file importation, Rest Api and Many-to-Many relationship.

Notifications You must be signed in to change notification settings

diegoBSousa/symfony-api

Repository files navigation

Symfony 5 Proof of Concept Project

This project aims to demontrate a simple Rest Api implementation, Many-To-Many entities relationship, Symfony console command creation and CSV file importing.

Installation

Install symfony-api with docker-compose

  git clone [email protected]:diegoBSousa/symfony-api.git
  cd symfony-api
  docker-compose up -d

Importation Command

~$ symfony console app:import-posts ./file-name.csv

API Reference

Tag Entity

GET ALL TAGS

  GET /api/v1/tags?page=${page}&limit=${limit}

Query String Parameters

Parameter Type Description
page string Optional. Page number
limit string Optional. Items per page

CREATE TAG

  POST /api/v1/tags

JSON Body Parameters

Parameter Type Description
tag string Required. Tag name
posts integer[] Optional. Array of integer with Post Entity ID

UPDATE TAG

  PATCH /api/v1/tags

JSON Body Parameters

Parameter Type Description
tag string Optional. Tag name
posts integer[] Optional. Array of integer with Post Entity ID

DELETE TAG

  DELETE /api/v1/tags/${tagId}

URL Parameter

Parameter Type Description
tagId integer Required. Tag ID

Post Entity

GET ALL POSTS

  GET /api/v1/posts?page=${page}&limit=${limit}

Query String Parameters

Parameter Type Description
page string Optional. Page number
limit string Optional. Items per page

CREATE POST

  POST /api/v1/posts

JSON Body Parameters

Parameter Type Description
title string Required. Post title
content string Required. Post HTML Content
image url Required. Image url
tags integer[] Optional. Array of integer with Tag Entity ID

UPDATE POST

  PATCH /api/v1/posts

JSON Body Parameters

Parameter Type Description
title string Optional. Post title
content string Optional. Post HTML Content
image url Optional. Image url
tags integer[] Optional. Array of integer with Tag Entity ID

DELETE POST

  DELETE /api/v1/posts/${postId}

URL Parameter

Parameter Type Description
postId integer Required. Post ID

About

POC of Symfony CSV file importation, Rest Api and Many-to-Many relationship.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published