Skip to content

Commit f354875

Browse files
authored
Merge pull request #121 from Friedrich482/features
Website (marketing landing page) for the project
2 parents fd36f05 + 5af5209 commit f354875

46 files changed

Lines changed: 2109 additions & 58 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ tsconfig.tsbuildinfo
88
**/compose.*.yaml
99
**/node_modules
1010
packages/eslint-config
11-
**/eslint.config.ts
11+
**/eslint.config.ts
12+
**/.next
13+
**/out

.github/workflows/build-and-deploy.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: MoonCode CI/CD Pipeline - Build api docker image and deploy to production
1+
name: MoonCode CI/CD Pipeline - Build api and web app docker images and deploy to production
22

33
on:
44
push:
55
branches: "main"
66

77
jobs:
8-
build-and-push-docker-image:
8+
build-and-push-docker-images:
99
runs-on: ubuntu-latest
1010

1111
steps:
@@ -34,3 +34,4 @@ jobs:
3434
run: |
3535
IMAGE_TAG=${{ github.sha }}
3636
docker buildx build --platform linux/amd64 -t ${{ secrets.DOCKERHUB_USERNAME }}/mooncode-api:$IMAGE_TAG -t ${{ secrets.DOCKERHUB_USERNAME }}/mooncode-api:latest --push -f apps/api/Dockerfile .
37+
docker buildx build --platform linux/amd64 -t ${{ secrets.DOCKERHUB_USERNAME }}/mooncode-web:$IMAGE_TAG -t ${{ secrets.DOCKERHUB_USERNAME }}/mooncode-web:latest --push -f apps/web/Dockerfile .

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<img width="200" height="200" alt="Moon" src="https://github.com/user-attachments/assets/e38843c0-22dd-4dbc-985e-eab77277acc4" />
55
</p>
66

7-
<p align="center">An application that tracks and monitors you coding time with a detailled summary<br/>
8-
<a href="">link_to_website</a> (coming soon)
7+
<p align="center">Track your coding activity with ease.<br/>
8+
<a href="https://mooncode.cc">mooncode.cc</a>
99
</p>
1010

1111
<p align="center">
@@ -17,27 +17,28 @@
1717

1818
This project is the monorepo for MoonCode. This is an application to track and get a detailled summary about your coding time, languages, files across any period.
1919

20-
## Features 🚀
20+
## Features
2121

2222
- Summary of coding time per day, week, month, year,... and any custom period
2323
- Support for most languages/files extensions
2424
- Breakdown of coding activity per project
2525
- Local dashboard to visualize your data, with extensive filters for a more detailed summary
2626
- All parts (vscode-extension, api, dashboard) of the project can be self-hosted
27-
- Extension Works offline 🔌
27+
- Extension works offline
2828

2929
### Apps and Packages
3030

