Api Developed in Laravel and React, the front end that was used can be found here https://github.com/joohnyfranzen/Thoth-Code-React
- Laravel 9
- Php 8
- React 18.2
- Yarn 1.2
- This Project Clone
- React Project Clone
- In the terminal type
git clone https://github.com/joohnyfranzen/Thoth-Code-Laravel/ - Type the command "composer install". It will install all necessary php packages.
- After installing the dependencies you modify .env.
- Finally with the command
php artisan serverun the project. - Then you clone the React App
git clone https://github.com/joohnyfranzen/Thoth-Code-React/ - Install it dependencies with
npm install - Start the project with npm start.
- Have fun.
-
Seeing the need to understand the architecture of the laravel framework, I tried to make a REST Api consuming the database of this project in the React project that you can acess up here.
-
In this project I used Axios to consume in React the database.
-
The project itself its a social network, that have authentication with Auth Sanctum, I learned a lot of React by using its framework, there are many useful things inside of it, and its a start for working in a larger project.
- Users - Foreign - ( ( 'user_id' on 'real_state ) ( 'user_id' on 'user_profile' ) )
- name
- email_verified_at
- password
- Post
- title
- slug
- content
- user-_id
- Post Comments
- coment
- user_id
- post_id
- _/api/v1
1. User
- _ /users _
[GET] '/user' - INDEX
[GET] '/user/:id' - SHOW
[POST] '/user' - STORE
[PUT] '/user/:id' - UPDATE
[DELETE] '/user/:id' - DELETE
2. Auth
[POST] '/login' - LOGIN
3. Posts
- _ /post _
[GET] '/post' - INDEX
[GET] 'post/:id' - SHOW
[POST] 'post/' - STORE
[PUT] 'post/:id' - UPDATE
[DELETE] 'post/:id' - DELETE
4. Post Comment
_ /postcomment _
[GET] '/postcomment' - INDEX
[GET] '/postcomment/:id' - SHOW
[POST] '/postcomment' - STORE
[PUT] '/postcomment/:id' - UPDATE
[DELETE] '/postcomment/:id' - DELETE