Coder Social home page Coder Social logo

omarmakled / symfony-microservice Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 774 KB

Symfony6 microservice demo

License: MIT License

Makefile 3.02% PHP 62.43% Dockerfile 4.58% HTML 1.14% JavaScript 9.85% Vue 18.98%
docker docker-compose mysql php8 rabbitmq symfony6 vue3 vutify microservice

symfony-microservice's Introduction

Symfony6 Microservice Demo

Screenshot from 2023-03-19 20-16-15

Installation

  • To start the project you need to run docker compose up -d it will pull the images if not exists and spin up the containers.

  • Run make install to install dependencies if this is the first time. ๐ŸŽฏ

Import data

  • Run make import this command will fetch data from a specific API and insert it into DB.
  • Send a confirmation email async for each inserted row. see rabbitmq

Open client

Screenshot from 2023-03-19 20-18-11

Run make client this will run vuejs project with hot reload

Run Tests

Run make test to execute all tests

RabbitMQ

Screenshot from 2023-03-19 20-31-22

Sending email async you can check queue messages where each message contains serialized data which will use on the consumer side for sending emails

Rabbitmq http://localhost:15672/

  • username: user
  • password: password

API

base url http://localhost:8080

type url description
GET /api/fruits Get list of fruites
GET /api/fruits/name Get list of names
GET /api/fruits/family Get list of familes

Get list of fruits

GET /api/fruits

"total": 324,
"items": [
{
   "id": 1,
   "name": "Apple",
   "family": "Rosaceae",
   "order": "Rosales",
   "genus": "Malus",
   "nutritions": {
      "fat": 0.4,
      "sugar": 10.3,
      "protein": 0.3,
      "calories": 52,
      "carbohydrates": 11.4
  }
}, ...]

Get list of names

GET /api/fruits/name

"items": [
   "Apple",
   "Apricot",
   "Avocado",
   "Banana",
   "Blackberry",
]

Get list of families

GET /api/fruits/family

"items": [
   "Rosaceae",
   "Lauraceae",
   "Musaceae",
   "Ericaceae",
   "Cactaceae",
   "Malvaceae",
]

Code standard

You can check the code against the PSR-12 coding standard and eslint by running make autofix

Stop/Start containers

Run make stop or make up to start containers again

symfony-microservice's People

Contributors

omarmakled avatar

Watchers

 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.