Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New site #1

Merged
merged 73 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
6340e2a
next setup and homepage ui
chrisfromhubql May 20, 2024
0f919ce
build service, community and contact page
chrisfromhubql May 24, 2024
5818035
fix content and links
chrisfromhubql May 24, 2024
5698b68
ci: add preview deploy
danstarns May 27, 2024
051aba5
ci: name changes
danstarns May 27, 2024
80054dc
remove dark theme - not in use
chrisfromhubql May 28, 2024
31ffa8f
images: add raw images to use for services
danstarns May 29, 2024
d5093bb
images: remove graphql meetups from homepage and add devtools asia logo
danstarns May 29, 2024
d01014b
ci: pull correct branch for preview
danstarns May 29, 2024
876f510
content: add youtube videos
danstarns May 29, 2024
ef72f40
map: add more locations
danstarns May 29, 2024
03ab7f4
content: add more text around services and community
danstarns May 30, 2024
87a1919
styling: update for dark mode and fix service card image size
chrisfromhubql May 30, 2024
537c27b
images: remove non svgs and add oursky
danstarns May 30, 2024
b87aa0c
content: add visable page header and move logos to bottom for non hom…
danstarns May 30, 2024
1955421
style: blue cta 'connect'
danstarns May 30, 2024
0144bde
style: add gap to videos
danstarns May 30, 2024
3170eec
content: add about page with inital content
danstarns May 30, 2024
6ab85ab
content: add header to contact page
danstarns May 30, 2024
0b77570
content: about wording
danstarns May 30, 2024
cae8c99
fix: correct tab header for about page
danstarns May 30, 2024
669097e
footer: update services
danstarns May 30, 2024
fe4dde6
content: add image and text to contact page
danstarns Jun 1, 2024
9b8cb9d
content: add text under headers on homepage
danstarns Jun 1, 2024
6a3499c
style: contact form colors
danstarns Jun 1, 2024
1b40a07
style: opacity images and add border
danstarns Jun 1, 2024
9c3d4a1
style: dark text on sheet light mode expand
danstarns Jun 2, 2024
421c2c6
image: fix github logo svg
danstarns Jun 2, 2024
24d6f96
style: overall responsiveness and new hero layout
chrisfromhubql Jun 3, 2024
395db68
style: font size footer
chrisfromhubql Jun 3, 2024
7ba7b22
style: page name color
chrisfromhubql Jun 3, 2024
1487d5b
ci: build project on github runner to report build errors
danstarns Jun 5, 2024
e861450
ci: remove pnpm usage
danstarns Jun 5, 2024
8eed6a1
ci: remove cache
danstarns Jun 5, 2024
251e7c4
fix: build errors
danstarns Jun 5, 2024
91e0025
new blog
chrisfromhubql Jun 5, 2024
306370e
feat: add header and social proof to blog page
danstarns Jun 5, 2024
eeddc6a
style: BlogPosts
danstarns Jun 5, 2024
4ea6b9e
style: BlogPosts
danstarns Jun 5, 2024
8eaeadc
feat: add inital blog content
danstarns Jun 6, 2024
2e14ba2
add theme switch and update metadata and update theme
chrisfromhubql Jun 6, 2024
9281b63
Merge pull request #2 from rocket-connect/blog
danstarns Jun 6, 2024
0e40bb7
content: add kodingakademi logo
danstarns Jun 6, 2024
4229758
refactor: add global content file and reuse main header
danstarns Jun 6, 2024
feeab87
content: *
danstarns Jun 6, 2024
fedcba4
content: add links to services
danstarns Jun 6, 2024
36ed2f0
content: *
danstarns Jun 6, 2024
3634584
content: changes to communities directory
danstarns Jun 6, 2024
e952d80
feat: add link for home services
danstarns Jun 6, 2024
b6afabf
feat: add google tag
danstarns Jun 6, 2024
0020675
seo: add tag manager
danstarns Jun 6, 2024
38f01ba
refactor: make clear preview google
danstarns Jun 6, 2024
efef9eb
content: *
danstarns Jun 6, 2024
59f0584
refactor: remove old backend and use next route, remove two monorepo …
danstarns Jun 6, 2024
285fa0b
fix: email build errors
danstarns Jun 6, 2024
16890c5
fix: lock
danstarns Jun 6, 2024
8024f5b
feat: add src dir
danstarns Jun 6, 2024
b972965
fix: monorepo *
danstarns Jun 7, 2024
920bdce
package: fix *
danstarns Jun 7, 2024
6eeb3cd
feat: hookup the frontend contact form
danstarns Jun 7, 2024
84c1f35
refactor: remove old env
danstarns Jun 7, 2024
647858e
meta: *
danstarns Jun 7, 2024
b8e845b
fix: *
danstarns Jun 7, 2024
a466103
seo: add intro to metadata
danstarns Jun 7, 2024
719ae9d
refactor: remove tag manager
danstarns Jun 7, 2024
3558a23
seo: add ga_key env
danstarns Jun 7, 2024
414c2bf
dev: add prettier and eslint and fix errors
danstarns Jun 7, 2024
c950ae6
dev: format all files
danstarns Jun 7, 2024
9135820
content: update default banner
danstarns Jun 7, 2024
0944987
content: change preview to png
danstarns Jun 7, 2024
7696f17
dev: add lint to pipelines
danstarns Jun 7, 2024
d38256f
ci: ready for main
danstarns Jun 7, 2024
af0a7cc
ci: add pr checks
danstarns Jun 7, 2024
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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
METADATA_BASE_URL=http://localhost:4000
EMAIL_SENDER_ADDRESS=""
EMAIL_SENDER_PASSWORD=""
EMAIL_HOST=""
GA_KEY=""
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
extends: [
'next',
'next/core-web-vitals',
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
plugins: ['react', '@typescript-eslint'],
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
22 changes: 22 additions & 0 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Setup Project

inputs:
node-version:
required: false
default: 18

runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: Install dependencies
run: npm install
shell: bash
- name: Lint project
run: npm run lint
shell: bash
- name: Build project
run: npm run build
shell: bash
14 changes: 6 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Node Github CI
name: rconnect.tech

on:
push:
branches:
- main

jobs:
deploy:
deploy-preview:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-project
- name: SSH and deploy node app
uses: appleboy/ssh-action@master
with:
Expand All @@ -19,13 +21,9 @@ jobs:
script: |
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
cd rconnect.tech
cd ./rconnect.tech
git reset --hard
git pull origin main
cd ./frontend
npm install
npm run build
cd ../backend
npm install
npm run build
pm2 restart website
pm2 restart rconnect.tech
14 changes: 14 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR Checks

on:
pull_request:
branches:
- main

jobs:
deploy-preview:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-project
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@ dist
.tern-port

.DS_Store
settings.json
settings.json

.env.local
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 100,
tabWidth: 2,
plugins: ['prettier-plugin-tailwindcss'],
};
39 changes: 7 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,15 @@
# rconnect.tech

