GithubHelp home page GithubHelp logo

nicseltzer / adonis-realworld-example-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hipsterbrown/adonis-realworld-example-app

0.0 0.0 0.0 230 KB

Real World App implementation using AdonisJS

Shell 0.12% TypeScript 99.88%

adonis-realworld-example-app's Introduction

RealWorld Example App

AdonisJS 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 AdonisJS including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the AdonisJS community styleguides & best practices.

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

How it works

Since AdonisJS is a "convention over configuration" type of framework, this codebase follows the architecture described by the documentation; starting with the initial web project scaffold. Along with the default packages, the following official packages are used as well:

  • @adonisjs/lucid: Database connections and ORM data layer (this app connects to a local sqlite database stored in tmp/)
  • @adonisjs/lucid-slugify: Generates slugs on models based on other fields
  • @adonisjs/auth: Authentication management integrated with Lucid (this app uses cookie sessions)

The app uses resourceful routes and controller actions for managing functionality.

No client-side JavaScript is used as none was required to match the expected feature-set described by the RealWorld spec.

Functionality is tested end-to-end using the provided testing framework with a custom plugin to integrate Playwright browser control and Testing Library queries. Run pnpm test, after going through the "Getting started" section below, to see the full coverage. These run headless in Firefox by default; view the live browser interactions by setting the HEADLESS environment variable to "0".

See the custom plugin code in the tests/bootstrap.ts until it is abstracted out into its own package

Getting started

This codebase relies on Node.js version 14+ as the runtime and pnpm for package management. I suggest using something like volta to quickly install and manage Node.js and associated tooling on your system. After those prerequisites have been met, run the follow commands to get started:

cp .env.example .env
pnpm install
pnpm db:setup
pnpm dev
  • cp .env.example .env: creates environment variable for local development
  • pnpm install: this installs the runtime and development dependencies for the project
  • pnpm db:setup: runs all the pending database migrations and seeds the sqlite database located in the tmp/ directory
  • pnpm dev: starts the application and watches for file changes to trigger restarting it as needed

adonis-realworld-example-app's People

Contributors

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