Build with laravel 9 + MySQL Database
https://aces.umn.ac.id/backend
for api -> https://aces.umn.ac.id/backend/api
This project is used by ACES UMN official website (https://aces.umn.ac.id)
<script>
const title = document.querySelector('#title'); const slug =
document.querySelector('#slug'); title.addEventListener('change', function()
{fetch(
"https://aces.umn.ac.id/backend/api/member/labs_checkSlug?title=" +
title.value
)
.then((response) => response.json())
.then((data) => (slug.value = data.slug))}
);
</script>
use route parameter
http://aces-backend.matthewbd.my.id.test/api/member/ticket?token={access_token}
or use bearer token for authorization header
Note: access token last for 60 minutes, after that use /refresh api for get new access token
GET /api/posts
GET /api/posts?search={post.title or post.body}
GET /api/posts?category={category.slug}
GET /api/categories
GET /api/posts/{slug}
GET /api/openprojects
GET /api/openprojects?search={openproject.title or openproject.body}
GET /api/openprojects/{slug}
GET /api/labs
GET /api/labs?search={repository.title or repository.body}
GET /api/labs?labscategory={labscategory.slug}
GET /api/labs/{slug}
GET /api/labs-categories
GET /api/generations
GET /api/frontliners
GET /api/frontliners?search={frontliner.name}
GET /api/frontliners?generation={generation.slug}
POST /api/contactus
Parameter | Type | Description |
---|---|---|
name |
string |
Required |
email |
string |
Required |
title |
string |
Required |
body |
string |
Required |
GET /api/lecturers
GET /api/websiteconfiguration
GET /api/websitegallery
These auth system use JWT token for authorization. JWT expired in 60 minutes, use /refresh for get new access token. See usage/example section for example.
POST /api/auth/login
Parameter | Type | Description |
---|---|---|
email |
string |
Required |
password |
string |
Required |
POST /api/auth/register
Parameter | Type | Description |
---|---|---|
name |
string |
Required |
username |
string |
Required |
email |
string |
Required |
password |
string |
Required |
passwordconfirm |
string |
Required |
Get logged account information
POST /api/auth/me?token={access_token}
POST /api/auth/refresh?token={access_token}
use header "Accept" = "application/json" for request refresh access token
POST /api/auth/logout?token={access_token}
POST /api/auth/forgot
Parameter | Type | Description |
---|---|---|
email |
string |
Required |
POST /api/auth/reset_password/{Token}
Parameter | Type | Description |
---|---|---|
email |
string |
Required |
password |
string |
Required |
password_confirmation |
string |
Required |
POST /api/member/labs?token={access_token}
POST /api/member/labs/{labs_slug}?token={access_token}
POST /api/member/labs_create?token={access_token}
Multipart/form
Parameter | Type | Description |
---|---|---|
title |
string |
Required |
slug |
string |
Required. use checkSlug function |
labscategory_id |
string |
Required |
image |
string |
Required. File |
body |
string |
Required |
POST /api/member/labs_update/{labs_slug}?token={access_token}
Multipart/form
Parameter | Type | Description |
---|---|---|
title |
string |
Required |
slug |
string |
Required. use checkSlug function |
labscategory_id |
string |
Required |
image |
string |
Required. File |
body |
string |
Required |
Member can update their own posts, but not others
POST /api/member/labs_delete/{labs_slug}?token={access_token}
Member can delete their own posts, but not others
POST /api/member/labs_checkSlug?title={title}&token={access_token}
POST /api/member/imagefolder?token={access_token}
POST /api/member/imagefolder_create?token={access_token}
Multipart/form
Parameter | Type | Description |
---|---|---|
image |
string |
Required. File |
POST /api/member/imagefolder_delete/{imagefolder_ID}?token={access_token}
Member can delete their own image, but not others
POST /api/member/ticket?token={access_token}
POST /api/member/ticket/{ticket_slug}?token={access_token}
POST /api/member/ticket_create?token={access_token}
Parameter | Type | Description |
---|---|---|
title |
string |
Required |
slug |
string |
Required. use checkSlug function |
body |
string |
Required. Body can use HTML tag (summernote format) |
POST /api/member/ticket_checkSlug?title={title}&token={access_token}
POST /api/contactus
Parameter | Type | Description |
---|---|---|
name |
string |
Required |
email |
string |
Required |
title |
string |
Required |
body |
string |
Required |
GET /api/lecturers
GET /api/websiteconfiguration
GET /api/websitegallery
To run this project, you will need to add the following environment variables to your .env file
APP_ENV
APP_URL
ASSET_URL
Make sure have PHP >= 8.1 (Minimum for laravel 9)
Clone the project
git clone https://github.com/MatthewBrandon21/aces-backend
Go to the project directory
cd aces-backend
Install dependencies
composer update
composer install
Configure database setting in .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=acesdatabase
DB_USERNAME=root
DB_PASSWORD=
Configure email smtp setting in .env
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
Generate JWT::secret
php artisan jwt:secret
Seed database
php artisan migrate:fresh --seed
Create Symlink
php artisan storage:link
Start the server (or you can use valet)
php artisan serve
For support, email [email protected]
flowchart LR
A[Plan] --> B[Code]
B --> C[Build]
C --> D[Publish]
D --> E[Staging Deployment]
E --> F[Production Deployment]
F --> G[Release & Runtime]
G --> H[Plan for new feature and hotfix]