Skip to content

Frontend tools & code organization #9

Closed
wants to merge 20 commits into from

2 participants

@n1k0
Mozilla member
n1k0 commented Mar 24, 2013

Disclaimer: this is an opiniated proposition, it mostly aims at starting a discussion.

This PR suggests an architecture and tools for the Talkilla project. It's far from perfect, but I think it's possibly a good start.

Tools

I've selected tools I know & I'm comfortable with. They might be not the best, but they are fairly well know, maintained & documented, and they do the job for me:

The obvious reason to use such tools is to:

  • avoid reinventing the wheel
  • help structuring the code through well known conventions
  • avoid writing much boilerplate code to concentrate on implementing actual features
  • ease contributions

Yes, every point is possibly debatable and matter of taste, that's why this is a pull request aimed at starting a discussion.

Project structure & files organization

Let's walk through the /static folder, as we're mostly talking frontend here:

$ tree static
static
├── index.html         # main html file
└── scripts            # app frontend scripts
    ├── app.js         # main app script
    ├── collections    # backbone collections
    │   └── users.js   # users set
    ├── common.js      # common stuff (a.k.a `utils`)
    ├── config.js      # requirejs dependencies configuration
    ├── models         # backbone models
    │   └── user.js    # user model
    ├── routers        # backbone routers
    │   └── router.js  # main app router
    ├── templates      # handlebars templates
    │   ├── login.html # login template
    │   └── users.html # users list template
    └── views          # backbone views
        ├── login.js   # login view
        └── users.js   # users list view

Setup

Installation:

$ make install

Running the app:

$ make runserver

Head to http://127.0.0.1:5000, ou should get something like this:

Take a bit of your time to walk through the diff, and give your feedback.

Notes

  • @fqueze's PR #7 is already merged here;
  • known issue: if you refresh the page, you'll loose your current authentication status; storing it through localStorage might be a solution
This was referenced Mar 24, 2013
@dmose
Mozilla member
dmose commented Mar 25, 2013

Based on discussions in this morning's meeting, we're going to go with something like PR #11 (the minimal Backbone version) possibly with some updates.

@dmose dmose closed this Mar 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.