Frontend & Backend For www.rconnect.tech
Source www.rconnect.tech

## Frontend
## Installation

React app built with Typescript & Tailwind.

## Backend

Node.js express server serving the frontend and handling the API requests to the `/contact` endpoint.

## Getting Started

The repo is **not** managed by a monorepo at this time.

For dev you mostly only need to run the frontend, the backend is only used in Digital Ocean.

#### Running DEV

Run the Webpack dev server on.

```
cd ./frontend
npm i
npm run dev
```bash
npm install
```

#### Simulating Production

To simulate the production environment, you can setup and run the express server.
## Run Dev

```
cd ./frontend
npm run build # Build the client dist first

cd ../backend
npm run build
npm run start
```bash
npm run dev
```
50 changes: 50 additions & 0 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { Hero } from '@/components/shared/Hero';
import { SocialProofSection } from '@/components/templates/SocialProofSection';
import { TwoColumn } from '@/components/shared/TwoColumn';
import { Cta } from '@/components/shared/Cta';
import { Footer } from '@/components/shared/Footer';
import { Header } from '@/components/shared/Header';
import { Main } from '@/components/shared/Main';
import { about } from '@/content/about';
import Image from 'next/image';
import { Metadata } from 'next';

export const metadata: Metadata = {
title: 'About Us | Rconnect.tech',
description: about.hero.intro,
openGraph: {
images: '/images/blog-default-preview.png',
},
};

export default function About() {
return (
<Main>
<Header />
<Hero content={about.hero} cta={true} />
{about.sections.map((section, index) => (
<TwoColumn key={'servicecol-' + index} index={index}>
<div className="flex flex-col gap-4">
<Image
src={section.image}
width={609}
height={380}
alt=""
className="h-width aspect-video rounded-xl object-cover object-top"
/>
<p className="text-center italic">{section.imageDescription}</p>
</div>
<div className="flex h-full flex-col justify-center gap-8 lg:w-1/2">
<div className="flex flex-col gap-4">
<h4 className="text-2xl font-bold">{section.title}</h4>
<p>{section.content}</p>
</div>
</div>
</TwoColumn>
))}
<SocialProofSection />
<Cta />
<Footer />
</Main>
);
}
39 changes: 39 additions & 0 deletions app/api/contact/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { createTransport } from 'nodemailer';

