Skip to content

lNaymonl/slagg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Slagg

An internal Slack clone.

Install

To install all dependencies just execute

$ npm install
# or
$ npm i

in the <rootDir>/app/ directory.

Change the database schema

To change the database schema you have to edit, or add, the *.ts files at <rootDir>/app/database/src/schema/.
When you finished implementing the changes, open a terminal under <rootDir>/app/database/ and run:

$ npm run generate

This will create every needed file to alter the database scheme.
To apply the migration just start the Server.

WARNING: Please try to avoid using the manual option! It could break the database and lead to unexpected behaviour

You can also run the migration process manually by running:

$ npx drizzle-kit migrate

Run the app in dev mode

Open two terminals and navigate to the <rootDir>/app/ directory:

$ cd ./app

To start the Server execute the following in the first terminal:

$ npm run dev:server

A new directory is created under <rootDir>/app/dist/.


To start the Client execute the following in the second terminal:

$ npm run dev:client

Build the app for production:

Open a terminal, then execute:

$ cd <rootDir>/app
$ npm run build

This first removes the directory under <rootDir>/app/dist/ if it exists. Then it creates it again and builds the Server into it. After the Server has finished building, the Client is built and copied to <rootDir>/app/dist/client/.


The build command in the app directory consists of three individual commands:

$ rimraf ./dist

The UNIX command rm -rf for node in a cross-platform implementation.

$ node ./esbuild.mjs --prod

Builds the Server using a custom esbuild script in production mode.

$ npm run -w client build -s

Runs the build command in the Client-Workspace under <rootDir>/app/client

-w client: Selects the workspace, in this case client
build: The actual command to run in the workspace
-s: Run the command in silent mode, which means that any output, but errors, are suppressed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •