Git Product home page Git Product logo

elixir-phoenix-rest-boilerplate's Introduction

Elixir-Phoenix-REST-Boilerplate

Hllo

This is an experimental template piece of software I'm working on for personal projects.

The exciting thing about using elixir as opposed to flask or express-node is that phoenix is fast.

Phoenix on average has a response time of 400µs.

This will hopefully be a useful and simple guide to more experienced developers who know how to use web/backend frameworks to create applications.

You can read through this guide and possibly convert your applications.

So it's perfect for building scalable REST API's that can handle a LOT of traffic at once, while still being usable.

IN LITERALLY THE FIRST STAGE OF DEVELOPMENT.

Don't hack on this, I'm keeping this here for convenience as this is something new that I'm messing with.

How it works.

Phoenix has 4 layers to its requests.

route -> controller -> view -> template

Most of the functionality lies in the following files.

File Summary Location
router This contains all the routes and route handlers for your application web/router.ex
controller So you define each controller in a separate file, they then handle sending the response, either through a view or with JSON. web/page_controller.ex
view usually a function to prepare a template to be sent back web/templates/page_view
template This is where our templates are actually stored, where you can use an erb type syntax to complete variables inside of the template. web/templates/page/index.html.eex

DEVELOPMENT

To start your new Phoenix application:

  1. Install dependencies with mix deps.get
  2. Start Phoenix endpoint with mix phoenix.server

Now you can visit localhost:4000 from your browser.

You can find out more about the phoenix framework on http://www.phoenixframework.org/.

Resources

https://robots.thoughtbot.com/testing-a-phoenix-elixir-json-api

elixir-phoenix-rest-boilerplate's People

Watchers

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