Skip to content

Commit 93ce015

Browse files
committed
feat: first commit with deployment via Github Actions
1 parent 4a37f4c commit 93ce015

26 files changed

+7308
-1
lines changed

.editorconfig

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# Change these settings to your own preference
9+
indent_style = space
10+
indent_size = 4
11+
12+
# We recommend you to keep these unchanged
13+
end_of_line = lf
14+
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
17+
18+
[*.{js,json,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
19+
indent_size = 2
20+
21+
[*.md]
22+
trim_trailing_whitespace = false
23+
24+
[*.sh]
25+
indent_style = tab
26+
27+
[*.{yaml,yml}]
28+
trim_trailing_whitespace = false
29+
30+
[.github/workflows/*.yml]
31+
indent_size = 2
32+
33+
[.gitmodules]
34+
indent_style = tab
35+
36+
[composer.json]
37+
indent_size = 4
38+
39+
[{compose,docker-compose}.*.{yaml,yml}]
40+
indent_size = 2
41+
42+
[*.*Dockerfile]
43+
indent_style = tab
44+
45+
[*.*Caddyfile]
46+
indent_style = tab

.github/workflows/deploy.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# .github/workflows/deploy.yml
2+
name: Deploy Documentation
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '22'
18+
cache: 'npm'
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Build
24+
run: npm run build
25+
26+
- name: Deploy to server
27+
uses: appleboy/scp-action@master
28+
with:
29+
host: ${{ secrets.SERVER_HOST }}
30+
username: ${{ secrets.SERVER_USER }}
31+
key: ${{ secrets.SSH_PRIVATE_KEY }}
32+
source: ".next/,public/,package.json,package-lock.json"
33+
target: "/var/www/docs"
34+
35+
- name: Execute deployment commands
36+
uses: appleboy/ssh-action@master
37+
with:
38+
host: ${{ secrets.SERVER_HOST }}
39+
username: ${{ secrets.SERVER_USER }}
40+
key: ${{ secrets.SSH_PRIVATE_KEY }}
41+
script: |
42+
cd /var/www/fastfony/main/docs
43+
npm ci --production
44+
pm2 reload ecosystem.config.js || pm2 start ecosystem.config.js

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
.next/
3+
public/_pagefind

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enable-pre-post-scripts=true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Fastfony documentation
22

3-
This project is a documentation for Fastfony, a Symfony-based boilerplate and starter kit.
3+
This project is a documentation for [Fastfony](https://fastfony.com), a Symfony-based boilerplate and starter kit.
44

55
It builds with Nextra, a Next.js & MDX based documentation site generator.
66

app/[[...mdxPath]]/page.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { generateStaticParamsFor, importPage } from 'nextra/pages'
2+
import { useMDXComponents as getMDXComponents } from '../../mdx-components'
3+
4+
export const generateStaticParams = generateStaticParamsFor('mdxPath')
5+
6+
export async function generateMetadata(props) {
7+
const params = await props.params
8+
const { metadata } = await importPage(params.mdxPath)
9+
return metadata
10+
}
11+
12+
const Wrapper = getMDXComponents().wrapper
13+
14+
export default async function Page(props) {
15+
const params = await props.params
16+
const result = await importPage(params.mdxPath)
17+
const { default: MDXContent, toc, metadata } = result
18+
return (
19+
<Wrapper toc={toc} metadata={metadata}>
20+
<MDXContent {...props} params={params} />
21+
</Wrapper>
22+
)
23+
}

app/layout.jsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { Footer, Layout, Navbar } from 'nextra-theme-docs'
2+
import { Head } from 'nextra/components'
3+
import { getPageMap } from 'nextra/page-map'
4+
import 'nextra-theme-docs/style.css'
5+
import Image from 'next/image';
6+
7+
export const metadata = {
8+
title: 'Fastfony Documentation',
9+
// For more information on metadata API, see: https://nextjs.org/docs/app/building-your-application/optimizing/metadata
10+
}
11+
12+
const navbar = (
13+
<Navbar
14+
logo={
15+
<>
16+
<Image src="/favicon-32x32.png" alt="Fastfony icon" width="32" height="32" />
17+
<span style={{ marginLeft: '.4em', fontWeight: 800 }}>
18+
Fastfony Documentation
19+
</span>
20+
</>
21+
}
22+
// ... Your additional navbar options
23+
/>
24+
)
25+
const footer = <Footer>MIT {new Date().getFullYear()} © Fastfony.</Footer>
26+
27+
export default async function RootLayout({ children }) {
28+
return (
29+
<html
30+
// Not required, but good for SEO
31+
lang="en"
32+
// Required to be set
33+
dir="ltr"
34+
// Suggested by `next-themes` package https://github.com/pacocoursey/next-themes#with-app
35+
suppressHydrationWarning
36+
>
37+
<Head
38+
// ... Your additional head options
39+
>
40+
{/* Your additional tags should be passed as `children` of `<Head>` element */}
41+
</Head>
42+
<body>
43+
<Layout
44+
navbar={navbar}
45+
pageMap={await getPageMap()}
46+
docsRepositoryBase="https://github.com/fastfony/fastfony-docs/tree/main/docs"
47+
footer={footer}
48+
// ... Your additional layout options
49+
>
50+
{children}
51+
</Layout>
52+
</body>
53+
</html>
54+
)
55+
}

content/coding-style.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Coding style
2+
3+
If you want a project with homogeneous code, you can use the following coding style which have used in Fastfony.
4+
5+
## Fixer with GrumPHP
6+
7+
In order to install the git pre-commit hook, execute the command `vendor/bin/grumphp git:pre-commit`
8+
9+
## PHP
10+
11+
We try to have line length of 120 characters maximum.
12+
13+
In class :
14+
15+
- Constants in first
16+
- Properties in second
17+
- Public methods in first, after constants and properties
18+
- Protected methods in second, after public methods
19+
- Private methods in third, after protected methods
20+
- If multiple arguments in a declaration or usage of method, we put each argument on a new line with a comma at the end of the line
21+
22+
### Naming
23+
24+
### No suffix for class name
25+
26+
In order to evict repetition (and long name) when the directory name is included in the class name, we don't repeat it in the class name.
27+
28+
For example, if the class is in the `Entity` directory, we don't repeat `Entity` in the class name.
29+
30+
It's obvious for the entities class, so we apply this rule for all classes.
31+
32+
For example, controller class `src/Controller/LoginController.php` will be named `Login` without `Controller` suffix.

content/css_theme.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CSS Theme
2+
3+
You can generate a new theme with the [daisyUI theme generator](https://v5.daisyui.com/theme-generator/).
4+
5+
Click on the button `{} CSS` and copy the content in `assets/css/app.css`.
6+
7+
Edit the file `templates/base.html.twig` for change the value attribute `data-theme` on `<html>` tag.

content/entities.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Entities (Doctrine)
2+
3+
## Usage of traits
4+
5+
In order to limit the number of getter/setter and to have a more readable code, we use Traits for add common properties and methods to our entities.
6+
7+
Traits available in `src/Entity/CommonProperties`

0 commit comments

Comments
 (0)