Giter Club home page Giter Club logo

social_network's Introduction

Заготовка для социальной сети

  • клонируйте репозиторий
git clone [email protected]:dkuba/social_network.git
  • создайте .env файл рядом c .env.example
  • поднимите сервисы
docker-compose up -d --build

По-умолчанию сервис будет на порту 8000, а база на порту 5432.

Примеры запросов

Создать пользователя

Запрос:

curl --location 'localhost:8000/v1/users' \
--header 'Content-Type: application/json' \
--data-raw '{"username": "Foo",
"password": "123",
"email": "[email protected]",
"first_name": "Vova",
"last_name": "Vovin",
"date_of_birth": "2018-01-10",
"user_gender": "муж",
"city": "Москва",
"interests": "everythings"
}'

Ответ:

{
    "user_id": "b922b380-3f38-4897-b0c5-b3ca7a5e7ac4"
}

Логин

Запрос:

curl --location 'localhost:8000/v1/login' \
--header 'Content-Type: application/json' \
--data '{"username": "Foo",
"password": "123"}'

Ответ:

{
    "session_token": "Wg1tyNq27xFdnTiZ-PZmnF93UY5Vsdj6waO8b3mrGNo"
}

Информация о пользователе по id

Запрос:

curl --location 'localhost:8000/v1/users/b922b380-3f38-4897-b0c5-b3ca7a5e7ac4' \
--header 'Authorization: Bearer Wg1tyNq27xFdnTiZ-PZmnF93UY5Vsdj6waO8b3mrGNo'

Ответ:

{
    "username": "Foo",
    "password": "123",
    "email": "[email protected]",
    "first_name": "Vova",
    "last_name": "Vovin",
    "date_of_birth": "2018-01-10",
    "user_gender": "муж",
    "city": "Москва",
    "interests": null,
    "id": "b922b380-3f38-4897-b0c5-b3ca7a5e7ac4"
}

Настрйока кластера баз данных

Предварительно необходимо провести настройку кластера БД по инструкции: https://github.com/OtusTeam/highload/blob/master/lessons/02/05/live/guide.md

social_network's People

Contributors

dkuba21 avatar dkuba 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.