https://github.com/cnpem/sophys-web

Bluesky http-server client apps developed by the Control Software Group @LNLS/CNPEM.

https://github.com/cnpem/sophys-web

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Bluesky http-server client apps developed by the Control Software Group @LNLS/CNPEM.

Basic Info
  • Host: GitHub
  • Owner: cnpem
  • License: gpl-3.0
  • Language: TypeScript
  • Default Branch: main
  • Homepage:
  • Size: 2.66 MB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • Open Issues: 2
  • Releases: 0
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

Sophys Web

A collection of web applications and its resources for the Sirius Ophyd and blueskY utilitieS (SOphYS) project.

Note: This project is under development and is not yet ready for production use.

Existing apps

  • spu-ui: A web application for the SAPUCAIA beamline at LNLS.

Development

Setup

```bash

Install dependencies

pnpm i

Configure environment variables

There is an .env.example in the root directory you can use for reference

cp .env.example ./apps/spu-ui/.env ```

[!Note] One must copy the .env.example file to .env and configure the environment variables accordingly for each app in the apps directory, because each app has its own environment variables and can be configured and deployed independently.

Third-party dependencies

This project depends on having an external server running the bluesky http-server.

Running the development server

To run the development server, use the following command:

bash pnpm dev

This will start the spu-ui app on http://localhost:3000.

Local CI

To run the CI tests locally, use the following command:

bash pnpm local-ci

How to build a new app

To build a new app from scratch and take advantage of the shared packages and utilities, do the following:

Set up node and pnpm

This project requires node with version 22.14.0 or higher and pnpm with version 9.6.0 or higher.

If you don't have node and pnpm installed, go to the Node.js website and follow the instructions to install Node.js with pnpm for your operating system.

External dependencies

To run the app, you will need to have set up the following

Set up the repository

First, set up a fork of this repository on GitHub and clone it to your local machine.

Then, install the dependencies:

bash pnpm i

This will install all the dependencies for the monorepo and the apps in the apps directory.

Create a new app using the generator

To scaffold a new app, use the turbo generate command:

bash pnpm turbo generate app

This will prompt you for the name of the app and create a new directory in the apps directory with the name of the app.

Configure environment variables

[!Note] The new app will generate a small set of default environment variables in a .env file, such as BLUESKY_HTTPSERVER_URL and AUTH_SECRET. Please make sure to set the correct values for these variables in the .env file.

Run the app in development mode

To run the app in development mode, use the following command:

bash pnpm dev --filter=@sophys-web/<new-app-name>

This will start the app on http://localhost:3000 by default. > Note: The --filter flag is used to run only the app that you just created. If you want to run all the apps, you can use the pnpm dev command without the --filter flag.

Install new external dependencies to an app

When you are developing you new app, you will probably want to install external dependencies to your app other than the ones that are pre installed. Since this project is JavaScript and Node.js based, we can search for packages in the npm registry, which is "the largest software registry in the world" and the epicentre of JavaScript code sharing.

Full example

Let's imagine you decided that you project needs the nanoid package, because you saw an example of a code that creates unique ids with it, like the following snippet:

```typescript import { nanoid } from "nanoid";

model.id = nanoid(); //=> "V1StGXR8_Z5jdHi6B-myT" ```

So, naturally, your next step was finding the package in the npm registry: nanoid.

There you noticed that the package is in a version bigger than 5, has more than 50M weekly downloads, has 0 dependencies and the docs say that it does what you want it to do. So you decide you trust it and will install it.

WARNING In the Install instructions for the package in the npm registry, you will see only the suggestion to use the npm package manager, but this project requires pnpm as the package manager, so you will need - among other things - to replace the npm for pnpm in the install command.

We need also to consider that we are working in a monorepo that manages multiple apps and internal packages that have their own dependencies, so we need to be careful about where we want this new dependency will be installed.

