Installation

Follow these steps to install and run the project locally on your computer.

  1. Clone repository

    git clone https://github.com/Odilbukh/achievements.git
  2. Go to project directory

    cd path-to-project
  3. Install dependencies

    composer install
  4. Set up environment file DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=
    DB_USERNAME=
    DB_PASSWORD=

  5. Generate application key

    php artisan key:generate
    
  6. Start migrations and populate the database

    php artisan migrate
    php artisan db:seed
    
  7. Start the server

    php artisan serve      

Your application will be available at: http://127.0.0.1:8000

Endpoints

  • GET /users/{user}/achievements params: user_id
  • POST /comments/create params: [
    user_id: int
    text: string ]
  • POST /lessons/watched
    params: [
    user_id: int
    lesson_id: int ]
    !! Use header "Accept: application/json" !!