Skip to content

ut-code/uplace

Repository files navigation

MAYFEST/UPLACE

how to setup

npm run setup

how to run

npm start

alternatively you can also:

npm run frontend:dev # or just npx vite

and

npm run backend:dev

in two separate process

Docker

because prisma won't work on NixOS, I created docker files s.t. it works on any machine (even on Windows, if set up properly). to run docker, just run

docker compose build --no-cache
docker compose up

. service will be available on localhost:3200.

run docker exec -it (docker name - use docker ps to check) sh to enter interactive shell within the docker container.

example: docker exec -it uplace-uplace-1 sh

Before commit / making PR

run npm test and make sure that it's running

Releasing

releasing will be automatically done after updating branch release. make sure main is working before merging to release.

Generated files

do NOT touch files inside these 3 directories. they will be overwritten. ./node_modules/ ./tsc-dist/ ./vite-dist/

how it runs

during build process,

  • backend ts files will be transpiled to js files and will be put in ./tsc-dist/
  • (if release mode, ) frontend JSX will be transpiled to pure JS and will be put in ./vite-dist/

and to provide,

  • (dev mode) Node.js runs ./tsc-dist/main.js and Vite directly runs frontend directory. there is duplicate static server in ./tsc-dist/main.js that also serves frontend files, but it's ok because it's dev mode anyways
  • (release mode) Node.js runs ./tsc-dist/main.js. this also statically serves files in ./vite-dist/

TODO

  • write .env.production for prod env
  • fix vite build not working

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

  • Configure the top-level parserOptions property like this:
export default {
  // other rules...
  parserOptions: {
    ecmaVersion: "latest",
    sourceType: "module",
    project: ["./tsconfig.json", "./tsconfig.node.json"],
    tsconfigRootDir: __dirname,
  },
};
  • Replace plugin:@typescript-eslint/recommended to plugin:@typescript-eslint/recommended-type-checked or plugin:@typescript-eslint/strict-type-checked
  • Optionally add plugin:@typescript-eslint/stylistic-type-checked
  • Install eslint-plugin-react and add plugin:react/recommended & plugin:react/jsx-runtime to the extends list