GithubHelp home page GithubHelp logo

konshensx16 / symfony-todo-backend Goto Github PK

View Code? Open in Web Editor NEW
176.0 3.0 27.0 1.65 MB

This is the result of all the videos that were created in the series that i published on the playlist. LINK BELOW

PHP 95.89% HTML 4.11%
symfony symfony-api restful-api series videos lmao

symfony-todo-backend's Introduction

Symfony Todo API


About the series

Playlist to all the videos This series goes over how to create a really BASIC Symfony API, yeah i didn't use API platform but that's okay, Below is a list of all the libraries that were used in the series.

Libraries

Mistakes were made

I admit that a lot of the time i either said something that was misleading or i used the incorrect thing, let me explain.

  • Sometimes i returned a status code of 200 instead of 201 when CREATING.
  • CLARIFICATION: PATCH vs PUT, i said that PATCH is used to update a part of the document, i might have said it's used to update just one field or property but that's not true, it's used to update multiple parts but not the entire document, otherwise why you would use PATCH instead of PUT, thign mistake happened because the example i was looking had just one property and i said it used to update just one.

Create a user manually (for testing)

This is a complete section by itself because it seems like couple of people have had their share of headaches because of this, to create a user manually and save it in the dabase here's what i personally do, IT WORKS

Encode the password using the symfony command

This is extremely important especially if you have no idea what the hell is happening, use the following command to generate a hashed version of your password and then jut copy the value that was printed to you and put in your database. Command: php bin/console security:encode-password You will be prompted to enter the plaintext password that you want to be hashed, after clicking the return key (enter key) the hashed key will be generated for you.

Fields that i care about in the database

There are three main fields that i care about, and they are the email, password, roles. Theses are the value that i enter for my testing user just to make sure that my authentication system works.

  • email: [email protected]
  • roles: ["ROLE_USER"]
  • password: $2y$13$XPRUnZV1V9NI7Tya/a7fh.8/86VIZTA3LIA.4mKeuadnFDy2HqFNu

NOTE ABOUT THE PASSWORD: This password is the hashed version of [000000], just six zeros, and i got this result because the algorithm in the security file is set to auto, if you have bcrypt it could be different if you have a2rgony or whatever the hell that one is called, you will get something different

Troubleshooting and stuff

Bad credentials error

This one error could happen because of multiple error due to the very bad error reporting of this library or whatever is responsible for that, the main thing to keep in mind is anything could lead to this type of problems

Examples

  • Database server not running will throw this error.
  • The password is not encoded in the correct way.
  • You didn't generate the public and private keys files correctly.
  • The passphrase used during public and private key generation does not match the one used in the configuration file.
  • TODO (Add more as more emails come in)

Contributing

This project is open for everyone, if you notice anything wrong with my code, or even this readme, any mistakes are welcome.

Questions

Maybe this should've been above with the Contribution section but doesn't matter, if you have any question i think it would be nice to create an issue (Please open an issue no matter how trivial you think the question is, no one will charge you money for it) that way people with similar questions can look them up.

symfony-todo-backend's People

Contributors

konshensx16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

symfony-todo-backend's Issues

refresh token httponly cookie always return 401 authentication exception occured !!!

i am using react js with symfony 4.3 and when the token expires and the call to api/token/refresh is made the httponly cookie bearer token is deleted and refresh token seems to not work it always return code 401 and message authentication exception occured; ps i just used the same code u made and my frontend is totally sepreat from symfony backend

Duplicate code when setting adding and entity

Well first thing i need to learn proper titling.
Thanks to the comments sectio or noticing this

In the ListController::postListTaskAction i have a duplicate code that could be removed

            $task = new Task();
            $task->setTitle($title);
            $task->setList($list);
            $list->addTask($task);

the setList could be removed in this case since the same thing is being done in the Task.php entity.

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.