Skip to content

Commit

Permalink
Merge pull request #12 from noclocks/develop
Browse files Browse the repository at this point in the history
[Feature]: Chatbot
  • Loading branch information
jimbrig authored Apr 30, 2024
2 parents d03001a + f16c718 commit 6212167
Show file tree
Hide file tree
Showing 66 changed files with 26,716 additions and 72,389 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Full tech stack [here](/techstack.md)

```zsh
# Create Remix (+ Vite) SPA app
npx create-remix@latest --template remix-run/remix/templates/spa app
pnpm dlx create-remix@latest --template remix-run/remix/templates/spa app

# > Initialize a new git repository?
No
Expand Down
34 changes: 34 additions & 0 deletions app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/dist
LICENSE
README.md
77 changes: 77 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# syntax=docker/dockerfile:1

ARG NODE_VERSION=20.12.2
ARG PNPM_VERSION=9.0.5

################################################################################
# Use node image for base image for all stages.
FROM node:${NODE_VERSION}-alpine as base

# Associate with GitHub repository
LABEL org.opencontainers.image.source=https://github.com/noclocks/bastienlaw-remix

# Set working directory for all build stages.
WORKDIR /usr/src/app

# Install pnpm.
RUN --mount=type=cache,target=/root/.npm \
npm install -g pnpm@${PNPM_VERSION}

################################################################################
# Create a stage for installing production dependecies.
FROM base as deps

# Download dependencies as a separate step to take advantage of Docker's caching.
# Leverage a cache mount to /root/.local/share/pnpm/store to speed up subsequent builds.
# Leverage bind mounts to package.json and pnpm-lock.yaml to avoid having to copy them
# into this layer.
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
--mount=type=cache,target=/root/.local/share/pnpm/store \
pnpm install --prod --frozen-lockfile

################################################################################
# Create a stage for building the application.
FROM deps as build

# Download additional development dependencies before building, as some projects require
# "devDependencies" to be installed to build. If you don't need this, remove this step.
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
--mount=type=cache,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile

# Copy the rest of the source files into the image.
COPY . .
# Run the build script.
RUN pnpm run build

################################################################################
# Create a new stage to run the application with minimal runtime dependencies
# where the necessary files are copied from the build stage.
FROM base as final

# Use production node environment by default.
# ENV NODE_ENV production
ENV NODE_ENV development

# # Run the application as a non-root user.
USER node

# Copy package.json so that package manager commands can be used.
COPY package.json .

# Copy the production dependencies from the deps stage and also
# the built application from the build stage into the image.
COPY --from=deps /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/build ./build

ENV HOST '0.0.0.0'
ENV PORT 8080

# Expose the port that the application listens on.
EXPOSE 8080

# Run the application.
# CMD ["npx", "sirv-cli", "build/client", "--single", "--port", "8080", "--cors", "--dev"]
CMD ["pnpm", "run", "serve"]
12 changes: 6 additions & 6 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ This template leverages [Remix SPA Mode](https://remix.run/docs/en/main/future/s
## Setup

```shellscript
npx create-remix@latest --template remix-run/remix/templates/spa
pnpx create-remix@latest --template remix-run/remix/templates/spa
```

## Development

You can develop your SPA app just like you would a normal Remix app, via:

```shellscript
npm run dev
pnpm run dev
```

## Production

When you are ready to build a production version of your app, `npm run build` will generate your assets and an `index.html` for the SPA.
When you are ready to build a production version of your app, `pnpm run build` will generate your assets and an `index.html` for the SPA.

```shellscript
npm run build
pnpm run build
```

### Preview

You can preview the build locally with [vite preview](https://vitejs.dev/guide/cli#vite-preview) to serve all routes via the single `index.html` file:

```shellscript
npm run preview
pnpm run preview
```

> ![WARNING] `vite preview` is not designed for use as a production server
Expand All @@ -45,7 +45,7 @@ You can then serve your app from any HTTP server of your choosing. The server sh
For a simple example, you could use [sirv-cli](https://www.npmjs.com/package/sirv-cli):

```shellscript
npx sirv-cli build/client/ --single
pnpx sirv-cli build/client/ --single
```

[remix-vite-docs]: https://remix.run/docs/en/main/future/vite
17 changes: 17 additions & 0 deletions app/app/components/ChatBot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const ChatbotScript = () => (
<>
<script
dangerouslySetInnerHTML={{
__html: `
window.embeddedChatbotConfig = {
chatbotId: "VhVykMQoMKK6p-pu3I1wP",
domain: "www.chatbase.co"
};
`,
}}
/>
<script src="https://www.chatbase.co/embed.min.js" defer />
</>
);

export default ChatbotScript;
164 changes: 164 additions & 0 deletions app/app/components/DefaultPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
import {Header} from '../components/Header';
import {Footer} from '../components/Footer';

import '../styles/nursing-home-abuse.css';

export interface DefaultPageProps {
title: string;
description: string | JSX.Element;
includeSidebar?: boolean;
}

export default function DefaultPage(props: DefaultPageProps) {
return (
<div id='page-container'>
<div
id='et-boc'
className='et-boc'
>
<Header />
<div id='et-main-area'>
<div id='main-content'>
<div className='et-l et-l--body'>
<div className='et_builder_inner_content et_pb_gutters1'>
<div className='et_pb_section et_pb_section_1_tb_body et_pb_with_background et_section_regular'>
<div className='et_pb_row et_pb_row_0_tb_body'>
<div className='et_pb_column et_pb_column_4_4 et_pb_column_0_tb_body et_pb_css_mix_blend_mode_passthrough et-last-child'>
<div className='et_pb_module et_pb_text et_pb_text_0_tb_body et_pb_text_align_center et_pb_bg_layout_light'>
<div className='et_pb_text_inner'>
<p>
Dedication. Skill. Innovation.
<br /> Trust The{' '}
<strong>
<span className='nap-item nap-item--name'>
Law Offices of Villard Bastien, LLC
</span>
</strong>
.
</p>
</div>
</div>
</div>
</div>
</div>
<div className='et_pb_section et_pb_section_3_tb_body fl-breadcrumbs et_pb_with_background et_section_regular'>
<div className='et_pb_row et_pb_row_1_tb_body'>
<div className='et_pb_column et_pb_column_4_4 et_pb_column_1_tb_body et_pb_css_mix_blend_mode_passthrough et-last-child'>
<div className='et_pb_module et_pb_dcsbcm_divi_breadcrumbs_module et_pb_dcsbcm_divi_breadcrumbs_module_0_tb_body'>
<div className='et_pb_module_inner'>
<ol className='dcsbcm_divi_breadcrumbs'>
<li className='dcsbcm_divi_breadcrumb'>
<a href='/'>
<span>Home</span>
</a>
<meta
property='position'
content='1'
/>
</li>
<span className='dcsbcm_separator'>
&nbsp;&raquo;&nbsp;
</span>
<span className='dcsbcm_divi_breadcrumb dcsbcm_divi_breadcrumb-active'>
{props.title}
</span>
</ol>
</div>
</div>
</div>
</div>
</div>
<div className='et_pb_section et_pb_section_4_tb_body et_pb_with_background et_section_regular'>
<div className='et_pb_row et_pb_row_2_tb_body'>
<div
className={
!props.includeSidebar
? 'et_pb_column et_pb_column_2_tb_body fl-main-content et_pb_css_mix_blend_mode_passthrough'
: 'et_pb_column et_pb_column_2_3 et_pb_column_2_tb_body fl-main-content et_pb_css_mix_blend_mode_passthrough'
}
>
<div className='et_pb_module et_pb_post_content et_pb_post_content_0_tb_body'>
<h1>{props.title}</h1>
{typeof props.description === 'string' ? (
<p>{props.description}</p>
) : (
props.description
)}
</div>
</div>
{!props.includeSidebar ? null : (
<div className='et_pb_column et_pb_column_1_3 et_pb_column_3_tb_body et_pb_css_mix_blend_mode_passthrough et-last-child'>
<div
id='nav-practice-silo'
className='et_pb_module et_pb_sidebar_0_tb_body nav-practice-silo et_pb_widget_area clearfix et_pb_widget_area_left et_pb_bg_layout_light'
>
<div
id='nav_menu-2'
className='et_pb_widget widget_nav_menu'
>
<h2 className='widgettitle'>Practice Areas</h2>
<div className='menu-practice-areas-container'>
<ul
id='menu-practice-areas'
className='menu'
>
<li className='menu-item current-menu-item menu-item--depth-0'>
<a
href='nursing-home-abuse'
aria-current='page'
tabIndex={0}
>
Nursing Home Abuse
</a>
</li>
<li className='menu-item menu-item-has-children menu-item--depth-0'>
<a
href='other-practice-areas'
tabIndex={0}
>
Other Practice Areas
</a>
<ul className='sub-menu'>
<li className='menu-item menu-item--depth-1'>
<a
href='business-general-counsel-business-transactions'
tabIndex={0}
>
Business General Counsel / Business Transactions
</a>
</li>
<li className='menu-item menu-item--depth-1'>
<a
href='criminal-law-defense'
tabIndex={0}
>
Criminal Law Defense
</a>
</li>
<li className='menu-item menu-item--depth-1'>
<a
href='serious-injury'
tabIndex={0}
>
Serious Injury
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
)}
</div>
</div>
</div>
</div>
</div>
<Footer />
</div>
</div>
</div>
);
}
Loading

0 comments on commit 6212167

Please sign in to comment.