Skip to content

Commit

Permalink
Merge pull request #234 from UW-Macrostrat/column-builder
Browse files Browse the repository at this point in the history
Integrate column builder web application
  • Loading branch information
davenquinn authored Nov 18, 2024
2 parents 1d84e4c + f8fc373 commit 8815656
Show file tree
Hide file tree
Showing 118 changed files with 9,990 additions and 213 deletions.
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ packageExtensions:
dependencies:
supports-color: "*"

'@next/react-dev-overlay@*':
peerDependencies:
react: '*'

pnpFallbackMode: all

pnpMode: loose
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@blueprintjs/table": "^5.1.4",
"@lagunovsky/redux-react-router": "^3.2.0",
"@loadable/component": "^5.14.1",
"@macrostrat-web/column-builder": "workspace:*",
"@macrostrat-web/globe": "workspace:*",
"@macrostrat-web/lithology-hierarchy": "workspace:*",
"@macrostrat-web/map-utils": "workspace:*",
Expand Down
3 changes: 3 additions & 0 deletions packages/column-builder/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
44 changes: 44 additions & 0 deletions packages/column-builder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
_node_modules
# dependencies
/node_modules
/.pnp
.pnp.js

.yarn/cache
.yarn/install-state.gz
.yarn/unplugged

.pnp*

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.production
.env.development
# vercel
.vercel

# typescript
*.tsbuildinfo
33 changes: 33 additions & 0 deletions packages/column-builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
This web application is based on [Next.js](https://nextjs.org/) and installed using Yarn PnP.


## Getting Started

**You should use Yarn (>v2), not NPM, to install this application.
Everything is set up for "Plug'n'Play" modules.**

1. Install modules: `yarn`
2. Run the development server: `yarn run dev`.

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[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.ts`.

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.
8 changes: 8 additions & 0 deletions packages/column-builder/__archive/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
.next
docker
.git
14 changes: 14 additions & 0 deletions packages/column-builder/__archive/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:14.19

WORKDIR /app/dacite

COPY package*.json ./
COPY deps/web-components/packages/ui-components/package.json ./deps/web-components/packages/ui-components/
COPY deps/web-components/packages/form-components/package.json ./deps/web-components/packages/form-components/
COPY deps/web-components/packages/data-components/package.json ./deps/web-components/packages/data-components/

RUN npm install

EXPOSE 1234

CMD ["npm", "run", "dev"]
30 changes: 30 additions & 0 deletions packages/column-builder/__archive/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:16-alpine AS builder

WORKDIR /app/
COPY . .

RUN npm install

# This will do the trick, use the corresponding env file for each environment.
COPY ./.env.production .

RUN npm run build

# 3. Production image, copy all the files and run next
FROM node:16-alpine AS runner
WORKDIR /app/

ENV NODE_ENV=production

# # You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/.env.production ./
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next

EXPOSE 1234

ENV PORT 1234

CMD ["npm", "run", "start"]
11 changes: 11 additions & 0 deletions packages/column-builder/env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## place this into an .env.development file in this directory!!
NEXT_PUBLIC_SERVER_URL=http://localhost:3001
NEXT_PUBLIC_CLIENT_URL=http://localhost:3001
NEXT_PUBLIC_TOPOLOGY_URL=http://localhost:1235
NEXT_PUBLIC_BASE_URL=

## .env.production
NEXT_PUBLIC_SERVER_URL=http://postgrest:3001
NEXT_PUBLIC_CLIENT_URL=http://localhost:3001
NEXT_PUBLIC_TOPOLOGY_URL=http://localhost:1235
NEXT_PUBLIC_BASE_URL=/dacite
5 changes: 5 additions & 0 deletions packages/column-builder/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
48 changes: 48 additions & 0 deletions packages/column-builder/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/** @type {import('next').NextConfig} */
const path = require("path");

const packageSrc = (name) =>
path.resolve(
__dirname,
"..",
"..",
"deps",
"web-components",
"packages",
name,
"src"
);

const nextConfig = {
assetPrefix: process.env.NEXT_PUBLIC_BASE_URL,
basePath: process.env.NEXT_PUBLIC_BASE_URL,
typescript: {
ignoreBuildErrors: true,
},
reactStrictMode: true,
transpilePackages: [
"@macrostrat/form-components",
"@macrostrat/data-components",
"@macrostrat/ui-components",
"@macrostrat/column-components",
],
webpack: (config, options) => {
return {
...config,

resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
"~": path.resolve(__dirname, "src"),
"@macrostrat/form-components": packageSrc("form-components"),
"@macrostrat/data-components": packageSrc("data-components"),
"@macrostrat/ui-components": packageSrc("ui-components"),
"@macrostrat/column-components": packageSrc("column-components"),
},
},
};
},
};

module.exports = nextConfig;
39 changes: 39 additions & 0 deletions packages/column-builder/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@macrostrat-web/column-builder",
"scripts": {
"dev": "next dev -p 1234",
"build": "next build",
"start": "next start -p 1234",
"lint": "next lint"
},
"module": "src/index.ts",
"dependencies": {
"@blueprintjs/core": "^5.10.5",
"@blueprintjs/icons": "^5.10.0",
"@blueprintjs/popover2": "^1.2.1",
"@blueprintjs/select": "^5.2.1",
"@macrostrat-web/settings": "workspace:*",
"@macrostrat/column-components": "workspace:*",
"@macrostrat/data-components": "workspace:*",
"@macrostrat/form-components": "workspace:*",
"@macrostrat/hyper": "^2.0.1",
"@macrostrat/ui-components": "workspace:*",
"@mapbox/mapbox-gl-draw": "^1.3.0",
"@supabase/postgrest-js": "^0.36.0",
"@types/mapbox__mapbox-gl-draw": "^1.2.3",
"axios": "^0.27.2",
"cross-fetch": "^3.1.5",
"mapbox-gl": "^2.8.2",
"react": "^18",
"react-beautiful-dnd": "^13.1.0",
"react-color": "^2.19.3"
},
"devDependencies": {
"@types/node": "^17.0.10",
"@types/react": "^17",
"@types/react-beautiful-dnd": "^13.1.2",
"eslint": "^8.7.0",
"eslint-config-next": "^12.0.8",
"typescript": "^4.5.4"
}
}
10 changes: 10 additions & 0 deletions packages/column-builder/src/components/buttons/btns.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.flat-btn {
padding: 0 10px;
min-height: 0;
}

.position-increment-container {
display: flex;
justify-content: center;
align-items: center;
}
Loading

0 comments on commit 8815656

Please sign in to comment.