Skip to content

AskNicely frontend code test with backend REST API implemented with Symfony

Notifications You must be signed in to change notification settings

asknicely/frontend-code-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

This repo provides a very basic REST API backend for our Todo list app, using Symfony and api-platform. Authentication is done via JWT. Docker is used to provide a consistent dev experience.

Tasks:

  • Please read following steps to get the REST API up and running.
  • Implement the frontend for the Todo list app
    • Being able to see a list of todos
    • Being able to add a todo
    • Being able to mark a todo as done
    • Being able to delete a todo
  • Add pagination as you see fit
  • Style the pages as you see fit
  • Use Vue or React to implement the frontend. Feel free to serve the frontend files via Symfony or Vue cli service, etc.
  • Provide a PR for your work.

Note: we value PR description and commit messages a lot, so please provide meaningful commit messages and PR descriptions as well as testing instructions.

Steps to get REST API ready

Start docker: docker-compose up

Install composer libs: docker-compose exec server composer install

Setup tables: docker-compose exec server php bin/console doctrine:schema:update --force

Generate JWT key pairs: docker-compose exec server php bin/console lexik:jwt:generate-keypair

Register your user: http://localhost:8101/register

Using the REST API:

  • View REST API docs: http://localhost:8101/api/docs
  • Generate a sample token by clicking the try it out section of Token resource, provided with the user credentials you just registered.

Screen Shot 2022-03-24 at 1 45 31 PM

  • Once you get a token, scroll to top of page and click on authorise button to authorise the API, content will be bearer YOUR_TOKEN_STRING

Screen Shot 2022-03-24 at 1 43 38 PM

  • Then you should be able to try out the rest of APIs on the page.

Other useful things:

rebuild image: docker-compose build

website: http://localhost:8101/

phpMyAdmin http://localhost:8102/

References:

Scaffold docker and symfony

Rest API with Symforny and api-platform

api-platform using JWT

JWT authentication with Symfony

Auto set current User

Filter results for current User with Extensions

Update table schema with Doctrine:

php bin/console doctrine:schema:update --dump-sql
php bin/console doctrine:schema:update --force

To generate jwt keypair: php bin/console lexik:jwt:generate-keypair

To generate user provider: php bin/console make:user

Create migration for db changes:

php bin/console make:migration
php bin/console doctrine:migrations:migrate

To generate registration form: php bin/console make:registration-form

To sync metadata storage: php bin/console doctrine:migrations:sync-metadata-storage

About

AskNicely frontend code test with backend REST API implemented with Symfony

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published