Skip to content

Commit daba895

Browse files
authored
Merge pull request #122 from Friedrich482/features
Small fixes, docs update and docker build optimization
2 parents f354875 + a2505eb commit daba895

7 files changed

Lines changed: 52 additions & 17 deletions

File tree

apps/api/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM node:24-alpine AS builder
1+
ARG NODE_VERSION=24.13.0-alpine
2+
3+
FROM node:${NODE_VERSION} AS builder
24

35
WORKDIR /app
46

@@ -15,7 +17,7 @@ COPY . .
1517
RUN npm run build --workspace=@repo/common
1618
RUN npm run build --workspace=api
1719

18-
FROM node:24-alpine AS deps
20+
FROM node:${NODE_VERSION} AS dependencies
1921

2022
WORKDIR /app
2123

@@ -25,9 +27,10 @@ COPY turbo.json ./
2527
COPY apps/api/package*.json ./apps/api/
2628
COPY packages/common/package*.json ./packages/common/
2729

28-
RUN npm ci --omit=dev
30+
RUN --mount=type=cache,target=/root/.npm \
31+
npm ci --no-audit --no-fund --omit=dev
2932

30-
FROM node:24-alpine AS production
33+
FROM node:${NODE_VERSION} AS runner
3134

3235
WORKDIR /app
3336

@@ -43,12 +46,9 @@ COPY --from=builder /app/packages/common/package.json ./packages/common/package.
4346
COPY --from=builder /app/packages/trpc ./packages/trpc
4447
COPY --from=builder /app/apps/api/package*.json ./
4548

46-
COPY --from=deps /app/node_modules ./node_modules
49+
COPY --from=dependencies /app/node_modules ./node_modules
4750

48-
# Create non-root user for security
49-
RUN addgroup -g 1001 -S nodejs
50-
RUN adduser -S nestjs -u 1001
51-
USER nestjs
51+
USER node
5252

5353
EXPOSE 3000
5454

apps/api/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Before continuing you'll need some environment variables: `JWT_SECRET` and `DATA
4747
NODE_ENV=production
4848
```
4949

50-
- `DATABASE_URL`, you can use:
50+
- `DATABASE_URL`: you can use:
5151

5252
```bash
5353
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/mooncode"
@@ -64,12 +64,33 @@ Before continuing you'll need some environment variables: `JWT_SECRET` and `DATA
6464
```
6565

6666
- `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`: you get them when you create credentials in the Google Cloud Console
67+
6768
- `GOOGLE_REDIRECT_URI`:
6869

6970
```bash
7071
GOOGLE_REDIRECT_URI=http://localhost:3000/auth/google/callback
7172
```
7273

74+
- `GOOGLE_LINKING_REDIRECT_URI`:
75+
76+
```bash
77+
GOOGLE_LINKING_REDIRECT_URI=http://localhost:3000/auth/google/linking/callback
78+
```
79+
80+
- `ONBOARDING_EMAIL`, `RESET_PASSWORD_EMAIL` and `UPDATE_EMAIL_EMAIL`: those three can be obtained by creating an account on Resend and registering an email domain. For example:
81+
82+
```bash
83+
ONBOARDING_EMAIL=onboarding@<email_domain>
84+
RESET_PASSWORD_EMAIL=noreply@<email_domain>
85+
UPDATE_EMAIL_EMAIL=noreply@<email_domain>
86+
```
87+
88+
- `RESEND_API_KEY`: Resend API key
89+
90+
```bash
91+
RESEND_API_KEY=re_...
92+
```
93+
7394
## Compile and run the project
7495

7596
Compile :
@@ -104,4 +125,4 @@ docker run -p 3000:3000 --name mooncode-api-container --env-file apps/api/.env m
104125

105126
## License
106127

107-
[MIT](/LICENSE) License &copy; 2025
128+
[MIT](/LICENSE) License &copy; 2026

apps/api/compose.staging.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
context: ../../
77
dockerfile: apps/api/Dockerfile
88
ports:
9-
- "127.0.0.1:3002:3000"
9+
- "127.0.0.1:3003:3000"
1010
env_file:
1111
- .env.staging
1212
depends_on:

apps/dashboard/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ npm install
3737

3838
### Development
3939

40-
Before continuing you'll need some environment variables: `VITE_API_URL`, `VITE_LOGOUT_URL` and `VITE_AUTH_GOOGLE_URL`.
40+
Before continuing you'll need some environment variables: `VITE_API_URL`, `VITE_LOGOUT_URL`, `VITE_AUTH_GOOGLE_URL` and `VITE_LINKING_GOOGLE_ACCOUNT_URL`.
41+
4142
Create a `.env.development` :
4243

4344
```bash
4445
VITE_API_URL="http://localhost:3000/trpc"
4546
VITE_LOGOUT_URL="http://localhost:3000/trpc/auth.logOut"
4647
VITE_AUTH_GOOGLE_URL="http://localhost:3000/auth/google"
48+
VITE_LINKING_GOOGLE_ACCOUNT_URL="http://localhost:3000/auth/google/linking"
4749
```
4850

4951
So to properly run the dashboard in development, the [API](../api) must be also running on `http://localhost:3000`. Then run
@@ -57,12 +59,13 @@ and open `http://localhost:4208` (or the near available port).
5759
### Production
5860