In our example, we want to install this package to an app that exists in the apps/ directory of this monorepo. Lets say that the name of our app (defined in it's own package.json file) is @sophys-web/test-ui. So, for this case, the full command to add nanoid as a dependency in this app is:

bash pnpm add --filter @sophys-web/test-ui nanoid

Generally speaking, to add any dependencies to an app or an internal package in this project, the command should be:

bash pnpm add --filter @sophys-web/<app-name> <package-name>

You can read more about the options to managing dependencies on this monorepo in the turborepo docs on managing dependencies.

Deployment

With Docker

To deploy the app with Docker, you can use the provided Dockerfile in the app's directory. The Dockerfile is set up to build the app and run it in a production environment. To build the Docker image, run the following command in the root directory of the monorepo:

bash docker build -t sophys-web-qua-ui -f apps/qua-ui/Dockerfile .

To run the Docker container, use the following command:

bash docker run -d -p 3000:3000 sophys-web-qua-ui

Owner

  • Name: Brazilian Center for Research in Energy and Materials (CNPEM)
  • Login: cnpem
  • Kind: organization
  • Location: Brazil

GitHub Events

Total
  • Create event: 23
  • Issues event: 7
  • Watch event: 6
  • Delete event: 26
  • Member event: 1
  • Issue comment event: 1
  • Push event: 188
  • Pull request review comment event: 11
  • Pull request review event: 33
  • Pull request event: 34
  • Fork event: 2
Last Year
  • Create event: 23
  • Issues event: 7
  • Watch event: 6
  • Delete event: 26
  • Member event: 1
  • Issue comment event: 1
  • Push event: 188
  • Pull request review comment event: 11
  • Pull request review event: 33
  • Pull request event: 34
  • Fork event: 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 8
  • Total pull requests: 40
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.03
  • Merged pull requests: 35
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 38
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 1 day
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 0.14
  • Average comments per pull request: 0.03
  • Merged pull requests: 33
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • matyson (5)
  • brnovasco (3)
Pull Request Authors
  • matyson (20)
  • brnovasco (20)
Top Labels
Issue Labels
good first issue (4) enhancement (3) bug (2)
Pull Request Labels

Dependencies

package.json npm
  • @repo/typescript-config workspace:* development
  • @types/node ^20.11.24 development
  • eslint ^8.57.0 development
  • prettier ^3.2.5 development
  • prettier-plugin-tailwindcss ^0.5.11 development
  • turbo ^2.0.4 development
packages/config-eslint/package.json npm
  • @vercel/style-guide ^5.2.0 development
  • eslint-config-turbo ^2.0.0 development
packages/config-tailwind/package.json npm
  • @repo/typescript-config workspace:* development
  • tailwindcss ^3.4.1 development
packages/config-typescript/package.json npm
packages/ui/package.json npm
  • @repo/eslint-config workspace:* development
  • @repo/tailwind-config workspace:* development
  • @repo/typescript-config workspace:* development
  • @types/react ^18.2.61 development
  • autoprefixer ^10.4.18 development
  • postcss ^8.4.35 development
  • tailwindcss ^3.4.1 development
  • typescript ^5.3.3 development
  • @radix-ui/react-slot ^1.1.0
  • class-variance-authority ^0.7.0
  • clsx ^2.1.1
  • lucide-react ^0.396.0
  • tailwind-merge ^2.3.0
  • tailwindcss-animate ^1.0.7
pnpm-lock.yaml npm
  • cliui@8.0.2
  • code-frame@7.23.4
  • compat-data@7.23.3
  • config-array@0.11.14
  • core@7.23.3
  • counter@0.1.3
  • env@14.2.3
  • eslint-parser@7.23.3
  • eslint-patch@1.6.0
  • eslint-plugin-next@14.2.3
  • eslint-plugin@6.12.0
  • eslint-scope-5-internals@5.1.1-v1
  • eslint-utils@4.4.0
  • eslintrc@2.1.4
  • fs.scandir@2.1.5
  • fs.stat@2.0.5
  • fs.walk@1.2.8
  • gen-mapping@0.3.3
  • generator@7.23.4
  • helper-compilation-targets@7.22.15
  • helper-environment-visitor@7.22.20
  • helper-function-name@7.23.0
  • helper-hoist-variables@7.22.5
  • helper-module-imports@7.22.15
  • helper-module-transforms@7.23.3
  • helper-simple-access@7.22.5
  • helper-split-export-declaration@7.22.6
  • helper-string-parser@7.23.4
  • helper-validator-identifier@7.22.20
  • helper-validator-option@7.22.15
  • helpers@0.5.5
  • helpers@7.23.4
  • highlight@7.23.4
  • js@8.57.0
  • json-schema@7.0.15
  • json5@0.0.29
  • module-importer@1.0.1
  • node@20.11.24
  • normalize-package-data@2.4.4
  • object-schema@2.0.2
  • parseargs@0.11.0
  • parser@6.12.0
  • parser@7.23.4
  • prop-types@15.7.11
  • quick-lru@5.2.0
  • react-compose-refs@1.1.0
  • react-dom@18.2.19
  • react-slot@1.1.0
  • react@18.2.61
  • regexpp@4.10.0
  • remapping@2.2.1
  • resolve-uri@3.1.1
  • runtime@7.23.4
  • runtime@7.24.7
  • scheduler@0.16.8
  • scope-manager@5.62.0
  • scope-manager@6.12.0
  • semver@7.5.6
  • set-array@1.1.2
  • sourcemap-codec@1.4.15
  • structured-clone@1.2.0
  • style-guide@5.2.0
  • swc-darwin-arm64@14.2.3
  • swc-darwin-x64@14.2.3
  • swc-linux-arm64-gnu@14.2.3
  • swc-linux-arm64-musl@14.2.3
  • swc-linux-x64-gnu@14.2.3
  • swc-linux-x64-musl@14.2.3
  • swc-win32-arm64-msvc@14.2.3
  • swc-win32-ia32-msvc@14.2.3
  • swc-win32-x64-msvc@14.2.3
  • template@7.22.15
  • trace-mapping@0.3.20
  • traverse@7.23.4
  • tsdoc-config@0.16.2
  • tsdoc@0.14.2
  • type-utils@6.12.0
  • types@5.62.0
  • types@6.12.0
  • types@7.23.4
  • typescript-estree@5.62.0
  • typescript-estree@6.12.0
  • utils@2.4.2
  • utils@5.62.0
  • utils@6.12.0
  • visitor-keys@5.62.0
  • visitor-keys@6.12.0
  • word-wrap@1.2.6
.github/actions/setup/action.yml actions
  • actions/setup-node v4 composite
  • pnpm/action-setup v4 composite
.github/workflows/ci.yml actions
  • ./.github/actions/setup * composite
  • actions/checkout v4 composite
.github/workflows/release.yml actions
  • ./.github/actions/setup * composite
  • actions/checkout v3 composite
  • changesets/action v1 composite
apps/spu-ui/package.json npm
  • @next/eslint-plugin-next ^14.2.3 development
  • @sophys-web/eslint-config workspace:* development
  • @sophys-web/tailwind-config workspace:* development
  • @sophys-web/typescript-config workspace:* development
  • @types/node ^20.11.24 development
  • @types/react ^18.3.3 development
  • @types/react-dom ^18.3.0 development
  • autoprefixer ^10.4.18 development
  • postcss ^8.4.35 development
  • tailwindcss ^3.4.1 development
  • typescript ^5.3.3 development
  • @sophys-web/api workspace:*
  • @sophys-web/auth workspace:*
  • @sophys-web/ui workspace:*
  • @t3-oss/env-nextjs ^0.10.1
  • @tanstack/react-query ^5.49.2
  • @trpc/client 11.0.0-rc.441
  • @trpc/react-query 11.0.0-rc.441
  • @trpc/server 11.0.0-rc.441
  • next ^14.2.3
  • react ^18.3.1
  • react-dom ^18.3.1
  • server-only ^0.0.1
  • superjson 2.2.1
  • zod ^3.23.8
packages/api/package.json npm
  • @sophys-web/eslint-config workspace:* development
  • @sophys-web/typescript-config workspace:* development
  • typescript ^5.3.3 development
  • @sophys-web/auth workspace:*
  • @trpc/server 11.0.0-rc.441
  • superjson 2.2.1
  • zod ^3.23.8
packages/auth/package.json npm
  • @sophys-web/eslint-config workspace:* development
  • @sophys-web/typescript-config workspace:* development
  • @types/react ^18.2.61 development
  • @t3-oss/env-nextjs ^0.10.1
  • next ^14.2.3
  • next-auth 5.0.0-beta.19
  • react ^18.2.0
  • react-dom ^18.2.0
  • zod ^3.23.8
packages/config-prettier/package.json npm
  • @sophys-web/typescript-config workspace:* development
  • @ianvs/prettier-plugin-sort-imports ^4.3.1
  • prettier ^3.2.5
  • prettier-plugin-tailwindcss ^0.5.11