3131
- [`api`](./apps/api): a [Nestjs](https://nestjs.com/) application that powers the `extension` and the `dashboard`
3232
- [`dashboard`](./apps/dashboard): a [Vite](https://vite.dev/) application served locally by the extension to visualize the data
33-
- [`vscode extension`](./apps/vscode-extension): the VSCode extension that collects the data
34-
- [`web`](./apps/web): a [Nextjs](https://nextjs.org/) application that is the web site of the project (coming soon)
33+
- [`vscode extension`](./apps/vscode-extension): the VSCode extension that collects your statistics
34+
- [`web`](./apps/web): a [Nextjs](https://nextjs.org/) application that is the website of the project
3535
- [`@repo/common`](./packages/common): all functions, constants and utils shared by the three parts of the project
3636
- [`@repo/trpc`](./packages/trpc): the package that shares trpc types across the project
3737
- [`@repo/ui`](./packages/ui): ui components shared between `dashboard` and `web`
3838

3939
### Useful links
4040

41+
- The main website is deployed on [mooncode.cc](https://mooncode.cc)
4142
- The API is deployed on [api.mooncode.cc](https://api.mooncode.cc)
4243
- The extension: [https://marketplace.visualstudio.com/items?itemName=Friedrich482.mooncode](https://marketplace.visualstudio.com/items?itemName=Friedrich482.mooncode)
4344
- The dashboard is served by the extension on [http://localhost:4208](http://localhost:4208) or any near available port

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.54",
5+
"version": "0.0.55",
66
"icon": "./public/moon.png",
77
"publisher": "Friedrich482",
88
"author": {

apps/web/Dockerfile

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
ARG NODE_VERSION=24.13.0-slim
2+
ARG NGINXINC_IMAGE_TAG=alpine3.22
3+
4+
FROM node:${NODE_VERSION} AS dependencies
5+
6+
WORKDIR /app
7+
8+
COPY package.json package-lock.json* .npmrc* ./
9+
COPY turbo.json ./
10+
11+
COPY apps/web/package*.json ./apps/web/
12+
COPY packages/ui/package*.json ./packages/ui/
13+
14+
# Install project dependencies with frozen lockfile for reproducible builds
15+
RUN --mount=type=cache,target=/root/.npm \
16+
npm ci --no-audit --no-fund
17+
18+
FROM node:${NODE_VERSION} AS builder
19+
20+
WORKDIR /app
21+
22+
COPY --from=dependencies /app/node_modules ./node_modules
23+
24+
COPY . .
25+
26+
ENV NODE_ENV=production
27+
28+
RUN --mount=type=cache,target=/app/apps/web/.next/cache \
29+
npm run build --workspace=web
30+
31+
FROM nginxinc/nginx-unprivileged:${NGINXINC_IMAGE_TAG} AS runner
32+
33+
WORKDIR /app
34+
35+
RUN echo 'worker_processes 1; \
36+
pid /tmp/nginx.pid; \
37+
events { \
38+
worker_connections 1024; \
39+
} \
40+
http { \
41+
include /etc/nginx/mime.types; \
42+
default_type application/octet-stream; \
43+
access_log /dev/stdout; \
44+
error_log /dev/stderr; \
45+
sendfile on; \
46+
tcp_nopush on; \
47+
tcp_nodelay on; \
48+
keepalive_timeout 65; \
49+
gzip on; \
50+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; \
51+
gzip_min_length 256; \
52+
server { \
53+
listen 8080; \
54+
server_name localhost; \
55+
root /usr/share/nginx/html; \
56+
index index.html; \
57+
location / { \
58+
try_files $uri $uri.html $uri/ =404; \
59+
} \
60+
location ~ ^/(.+)/$ { \
61+
rewrite ^/(.+)/$ /$1.html break; \
62+
} \
63+
location ~ ^/_next/ { \
64+
try_files $uri =404; \
65+
expires 1y; \
66+
add_header Cache-Control "public, immutable"; \
67+
} \
68+
error_page 404 /404.html; \
69+
location = /404.html { \
70+
internal; \
71+
} \
72+
} \
73+
} \
74+
' > /etc/nginx/nginx.conf
75+
76+
COPY --from=builder /app/apps/web/out /usr/share/nginx/html
77+
78+
USER nginx
79+
80+
EXPOSE 8080
81+
82+
CMD ["nginx", "-c", "/etc/nginx/nginx.conf", "-g", "daemon off;"]

apps/web/README.md

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,84 @@
1-
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1+
<p align="center">
2+
<img width="200" height="200" alt="Moon" src="https://github.com/user-attachments/assets/e38843c0-22dd-4dbc-985e-eab77277acc4" />
3+
</p>
24

3-
## Getting Started
5+
<h1 align="center">MoonCode Website</h1>
6+
<p align="center">The main website for the MoonCode app<br/>
7+
<a href="https://mooncode.cc">mooncode.cc</a>
8+
</p>
49

5-
First, run the development server:
10+
<p align="center">
11+
<img src="https://img.shields.io/badge/version-0.0.1-yellow">
12+
<img src="https://img.shields.io/badge/LICENSE-MIT-yellow">
13+
</p>
14+
15+
## Description
16+
17+
This project is the website (marketing site) of the MoonCode project.
18+
It is built on top of [Nextjs](https://nextjs.org/).
19+
20+
## Project setup
21+
22+
To run the website, you need to first clone the repository
23+
24+
```bash
25+
git clone https://github.com/Friedrich482/mooncode-monorepo.git
26+
```
27+
28+
Then `cd` in the `web` folder
29+
30+
```bash
31+
cd apps/web
32+
```
33+
34+
Then install dependencies
35+
36+
```bash
37+
npm install
38+
```
39+
40+
### Development
41+
42+
Run
643

744
```bash
845
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
1546
```
1647

17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
48+
and open `http://localhost:3001`
49+
50+
### Production
51+
52+
To build for production, build with:
1853

19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
54+
```bash
55+
npm run build
56+
```
2057

21-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
58+
and start the built app with:
2259

23-
## Learn More
60+
```bash
61+
npm run start
62+
```
2463

25-
To learn more about Next.js, take a look at the following resources:
64+
## Deployment
2665

27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
66+
The website is currently deployed on [mooncode.cc](https://mooncode.cc).
2967

30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
68+
## Containerization
3169

32-
## Deploy on Vercel
70+
To dockerize the application, you need to place yourself at the root of the monorepo, then
71+
72+
```bash
73+
docker build -t mooncode-web -f apps/web/Dockerfile --progress=plain .
74+
```
75+
76+
And to run a container called `mooncode-web-container` :
77+
78+
```bash
79+
docker run -d -p 3002:8080 --name mooncode-web-container mooncode-web
80+
```
3381

34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
82+
## License
3583

36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
84+
[MIT](/LICENSE) License &copy; 2026

apps/web/eslint.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const config = [
77
...nextVitals,
88
{
99
ignores: [".next/**", "out/**", "build/**", "next-env.d.ts"],
10+
rules: {
11+
"react-hooks/exhaustive-deps": "off",
12+
},
1013
},
1114
];
1215

apps/web/next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
output: "standalone",
4+
output: "export",
55
turbopack: {
66
rules: {
77
"*.svg": {

apps/web/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
"scripts": {
66
"dev": "next dev --turbopack -p 3001",
77
"build": "next build",
8-
"start": "next start",
8+
"start": "serve out -p 3002",
99
"lint": "eslint . --fix"
1010
},
1111
"dependencies": {
1212
"@icons-pack/react-simple-icons": "^13.11.1",
1313
"@repo/common": "*",
1414
"@repo/trpc": "*",
1515
"@repo/ui": "*",
16+
"motion": "^12.36.0",
1617
"next": "^16.1.6",
1718
"next-themes": "^0.4.6",
1819
"react": "^19.2.0",
19-
"react-dom": "^19.2.0"
20+
"react-dom": "^19.2.0",
21+
"react-medium-image-zoom": "^5.4.1"
2022
},
2123
"devDependencies": {
2224
"@svgr/webpack": "^8.1.0",
@@ -29,6 +31,7 @@
2931
"postcss": "^8.5.6",
3032
"prettier": "^3.8.1",
3133
"prettier-plugin-tailwindcss": "^0.6.14",
34+
"serve": "^14.2.6",
3235
"tailwindcss": "^4.1.17",
3336
"turbopack-inline-svg-loader": "^1.0.3",
3437
"typescript": "^5.9.3"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import Zoom from "react-medium-image-zoom";
2+
import Image from "next/image";
3+
4+
import mooncodeArchitecture from "@/assets/mooncode-architecture.svg";
5+
6+
import { BLUR_DATA_URL } from "../constants";
7+
import { FadeContent } from "./motion/fade-content";
8+
9+
import "react-medium-image-zoom/dist/styles.css";
10+
11+
export const Architecture = () => (
12+
<section
13+
id="architecture"
14+
className="flex w-full flex-col gap-20 px-14 pt-20 pb-12"
15+
>
16+
<FadeContent className="flex flex-col gap-8">
17+
<h2 className="text-center text-5xl font-bold wrap-anywhere max-sm:text-4xl">
18+
Project Architecture
19+
</h2>
20+
<p className="text-center font-light">
21+
We currently operate through a local dashboard and a NestJS API. It is
22+
simple but it gets the job done.
23+
</p>
24+
</FadeContent>
25+
26+
<Zoom wrapElement="span" canSwipeToUnzoom={true}>
27+
<Image
28+
src={mooncodeArchitecture as unknown as string}
29+
alt="Architecture Diagram"
30+
width={600}
31+
height={100}
32+
loading="lazy"
33+
className="w-4/5 cursor-zoom-in place-self-center rounded-xl max-md:w-full"
34+
placeholder="blur"
35+
blurDataURL={BLUR_DATA_URL}
36+
/>
37+
</Zoom>
38+
</section>
39+
);

0 commit comments

Comments
 (0)