5961
To build for production:
60-
Create a `.env.production` with the same variables as in development and adapt them depending of your API:
62+
Create a `.env.production` with the same variables as in development and adapt them depending of your API domain:
6163

6264
```bash
6365
VITE_API_URL=...
6466
VITE_LOGOUT_URL=...
6567
VITE_AUTH_GOOGLE_URL=...
68+
VITE_LINKING_GOOGLE_ACCOUNT_URL=...
6669
```
6770

6871
Then build with:
@@ -73,4 +76,4 @@ npm run build
7376

7477
## License
7578

76-
[MIT](/LICENSE) License &copy; 2025
79+
[MIT](/LICENSE) License &copy; 2026

apps/dashboard/src/features/files-list/components/files.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ export const Files = memo(function Files({
3636

3737
useEffect(() => {
3838
setPage(1);
39-
}, [period, customRange.start, customRange.end, languagesToFetch]);
39+
}, [
40+
period,
41+
customRange.start,
42+
customRange.end,
43+
languagesToFetch,
44+
searchTerm,
45+
]);
4046

4147
const { files, groups, hasNext } = useFiles(
4248
languagesToFetch,

apps/vscode-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "mooncode",
33
"displayName": "MoonCode",
44
"description": "MoonCode is an extension that tracks your coding time (like WakaTime) and gives you a detailed summary about all your coding statistics. With MoonCode, developers get the full history of their coding activity.",
5-
"version": "0.0.55",
5+
"version": "0.0.56",
66
"icon": "./public/moon.png",
77
"publisher": "Friedrich482",
88
"author": {

apps/web/src/app/layout.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,25 @@ export const metadata: Metadata = {
1414
title: "MoonCode | Track your coding activity with ease",
1515
description: "Track your coding time, languages and files with ease",
1616
metadataBase: new URL("https://mooncode.cc"),
17+
alternates: {
18+
canonical: "/",
19+
},
1720

1821
openGraph: {
1922
title: "MoonCode",
2023
type: "website",
2124
url: "https://mooncode.cc",
2225
description: "Track your coding activity with ease",
2326
siteName: "MoonCode",
27+
images: "/opengraph-image.png",
2428
},
2529

2630
twitter: {
2731
title: "MoonCode",
2832
creator: "@FriedrichC109",
2933
description: "Track your coding time, languages and files with ease",
3034
card: "summary_large_image",
35+
images: "/twitter-image.png",
3136
},
3237
};
3338

0 commit comments

Comments
 (0)