Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# build images
## Build Images

```bash

# cd root of the project

# build postgres image
Expand All @@ -14,10 +13,11 @@ docker buildx build -t mega-mono:1.0 -f ./docker/mega_mono_dockerfile .
docker buildx build -t mega-moon:1.0 -f ./docker/mega_moon_dockerfile .
```

# test mono and moon
## Test mono and moon


### Test with SQLite

## test without postgres
```bash
# create network
docker network create mega-network
Expand All @@ -28,9 +28,9 @@ docker run --rm -it -d --network mega-network -e NEXT_PUBLIC_API_URL=http://mega

visit http://localhost:3000 to see the frontend

## test with sqlite
## Test with PostgreSQL

1. start postgres
[1] start postgres

```bash
# create network
Expand All @@ -40,14 +40,14 @@ docker network create mega-network
docker run --rm -it -d --network mega-network --name mega-db mega-db:1.0
```

2. create default config
[2] create default config

```bash
docker run --rm -it -d --network mega-network --name mega-mono -v ./mega_base:/etc/mega mega-mono:1.0
docker stop mega-mono
```

3. edit `mega_base/config.toml`, change `db_type` to `postgres` and db_url to `postgres://mega:mega@mega-db:5432/mega`
[3] edit `mega_base/config.toml`, change `db_type` to `postgres` and db_url to `postgres://mega:mega@mega-db:5432/mega`

```toml
[database]
Expand All @@ -60,7 +60,7 @@ db_path = "${base_dir}/mega.db"
db_url = "postgres://mega:mega@mega-db:5432/mega"
```

4. Start the mono again, and run the frontend.
[4] Start the mono again, and run the frontend.

```bash
docker run --rm -it -d --network mega-network --name mega-mono -v ./mega_base:/etc/mega mega-mono:1.0
Expand Down
14 changes: 7 additions & 7 deletions lunar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@
"clsx": "^2.1.1",
"date-fns": "^3.6.0",
"framer-motion": "^11.3.2",
"github-markdown-css": "^5.6.1",
"next": "14.2.3",
"prism-react-renderer": "^2.3.1",
"react": "^18",
"react-dom": "^18",
"swr": "^2.2.5",
"github-markdown-css": "^5.6.1",
"react-markdown": "^9.0.1",
"prism-react-renderer": "^2.3.1"

"swr": "^2.2.5"
},
"devDependencies": {
"@tauri-apps/cli": "^1.6.0",
"@types/node": "^22",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"eslint": "^9.8",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.5",
"postcss": "^8.4.40",
"typescript": "^5.5.4"
"typescript": "^5.5.0"
}
}
}
2 changes: 1 addition & 1 deletion moon/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
}
}
5 changes: 3 additions & 2 deletions moon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"eslint": "^9.8",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.5",
"postcss": "^8.4.40",
"typescript": "^5.5.4"
"typescript": "^5.5.0"
}
}
7 changes: 6 additions & 1 deletion moon/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ export default async function HomePage() {
</div>
);
}

async function getDirectory() {
const res = await fetch(`http://localhost:3000/api/tree/commit-info?path=/`);

const response = await res.json();
const directory = response.data.data;

return directory
}

async function getReadmeContent(directory) {
var readmeContent = '';
let readmeContent = '';

for (const project of directory || []) {
if (project.name === 'README.md' && project.content_type === 'file') {
const res = await fetch(`http://localhost:3000/api/blob?path=/README.md`);
Expand All @@ -28,5 +32,6 @@ async function getReadmeContent(directory) {
break;
}
}

return readmeContent
}