Skip to content

Commit

Permalink
Merge pull request #26 from francescovallone/develop
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
francescovallone authored Jun 9, 2024
2 parents c88945e + a028f69 commit ad464ad
Show file tree
Hide file tree
Showing 75 changed files with 1,903 additions and 968 deletions.
51 changes: 29 additions & 22 deletions .website/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ export default defineConfig({
['link', { rel: "icon", type: "image/png", sizes: "16x16", href: "/serinus-icon-16x16.png"}],
],
lastUpdated: true,
appearance: 'force-dark',
themeConfig: {
footer: {
copyright: 'Copyright © 2024 Francesco Vallone',
message: 'Built with 💙 and Dart 🎯 | One of the 🐤 of <a href="https://github.com/serinus-nest">Serinus Nest</a>'
},
// https://vitepress.dev/reference/default-theme-config
logo: '/serinus-logo.png',
search: {
provider: 'local'
},
nav: [
{
text: 'pub.dev',
Expand All @@ -29,50 +33,53 @@ export default defineConfig({
{ text: 'Introduction', link: '/introduction' },
{
text: 'Overview',
base: '/overview/',
collapsed: false,
items: [
{ text: 'Getting Started', link: '/overview/getting_started' },
{ text: 'Modules', link: '/overview/modules' },
{ text: 'Controllers', link: '/overview/controllers' },
{ text: 'Routes', link: '/overview/routes' },
{ text: 'Providers', link: '/overview/providers' },
{ text: 'Middlewares', link: '/overview/middlewares' },
{ text: 'Guards', link: '/overview/guards' },
{ text: 'Pipes', link: '/overview/pipes' },
{ text: 'WebSockets', link: '/overview/websockets' },
{ text: 'Getting Started', link: 'getting_started' },
{ text: 'Modules', link: 'modules' },
{ text: 'Controllers', link: 'controllers' },
{ text: 'Routes', link: 'routes' },
{ text: 'Providers', link: 'providers' },
{ text: 'Middlewares', link: 'middlewares' },
{ text: 'WebSockets', link: 'websockets' },
{ text: 'Hooks', link: 'hooks' },
]
},
{
text: 'Techniques',
base: '/techniques/',
collapsed: true,
items: [
{ text: 'Model View Controller', link: '/techniques/mvc' },
{ text: 'Versioning', link: '/techniques/versioning' },
{ text: 'Global Prefix', link: '/techniques/global_prefix' },
{ text: 'Body Size Limit', link: '/techniques/body_size_limit' },
{ text: 'Model View Controller', link: 'mvc' },
{ text: 'Versioning', link: 'versioning' },
{ text: 'Global Prefix', link: 'global_prefix' },
{ text: 'Body Size Limit', link: 'body_size_limit' },
]
},
{
text: 'Request Lifecycle',
link: '/request_lifecycle'
},
{
text: 'Plugins',
base: '/plugins/',
collapsed: true,
items: [
{ text: 'Configuration', link: '/plugins/configuration' },
{ text: 'Serve Static Files', link: '/plugins/serve_static' },
{ text: 'Configuration', link: 'configuration' },
{ text: 'Serve Static Files', link: 'serve_static' },
{ text: 'CRON [WIP]' },
{ text: 'Swagger [WIP]' }
],
link: '/plugins/'
link: '/'
}
]
},
// {
// text: 'Roadmap',
// link: '/roadmap',
// },
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/francescovallone/serinus' },
{ icon: 'twitter', link: 'https://twitter.com/serinus_nest'},
{ icon: 'discord', link: 'https://discord.gg/zydgnJ3ksJ' }
]
}
],
},
})
6 changes: 6 additions & 0 deletions .website/.vitepress/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
38 changes: 37 additions & 1 deletion .website/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
/**
* Colors
* -------------------------------------------------------------------------- */
@tailwind base;
@tailwind components;
@tailwind utilities;


