diff --git a/.Dockerignore b/.Dockerignore new file mode 100644 index 0000000..882f917 --- /dev/null +++ b/.Dockerignore @@ -0,0 +1,18 @@ +/node_modules +/.vscode +/.vercel +/.next +/.gitignore +/docker.sh +/build_number +/.env* + +# Nuxt dev/build outputs +.output +.nuxt +# Node dependencies +node_modules +# System files +*.log +build_number +docker.sh \ No newline at end of file diff --git a/fe/.eslintrc b/.eslintrc similarity index 100% rename from fe/.eslintrc rename to .eslintrc diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 91a54f7..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Github Pages Astro CI - -on: - # Trigger the workflow every time you push to the `main` branch - # Using a different branch name? Replace `main` with your branch’s name - push: - branches: [ main ] - # Allows you to run this workflow manually from the Actions tab on GitHub. - workflow_dispatch: - -# Allow this job to clone the repo and create a page deployment -permissions: - contents: read - pages: write - id-token: write - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout your repository using git - uses: actions/checkout@v2 - - name: Install, build, and upload your site - uses: withastro/action@v0 - - deploy: - needs: build - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..92fd8a3 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,46 @@ +name: Create and publish a Docker image + +on: + push: + branches: ['main'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v3.0.2 + + - name: Log in to the Container registry + uses: docker/login-action@v2.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.0.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + - name: Build and push Docker image + uses: docker/build-push-action@v3.1.0 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/lucxjo/friends-best:latest + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index e02be2b..0a4bef8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,11 @@ -# build output -dist/ -.output/ - -# dependencies -node_modules/ - -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - - -# environment variables +node_modules +*.log* +.nuxt +.nitro +.cache +.output .env -.env.production +/.yarn +!/.yarn/install-state.gz -# macOS-specific files -.DS_Store -dist - -./friends-best +.DS_Store \ No newline at end of file diff --git a/fe/.npmrc b/.npmrc similarity index 100% rename from fe/.npmrc rename to .npmrc diff --git a/fe/.nvmrc b/.nvmrc similarity index 100% rename from fe/.nvmrc rename to .nvmrc diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 22a1505..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] -} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index d642209..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9c34289 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "discord.enabled": true +} diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ef80b0d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Dockerfile +FROM node:17-alpine + +# create destination directory +RUN mkdir -p /usr/src/nuxt-app +WORKDIR /usr/src/nuxt-app + +# update and install dependency +RUN apk update && apk upgrade +RUN apk add git + +# copy the app, note .dockerignore +COPY . /usr/src/nuxt-app/ +RUN yarn install +RUN yarn build + +EXPOSE 3000 + +ENV NUXT_HOST=0.0.0.0 +ENV NUXT_PORT=3000 + +CMD [ "yarn", "start" ] \ No newline at end of file diff --git a/README.md b/README.md index d00d935..384991c 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,34 @@ -# Friends Best -A fan website for the Netflix series "Young Royals". +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). -## Contributing -I suggest using [Just](https://github.com/casey/just) to help with building -local changes. [PNPM](https://pnpm.io) is used for the package manager for the -frontend and the server is written in [Go](https://go.dev). -### Build Frontend -```sh -just build-fe -``` -or -```sh -cd fe -pnpm build +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev ``` -### Build server -```sh -just build-server -``` -or -```sh -go build ./server -``` +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. -### Build all -```sh -just build-all -``` +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. -### Build and Run all -```sh -just serve -``` +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.tsx`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +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. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/app.vue b/app.vue new file mode 100644 index 0000000..2b1be09 --- /dev/null +++ b/app.vue @@ -0,0 +1,5 @@ + diff --git a/assets/styles/_colours.scss b/assets/styles/_colours.scss new file mode 100644 index 0000000..932c410 --- /dev/null +++ b/assets/styles/_colours.scss @@ -0,0 +1,3 @@ +$bg-colour-light: rgb(187, 187, 187); +$accent-colour-light: rgb(24, 96, 231); +$filter-accent-colour-light: invert(34%) sepia(96%) saturate(4970%) hue-rotate(216deg) brightness(95%) contrast(91%); \ No newline at end of file diff --git a/server/src/assets/styles/globals.scss b/assets/styles/globals.scss similarity index 88% rename from server/src/assets/styles/globals.scss rename to assets/styles/globals.scss index f8fa70b..b9b0e92 100644 --- a/server/src/assets/styles/globals.scss +++ b/assets/styles/globals.scss @@ -3,7 +3,7 @@ body { font-family: 'Ubuntu', sans-serif !important; - background-color: wheat !important; + background-color: colours.$bg-colour-light; } .container { diff --git a/assets/styles/index.scss b/assets/styles/index.scss new file mode 100644 index 0000000..1f82d29 --- /dev/null +++ b/assets/styles/index.scss @@ -0,0 +1,43 @@ +@use 'colours'; + +.footer { + width: 100%; + height: 100px; + border-top: 1px solid #eaeaea; + display: flex; + justify-content: center; + align-items: center; +} + +.footer a:hover { + color: #0070f3; +} + +.footer a { + display: flex; + justify-content: center; + align-items: center; + flex-grow: 1; + color: #eaeaea; +} + +.grid-2 { + display: grid; + align-items: center; + justify-content: center; + grid-template-columns: 1fr 1fr; +} + +.grid-3 { + display: grid; + align-items: center; + justify-content: center; + grid-template-columns: 1fr 1fr 1fr; +} + +@media (max-width: 600px) { + .grid-3 { + width: 90%; + grid-template-columns: 1fr 1fr; + } +} diff --git a/build_number b/build_number new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/build_number @@ -0,0 +1 @@ +9 diff --git a/server/src/components/LinkCard.astro b/components/LinkCard.vue similarity index 50% rename from server/src/components/LinkCard.astro rename to components/LinkCard.vue index 388d20a..a16254e 100644 --- a/server/src/components/LinkCard.astro +++ b/components/LinkCard.vue @@ -1,24 +1,39 @@ ---- -export interface Props { - title: string; - to: string; -} - -const { to, title } = Astro.props; - -const isExternal = to.startsWith('http'); ---- -{ isExternal == true ? ( - -

{title} →

+