Code Monkey home page Code Monkey logo

mental-test's Introduction

Mental Stack Test

First configure environment

Then create a database

php bin/console doctrine:database:create

Then run migrations

bin/console doctrine:migrations:migrate --no-interaction

Create OAuth2 client

bin/console fos:oauth-server:create-client --grant-type=password --grant-type=refresh_token Note client_id and client_secret

Run dev server

php bin/console server:start

Then register new user with

curl -X POST \
  {{url}}/api/v1/register \
  -H 'Content-Type: application/json' \
  -d '{
	"username": "Ivan",
	"email": "[email protected]",
	"password": "123123"
}'

Get OAuth2 Token

curl -X POST \
  {{url}}/oauth/v2/token \
  -H 'Content-Type: application/json' \
  -d '{
  "grant_type": "password",
  "client_id": "{client_id}",
  "client_secret": "{client_secret}",
  "username": "[email protected]",
  "password": "123123"
}'

Not a token

Create task

curl -X POST \
  {{url}}/api/v1/todo \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json' \
  -d '{
	"title": "lol",
	"description": "kek"
}'

List tasks

curl -X GET \
  {{url}}/api/v1/todo/list \
  -H 'Authorization: Bearer {token}'

Mark task as done

curl -X POST \
  {{url}}/api/v1/todo/{task_id} \
  -H 'Authorization: Bearer {token}'

API Endpoints Postman Collection

https://web.postman.co/collections/1576355-bdd50073-497c-4e79-bbff-98a501090c30?workspace=1b4b23a9-967f-4327-8017-46678d2cffb7

mental-test's People

Contributors

sabahtalateh avatar

Watchers

James Cloos avatar  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.