:root {
--vp-c-brand-1: #FF9800;
--vp-c-brand-2: #FFB74D;
--vp-c-brand-light: #FFA726;
--vp-c-brand-lighter: #FFB74D;
--vp-c-brand-lightest: #FFCC80;
Expand Down Expand Up @@ -90,9 +95,40 @@
.logo {
height: 64px !important;
}

.image-container {
position: relative;
width: 320px;
height: 320px;
}
.image-container > img {
position: absolute;
top: 50%;
left: 50%;
max-width: 320px;
max-height: 320px;
transform: translate(-50%,-50%);
}
.image-bg {
background-image: linear-gradient(-45deg, rgba(255, 152, 0, 0.6) 50%, rgba(245, 124, 0, 0.6) 50%) !important;
background-image: -moz-linear-gradient(-45deg, rgba(255, 152, 0, 0.6) 50%, rgba(245, 124, 0, 0.6) 50%) !important;
background-image: -webkit-linear-gradient(-45deg, rgba(255, 152, 0, 0.6) 50%, rgba(245, 124, 0, 0.6) 50%) !important;
position: absolute;
top: 50%;
left: 50%;
border-radius: 50%;
width: 320px;
height: 320px;
filter: var(--vp-home-hero-image-filter);
transform: translate(-50%,-50%);
}
.vp-btn-custom, .vp-doc a.vp-btn-custom{
background-color: var(--vp-c-brand-2);
color: rgb(23,23,23);
padding: 0.5rem 1rem;
border-radius: 0.5rem;
text-decoration: none;
border-radius: 20px;
}
.vp-btn-custom:hover, .vp-doc a.vp-btn-custom:hover {
color: rgb(23,23,23);
}
19 changes: 19 additions & 0 deletions .website/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:20 as build

WORKDIR /app

COPY package.json .

RUN npm install

COPY . .

RUN npm run docs:build

FROM nginx:alpine

COPY --from=build /app/.vitepress/dist /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
114 changes: 114 additions & 0 deletions .website/components/fast.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<script setup>
const max = 6613;
const scale = (value) => (value / max) * 100
const scaleStyle = (value) =>
`width: ${((value / max) * 100).toFixed(2)}%`
const scalePadding = (value) =>
`padding-left: ${((value / max) * 100).toFixed(2)}%`
const format = new Intl.NumberFormat().format
const graphs = [
{
title: 'Nest',
lang: 'Node',
value: 6352,
},
{
title: 'Shelf',
lang: 'Dart',
value: 6311
},
{
title: 'Dart Frog',
lang: 'Dart',
value: 5875
},
{
title: 'Django',
lang: 'Python',
value: 949
}
]
</script>

<template>
<div class="container flex w-full gap-8 flex-row my-8">
<section class="flex flex-col gap-6 flex-1">
<h1 class="text-2xl font-bold">Fast 🚀</h1>
<p class="text-xl text-gray-400">
Serinus is designed to be fast and efficient. It is built on top of the Dart language, which is known for its performance and efficiency.
</p>
<p class="text-xl text-gray-400">
Here are some benchmarks comparing Serinus with other popular frameworks.
</p>
</section>
<section class="flex flex-col gap-4 flex-1">
<ol
class="flex flex-col list-none w-full text-gray-500 dark:text-gray-400 text-lg"
>
<li class="flex flex-row items-stretch w-full gap-4">
<p
class="flex items-end gap-2 w-full max-w-[8em] dark:text-gray-400"
>
Serinus
<span class="text-gray-400 text-xs pb-1"> Dart </span>
</p>
<div class="w-full h-7 relative">
<div
class="flex justify-end items-center text-sm font-bold text-white h-7 px-2.5 py-0.5 bg-gradient-to-r from-yellow-400 to-orange-500 rounded-full"
>
{{ format(max) }} req/s
</div>
</div>
</li>
<li
v-for="graph in graphs"
class="flex flex-row w-full gap-4"
:key="graph.title"
>
<p
class="flex items-end gap-2 w-full max-w-[8em] dark:text-gray-400"
>
{{ graph.title }}
<span class="text-gray-400 text-xs pb-1">
{{ graph.lang }}
</span>
</p>
<div class="w-full h-7 relative">
<div
class="flex justify-end items-center text-sm px-2.5 py-0.5 bg-gray-200 dark:bg-gray-700 rounded-full mr-auto h-7"
:style="scaleStyle(graph.value)"
>
<span
v-if="scale(graph.value) > 40"
class="absolute z-1 flex items-center text-sm h-7"
>
{{ format(graph.value) }}
</span>
</div>
<span
v-if="scale(graph.value) <= 40"
class="absolute top-0 flex items-center text-sm h-7 left-2"
:style="scalePadding(graph.value)"
>
{{ format(graph.value) }}
</span>
</div>
</li>
</ol>
<p class="results text-gray-400 text-xs pb-1">Measurement in Requests per Second. Results from <a href="https://sharkbench.dev/web" target="_blank">sharkbench.dev</a>.</p>
</section>
</div>
</template>

<style scoped>
p {
margin: 0;
}
.results{
line-height: 1rem;
}
ol {
padding: 0;
}
</style>
11 changes: 11 additions & 0 deletions .website/components/home.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup>
import Fast from './fast.vue'
import Modular from './modular.vue'
</script>

<template>
<div class="my-32 border-t border-gray-600">
<Fast />
<Modular />
</div>
</template>
73 changes: 73 additions & 0 deletions .website/components/modular.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<script setup>
const plugins = [
{
title: 'Serve Static',
pub: 'https://pub.dev/packages/serinus_serve_static',
desc: 'Serve static files from your Serinus server.',
gh: 'https://github.com/serinus-nest/serve_static',
link: '/plugins/serve_static',
},
{
title: 'Config',
pub: 'https://pub.dev/packages/serinus_config',
desc: 'Access .env files and environment variables with ease.',
gh: 'https://github.com/serinus-nest/serinus_config',
link: '/plugins/configuration',
},
]
</script>

<template>
<div class="container flex w-full gap-8 flex-col my-8">
<div class="container flex w-full gap-8 flex-row">
<section class="flex flex-col gap-6 flex-1">
<h1 class="text-2xl font-bold">Modular 📦</h1>
<p class="text-xl text-gray-400">
Serinus is designed to be modular and extensible. It allows you to create your own modules and plugins to extend its functionality.
</p>
<p class="text-xl text-gray-400">
Here are some of the plugins that are available for Serinus
</p>
</section>
<section class="flex flex-col gap-4 flex-1">
<a v-for="plugin in plugins" :key="plugin.title" class="plugin transition-all bg-neutral-900 p-4 rounded-lg" :href="plugin.link">
<div class="flex justify-between items-center">
<p class="text-lg">{{ plugin.title }}</p>
<div class="flex gap-2">
<a class="text-gray-400 text-sm" :href="plugin.pub">Pub</a>
<a class="text-gray-400 text-sm" :href="plugin.gh">GitHub</a>
</div>
</div>
<p class="text-gray-400">{{ plugin.desc }}</p>
</a>
</section>
</div>
<div class="flex justify-center" style="flex-shrink: 0; padding: 6px">
<a href="/plugins/" class="vp-btn-custom">
View all plugins
</a>
</div>
</div>
</template>

<style scoped>
p {
margin: 0;
}
.results{
line-height: 1rem;
}
ol {
padding: 0;
}
.vp-doc a{
text-decoration: none;
}
.plugin {
border: 1px solid transparent;
}
.plugin:hover {
border: 1px solid var(--vp-c-brand-2);
}
</style>
Loading

0 comments on commit ad464ad

Please sign in to comment.