Separated laravel app to its own folder (#540)

This commit is contained in:
Julien Nahum 2024-08-26 18:24:56 +02:00 committed by GitHub
parent 39b8df5eed
commit 5bd1dda504
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
546 changed files with 124 additions and 143 deletions

View File

@ -1,8 +0,0 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import"
]
}

View File

@ -2,11 +2,10 @@ name: laravel
on:
push:
branches: [ main ]
branches: [main]
pull_request:
jobs:
code_lint:
runs-on: ubuntu-latest
name: Run code linters
@ -36,15 +35,19 @@ jobs:
coverage: none
- name: Prepare the environment
working-directory: ./api
run: cp .env.example .env
- name: Install composer dependencies
working-directory: ./api
run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs --optimize-autoloader
- name: Directory permissions
working-directory: ./api
run: chmod -R 777 storage bootstrap/cache
- name: Run PHP lint check
working-directory: ./api
run: ./vendor/bin/pint --test
tests:
@ -90,8 +93,8 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ 8.2 ]
connection: [ pgsql, mysql ]
php: [8.2]
connection: [pgsql, mysql]
include:
- connection: pgsql
host: localhost
@ -100,7 +103,7 @@ jobs:
password: postgres
database: postgres
- connection: mysql
host: '127.0.0.1'
host: "127.0.0.1"
port: 3306
user: root
password: test
@ -133,12 +136,14 @@ jobs:
coverage: none
- name: Prepare the environment
run: cp .env.example .env
run: cp api/.env.example api/.env
- name: Install composer dependencies
working-directory: ./api
run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs --optimize-autoloader
- name: Directory permissions
working-directory: ./api
run: chmod -R 777 storage bootstrap/cache
- name: Run tests (Unit and Feature)
@ -154,6 +159,7 @@ jobs:
- name: "Archive log results"
if: always()
uses: actions/upload-artifact@v3
working-directory: ./api
with:
name: log results
path: storage/logs/laravel.log
@ -163,8 +169,8 @@ jobs:
runs-on: ubuntu-latest
name: Build the Nuxt app
defaults:
run:
working-directory: ./client
run:
working-directory: ./client
steps:
- name: Checkout code
uses: actions/checkout@v2
@ -172,7 +178,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '20'
node-version: "20"
- uses: actions/cache@v2
with:
@ -193,7 +199,7 @@ jobs:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
production-deploy:
needs: [ code_lint, tests, build-nuxt-app ]
needs: [code_lint, tests, build-nuxt-app]
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
name: Triggers Deployment (Vapor & Amplify)
@ -230,24 +236,29 @@ jobs:
coverage: none
- name: Prepare the environment
working-directory: ./api
run: cp .env.example .env
- name: Install composer dependencies
working-directory: ./api
run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs --optimize-autoloader
- name: Directory permissions
working-directory: ./api
run: chmod -R 777 storage bootstrap/cache
- name: Trigger front-end deployment
run: |
run: |
URL="${{ secrets.AMPLIFY_DEPLOY_URL }}"
curl -X POST -d {} "$URL" -H "Content-Type: application/json"
- name: Created encrypted .env file before deployment
working-directory: ./api
run: |
echo "${{ secrets.ENCRYPTED_ENV_FILE }}" >> .env.production.encrypted
echo "${{ secrets.ENCRYPTED_ENV_FILE }}" >> .env.production.encrypted
- name: Deploy back-end to production
working-directory: ./api
run: php vendor/bin/vapor deploy api-production --commit="${GITHUB_SHA}" --message="${GITHUB_REF}"
env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}

22
.gitignore vendored
View File

@ -1,33 +1,11 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/storage/clockwork
/vendor
.env
.env.production
.env.api-production
.env.backup
.env.testing
.env.dusk.local
.env.api-*
.phpunit.result.cache
.idea/*
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
phpunit.dusk.xml
/public/dist
/public/build
/public/mix-manifest.json
/public/sitemap.xml
.DS_Store
public/.DS_Store
*.DS_Store
.vapor/
.env.production
.env.staging
_ide_helper.php
docker-compose.override.yml
/.make.*

View File

@ -1,13 +0,0 @@
php:
preset: laravel
disabled:
- no_unused_imports
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true

View File

@ -103,19 +103,6 @@ OpnForm can be easily set up using Docker. Pre-built images are available on Doc
#### Quick Start
1. Clone the repository:
<<<<<<< HEAD
```
git clone https://github.com/JhumanJ/OpnForm.git
cd OpnForm
```
2. Set up environment files:
```
cp .env.docker .env
cp client/.env.docker client/.env
=======
```
git clone https://github.com/JhumanJ/OpnForm.git
@ -126,7 +113,6 @@ OpnForm can be easily set up using Docker. Pre-built images are available on Doc
```bash
./scripts/setup-env.sh --docker
>>>>>>> 0a9400492674212cdabcd4821ee87483b28735e5
```
3. Start the application:
@ -177,7 +163,7 @@ For development or customization, you can build the Docker images locally:
2. Create a docker-compose override file:
```
cp docker-compose.override.yml.example docker-compose.override.yml
touch docker-compose.override.yml
```
Edit the `docker-compose.override.yml` file to use your locally built images:
@ -188,6 +174,8 @@ For development or customization, you can build the Docker images locally:
image: opnform-api:local
ui:
image: opnform-ui:local
api-worker:
image: opnform-api:local
```
3. Start the application:

View File

@ -18,11 +18,11 @@ SESSION_LIFETIME=120
MAIL_MAILER=log
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_USERNAME=your@email.com
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=
MAIL_FROM_ADDRESS=your@email.com
MAIL_FROM_NAME=OpnForm
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

34
api/.gitignore vendored Normal file
View File

@ -0,0 +1,34 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/storage/clockwork
/vendor
.env
.env.production
.env.api-production
.env.backup
.env.testing
.env.dusk.local
.env.api-*
.env.docker.local
.phpunit.result.cache
.idea/*
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
phpunit.dusk.xml
/public/dist
/public/build
/public/mix-manifest.json
/public/sitemap.xml
.DS_Store
public/.DS_Store
*.DS_Store
.vapor/
.env.production
.env.staging
_ide_helper.php
docker-compose.override.yml
/.make.*

Some files were not shown because too many files have changed in this diff Show More