const transporter = createTransport({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - this is a bug in the types?
host: process.env.EMAIL_HOST,
secureConnection: false,
port: 587,
tls: {
ciphers: 'SSLv3',
},
auth: {
user: process.env.EMAIL_SENDER_ADDRESS,
pass: process.env.EMAIL_SENDER_PASSWORD,
},
});

async function handler({ name, email, message }: { name: string; email: string; message: string }) {
try {
await transporter.sendMail({
to: email,
from: process.env.EMAIL_SENDER_ADDRESS,
subject: 'Rocket Connect Contact',
text: `Thank you for contacting us ${name}, we will get back to you as soon as possible. Your message '${message}'`,
cc: [process.env.EMAIL_SENDER_ADDRESS as string, '[email protected]'],
});
} catch (error) {
console.error('Error sending email', error);
throw new Error('Error sending email');
}
}

export async function POST(req: Request) {
const { email, name, message } = await req.json();

await handler({ email, name, message });

return Response.json({});
}
96 changes: 96 additions & 0 deletions app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import fs from 'fs';
import path from 'path';
import matter from 'gray-matter';
import { MDXRemote } from 'next-mdx-remote/rsc';
import YouTube from '@/components/shared/Youtube';
import Code from '@/components/shared/Code';
import { Cta } from '@/components/shared/Cta';
import { Footer } from '@/components/shared/Footer';
import { Header } from '@/components/shared/Header';
import { Main } from '@/components/shared/Main';
import { Container } from '@/components/shared/Container';
import { ChevronLeft } from 'lucide-react';
import Link from 'next/link';
import { categoryColor, cn, formatdate, metadataBase } from '@/lib/utils';
import { Metadata, ResolvingMetadata } from 'next';

type Props = {
params: { slug: string };
};

export async function generateMetadata(
{ params }: Props,
parent: ResolvingMetadata,
): Promise<Metadata> {
const props = await getPost(params);
const previousImages = (await parent).openGraph?.images || [];

return {
title: `Blog | ${props.frontMatter.title}`,
description: props.frontMatter.description,
metadataBase,
openGraph: {
images: [props.frontMatter.hero, ...previousImages],
},
};
}

async function getPost({ slug }: { slug: string }) {
const markdownFile = fs.readFileSync(path.join('content/posts', slug + '.mdx'), 'utf-8');
const { data: frontMatter, content } = matter(markdownFile);
return {
frontMatter,
slug,
content,
};
}

export async function generateStaticParams() {
const files = fs.readdirSync(path.join('content/posts'));
const params = files.map((filename) => ({
slug: filename.replace('.mdx', ''),
}));
return params;
}

export default async function Page({ params }: { params: { slug: string } }) {
const props = await getPost(params);
const components = {
pre: Code,
YouTube,
};

const formattedDate = formatdate(props.frontMatter.date);
const color = categoryColor(props.frontMatter.category);

return (
<Main>
<Header />
<Container className="lg:py-0">
<div className="relative mx-auto max-w-2xl">
<Link href={'/blog'}>
<div className="sticky left-0 top-24 z-10 -ml-24 hidden h-10 w-10 items-center justify-center rounded-full border border-slate-300 bg-background-main transition-all ease-in hover:scale-[1.03] hover:shadow-sm dark:border-slate-600 dark:bg-background-invert lg:flex">
<ChevronLeft className="h-6 w-6 stroke-slate-500 dark:stroke-slate-400" />
</div>
</Link>
<article>
<div className="flex w-full items-center gap-1">
<div className={cn('text-md font-bold uppercase')} style={{ color }}>
{props.frontMatter.category}
</div>
<div className="text-slate-600 dark:text-slate-400">· {formattedDate}</div>
</div>
<h1 className="mb-4 text-4xl font-bold text-foreground-main dark:text-foreground-invert">
{props.frontMatter.title}
</h1>
<div className="prose-a:text-bold prose prose-sm mx-auto text-foreground-main md:prose-base lg:prose-lg prose-headings:text-foreground-main prose-a:text-foreground-main prose-a:visited:text-foreground-main prose-ol:list-decimal prose-ul:list-disc dark:text-foreground-invert dark:prose-headings:text-foreground-invert dark:prose-a:text-foreground-invert prose-a:dark:visited:text-foreground-invert">
<MDXRemote source={props.content} components={components} />
</div>
</article>
</div>
</Container>
<Cta />
<Footer />
</Main>
);
}
Loading
Loading