Git Product home page Git Product logo

owl-realworld-app's Introduction

RealWorld Example App

Deploy on Netlify

OWL (Odoo Web Library) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with OWL (Odoo Web Library) including CRUD operations, authentication, routing, pagination, and more.

This is best use as learning material, some part of the code can still be refactored but over-complexity is not the intent here. This implementation is meant to cover all of OWL features in a complete application example.

The whole process of creating this implementation is available as a tutorial series:

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

This project is using OWL 1.4.7 with Rollup.js as a bundler and Jest for the tests.

The structure of the project is as follow:

├── src
│   ├── App.js
│   ├── components
│   │   ├── ArticleMeta.js
│   │   ├── ArticlePreview.js
│   │   ├── ArticlesList.js
│   │   ├── CommentsSection.js
│   │   ├── Footer.js
│   │   ├── Navbar.js
│   │   ├── NavbarLink.js
│   │   ├── Pagination.js
│   │   └── TagsCloud.js
│   ├── hooks
│   │   ├── useApi.js
│   │   ├── useArticleActions.js
│   │   ├── useArticleLoader.js
│   │   └── useProfileActions.js
│   ├── main.js
│   ├── pages
│   │   ├── ArticlePage.js
│   │   ├── Editor.js
│   │   ├── Home.js
│   │   ├── LogIn.js
│   │   ├── Profile.js
│   │   ├── Register.js
│   │   ├── Settings.js
│   │   └── index.js
│   └── utilities
│       └── formatdate.js
└── tests
    ├── components
    │   └── App.test.js
    └── helpers.js

What is covered here:

  • OWL Store to get user state, authentication actions, getters, synchronisation with LocalStorage
  • Usage of Axios for API Calls placed inside a custom useApihook
  • Routing
    • Dynamic routing with parameters: Article page, Editor, Profile page
    • Routing guards for authenticated routes
  • willStart, willUpdateProps examples for Components that fetch data from API before rendering and after changes.
  • triggering custom events from child Components listening to events in parent component.
  • hooks onWillStart, onWillUpdateProps for dynamic component loading data at render.
  • custom hooks to share logic of API actions with examples of:
    • useEnv to access router
    • useGetters to access store actions
    • useComponent to trigger event

Getting started

Install dependencies:

npm install

Dev with livereload:

npm run dev

Production build

npm run build

Run tests

npm run test

Contributors

Made with contributors-img.

Coding Dodo

owl-realworld-app's People

Contributors

phildl avatar nl66278 avatar

Watchers

Usman Farzand 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.