Coder Social home page Coder Social logo

aphiria / aphiria.com Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 1.37 MB

The official Aphiria website

Home Page: https://www.aphiria.com

License: MIT License

HTML 6.83% CSS 3.78% PHP 43.70% JavaScript 15.67% SCSS 20.82% Dockerfile 1.99% HCL 7.20%

aphiria.com's Introduction

Coverage Status

Note: This framework is not stable yet.

Introduction

Aphiria is a suite of small, decoupled PHP libraries that make up a REST API framework. It simplifies content negotiation without bleeding into your code, allowing you to write expressive code. Aphiria also provides the following functionality out of the box:

// Define some controller endpoints
class UserController extends Controller
{
    public function __construct(private IUserService $users) {}

    #[Post('/users')]
    public function createUser(User $user): IResponse
    {
        $this->users->create($user);
        
        return $this->created("/users/{$user->id}", $user);
    }

    #[Get('/users/:id')]
    #[AuthorizeRoles('admin')]
    public function getUserById(int $id): User
    {
        return $this->users->getById($id);
    }
}

// Bind your dependency
$container->bindInstance(IUserService::class, new UserService());

// Run an integration test
$postResponse = $this->post('/users', new User('Dave'));
$user = $this->readResponseBodyAs(User::class, $postResponse);
$admin = (new PrincipalBuilder('example.com'))->withRoles('admin')
    ->build();
$getResponse = $this->actingAs($admin, fn () => $this->get("/users/$user->id"));
$this->assertParsedBodyEquals($user, $getResponse);

Installation

Create an Aphiria app via Composer:

composer create-project aphiria/app --prefer-dist --stability dev

Refer to the documentation for more details.

Documentation

Full documentation is available at the Aphiria website.

Requirements

  • PHP >= 8.3

Contributing

We appreciate any and all contributions to Aphiria. Please read the documentation to learn how to contribute.

Community

If you have general questions or comments about Aphiria, join our GitHub Discussions.

Directory Structure

Aphiria is organized as a monorepo. Each library is contained in src/{library}, and contains src and tests directories.

License

This software is licensed under the MIT license. Please read the LICENSE for more information.

Author

Aphiria was created and primarily written by David Young.

aphiria.com's People

Contributors

davidbyoung avatar dependabot[bot] avatar

Watchers

 avatar  avatar

Forkers

zacdirect

aphiria.com's Issues

Add Docker support

We should switch to IAAS to simplify our devops. This requires:

  • Creating PHP, Nginx, and PostgreSQL images
  • Storing these images to a private registry
  • Updating GitHub actions to store secrets such as our production .env file

The goal is that we could use the same image to run both localhost (for web + API) and production.

Need to be able to run integration tests locally

Currently, running integration tests fails unless you're running the k8s cluster. We could possibly use a dev kustomization to expose the database with a node port service, and update the .env file to point to it.

Make site more responsive on narrower widths

We currently use device width and height in our media queries, which doesn't help when the browser is shrunk down. We should switch away from device width/height and just use width/height. Additionally, we should add a hamburger menu for the main nav and a link to the GitHub discussions page for the framework. On non-docs pages, we should show the main nav in the slideout nav, and on docs pages show the ToC in the slideout nav.

Long search results get cut off

When searching the docs and getting long results (eg with accepted), the search results get cut off. They should be scrollable in the case that they're not entirely visible.

Add logging to 3rd party provider

We should be sending our logs to a 3rd party, eg DataDog. Evaluate the best/cheapest option, provision it with Terraform, and connect the app to log to it instead of to local log files.

Add news section

The website should allow the dynamic creation, display, and editing of news items, eg new releases. Ideally, admins could log into the site (requires user and auth credential SQL tables), and edit posts in Markdown, which would get compiled into HTML. We should also be able to edit/delete posts, and set posts to display some time in the future.

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.