This codebase was created to demonstrate a fully fledged backend application built with Phel including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the Phel community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
TODO - Endpoints spec
- Authentication Header
- Authentication
- Registration
- Get Current User
- Update User
- Get Profile
- Follow user
- Unfollow user
- List Articles
- Feed Articles
- Get Article
- Create Article
- Update Article
- Delete Article
- Add Comments to an Article
- Get Comments from an Article
- Delete Comment
- Favorite Article
- Unfavorite Article
- Get Tags
Find more information about how to start with phel in getting started.
Phel requires at least PHP 8.0 and Composer.
- Ensure you have PHP >=8.0 (Some help about how to install multiple PHP versions locally on linux and Mac)
- Ensure you have composer
- Clone this repo
- Install the dependencies |
composer install
- Write your phel code in
src/
- Execute your web server with
composer run:dev
: it will recompile the code on every requestcomposer run:prod
: it will run the same compiled code on every request
Install prisma as a dev dependency with npm
npm install
Use prisma db push or migrate dev commands
# schema prototyping
npx prisma db push
# schema migrations
npx prisma migrate dev
- Write your phel tests in
tests/
- Execute your tests with
composer test