padaszewski / instagram-for-animals

Web service implemented with Elixir & Phoenix.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Instagram For Animals

This is a web service build for the subject Web Services on the HSZG.
It allows You to register a user, add photos and also comment those.
Everything is controlled by REST-API.

In case You want to start this Application (is a Phoenix server on port 4000):

  • Install Elixir: instructions.
  • Install Phoenix: instructions.
  • Install PostgreSQL 12 here.
  • Configure PostgresSQL. Needed configuration: user: postgres (should be by default), password: postgres. Instructions.
  • In any command-prompt step if asked Y/n just accept with Y and confirm with enter.
  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup. Can throw errors if PostgreSQL wrong configured or not working.
  • Install Node.js dependencies with cd assets && npm install
  • Don't forget to go back to project root directory with cd ..
  • Start Phoenix endpoint with mix phx.server (probably fails if port 4000 is already in use)

Now You can test the REST-API. The recommended way is to use Postman.
Available routes with mix phx.routes.

Example:

HTTP-POST on localhost:4000/api/registration with form-data:

user[email] : example@example.com
user[password] : password
user[confirm_password] : password

After sending this request You can log-in with Your credentials (if registration was successfully done).

HTTP-POST on localhost:4000/session with form-data:

user[email] : example@example.com
user[password] : password

As response You become a token to verify Your identity. Every time You want access some restricted paths You have to authorize Yourself with this token.

In order to do this add the header:
Authorization : paste_here_your_valid_token

About

Web service implemented with Elixir & Phoenix.


Languages

Language:Elixir 50.7%Language:Dart 33.9%Language:CSS 9.0%Language:JavaScript 3.2%Language:HTML 2.0%Language:Dockerfile 0.4%Language:Swift 0.3%Language:Kotlin 0.3%Language:Shell 0.1%Language:Objective-C 0.0%