Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmedbadr1/tenjaz-task
interview task for tenjaz company
https://github.com/ahmedbadr1/tenjaz-task
laravel pest sanctum sqlite
Last synced: about 1 month ago
JSON representation
interview task for tenjaz company
- Host: GitHub
- URL: https://github.com/ahmedbadr1/tenjaz-task
- Owner: ahmedBadr1
- Created: 2024-10-21T16:41:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-22T11:12:16.000Z (3 months ago)
- Last Synced: 2024-10-29T14:21:13.309Z (3 months ago)
- Topics: laravel, pest, sanctum, sqlite
- Language: PHP
- Homepage:
- Size: 177 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tengaz Task
# Backend Api for User / Product CRUDs
## Ahmed Badr
## Laravel - Sanctum - SQLite
### Installation
Clone the repository
git clone [email protected]:ahmedBadr1/tenjaz-task.git
Switch to the repo folder
cd tenjaz-task
Install all the dependencies using composer
composer install
Copy the example env file and make the required configuration changes in the .env file
cp .env.example .env
For using SQLite create a file named Database, it is already configured at .env file
touch database/database.sqlite
Generate a new application key
php artisan key:generate
Create Storage Link for uploaded files
php artisan storage:link
Install all the dependencies using npm
npm install && npm run dev
Run the database migrations (**make sure the connection is set in .env before migrating**)
php artisan migrate
Start the local development server
php artisan serve
You can now access the server at http://localhost:8000
**TL;DR command list**
git clone [email protected]:ahmedBadr1/tenjaz-task.git
cd tenjaz-task
composer install
cp .env.example .env
php artisan key:generate**Make sure you set the correct database connection information before running the migrations**
php artisan migrate
**Make sure you set the connection between storage and public directory (run only once in project lifetime)**
php artisan storage:link
### Database seeding
**Populate the database with seed data with relationships which includes users, articles, comments, tags, favorites and
follows. This can help you to quickly start testing the api or couple a frontend and start using it with ready content.
**Open the DummyDataSeeder and set the property values as per your requirement
database/seeders/DatabaseSeeder.php
Run the database seeder and you're done
php artisan db:seed
***Note*** : It's recommended to have a clean database before seeding. You can refresh your migrations at any point to
clean the database by running the following commandphp artisan migrate:fresh --seed
**Accounts**
[email protected]
[email protected]
[email protected]you can run test at sqlite in memory
php artisan test
You can now access the server at http://localhost:8000
php artisan serve
You can now access the Vite server at http://localhost:5173
npm run dev
Generate API Documentation
php artisan l5-swagger:generate
Now You can now access the API Documentation http://127.0.0.1:8000/api/documentation
**please generate new token and submit it in authorize tab**
***Enjoy***