Skip to content

Commit 380b360

Browse files
setup: initial server and repo setup
1 parent eb37c72 commit 380b360

37 files changed

Lines changed: 700 additions & 21 deletions

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"trailingComma": "none",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"bracketSameLine": true,
7+
"arrowParens": "avoid",
8+
"vueIndentScriptAndStyle": true
9+
}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM oven/bun:1.1.13 AS base
1+
FROM oven/bun:1.1.17 AS base
22
WORKDIR /ichack25
33
COPY package.json bun.lockb **/package.json ./
4-
RUN bun install --production
4+
RUN bun install
55
COPY . .
66

77
FROM base AS build_server

bun.lockb

402 KB
Binary file not shown.

docker-compose.yaml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,53 @@
11
services:
2-
postgres_db:
2+
postgres:
33
image: postgres:16
4+
container_name: postgres
45
restart: always
56
environment:
67
POSTGRES_USER: admin
78
POSTGRES_PASSWORD: rootpasswd
89
POSTGRES_DB: ichack25
910
ports:
10-
- "5432:5432"
11+
- '5432:5432'
1112
volumes:
1213
- postgres_data:/var/lib/postgresql/data
14+
- ./initdb:/docker-entrypoint-initdb.d
15+
1316
server:
17+
container_name: server
1418
build:
1519
context: .
1620
dockerfile: Dockerfile
1721
target: server
1822
ports:
19-
- "5000:3000"
23+
- '5000:3000'
24+
depends_on:
25+
- postgres
26+
27+
pgadmin:
28+
image: dpage/pgadmin4
29+
container_name: pgadmin
30+
ports:
31+
- '5454:80'
32+
environment:
33+
PGADMIN_DEFAULT_EMAIL: admin@example.org
34+
PGADMIN_DEFAULT_PASSWORD: rootpasswd
35+
volumes:
36+
- pgadmin_data:/var/lib/pgadmin
37+
depends_on:
38+
- postgres
39+
restart: always
40+
41+
nginx:
42+
image: nginx:latest
43+
container_name: nginx
44+
volumes:
45+
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
46+
ports:
47+
- '80:80'
2048
depends_on:
21-
- postgres_db
49+
- server
2250

2351
volumes:
24-
postgres_data:
52+
postgres_data:
53+
pgadmin_data:

initdb/init.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE users (
2+
uid SERIAL PRIMARY KEY,
3+
name TEXT NOT NULL,
4+
email TEXT NOT NULL UNIQUE
5+
);

layers/base/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
*.log
3+
.nuxt
4+
nuxt.d.ts
5+
.output
6+
.data
7+
.env
8+
package-lock.json
9+
framework
10+
dist
11+
.DS_Store
12+
13+
# Yarn
14+
.yarn/cache
15+
.yarn/*state*
16+
17+
# Local History
18+
.history
19+
20+
# VSCode
21+
.vscode/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default defineNuxtConfig({
2+
extends: ['..'],
3+
modules: ['@nuxt/eslint']
4+
});

layers/base/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Nuxt Layer Starter
2+
3+
Create Nuxt extendable layer with this GitHub template.
4+
5+
## Setup
6+
7+
Make sure to install the dependencies:
8+
9+
```bash
10+
pnpm install
11+
```
12+
13+
## Working on your layer
14+
15+
Your layer is at the root of this repository, it is exactly like a regular Nuxt project, except you can publish it on NPM.
16+
17+
The `.playground` directory should help you on trying your layer during development.
18+
19+
Running `pnpm dev` will prepare and boot `.playground` directory, which imports your layer itself.
20+
21+
## Distributing your layer
22+
23+
Your Nuxt layer is shaped exactly the same as any other Nuxt project, except you can publish it on NPM.
24+
25+
To do so, you only have to check if `files` in `package.json` are valid, then run:
26+
27+
```bash
28+
npm publish --access public
29+
```
30+
31+
Once done, your users will only have to run:
32+
33+
```bash
34+
npm install --save your-layer
35+
```
36+
37+
Then add the dependency to their `extends` in `nuxt.config`:
38+
39+
```ts
40+
defineNuxtConfig({
41+
extends: 'your-layer'
42+
});
43+
```
44+
45+
## Development Server
46+
47+
Start the development server on http://localhost:3000
48+
49+
```bash
50+
pnpm dev
51+
```
52+
53+
## Production
54+
55+
Build the application for production:
56+
57+
```bash
58+
pnpm build
59+
```
60+
61+
Or statically generate it with:
62+
63+
```bash
64+
pnpm generate
65+
```
66+
67+
Locally preview production build:
68+
69+
```bash
70+
pnpm preview
71+
```
72+
73+
Checkout the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

layers/base/app.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<HelloWorld />
3+
</template>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script setup lang="ts"></script>
2+
3+
<template>
4+
<div>
5+
<h1>Hello World!</h1>
6+
<pre>Base layer</pre>
7+
</div>
8+
</template>

0 commit comments

Comments
 (0)