Get started
Section briefly describes how to configure, build and start the Intake24 components for development and production deployment.
Repository
Clone the repository
git clone https://github.com/intake24/intake24Repository is set as mono-repository with workspaces using pnpm.
Shared components are in packages folder. Applications are in apps folder.
Install pnpm using corepack (see pnpm docs for further options).
corepack enable
corepack installInstall project dependencies from repository root.
pnpm installSet up .env file for each application you want to build, see below.
cd apps/{app}
cp .env-template .env
nano .envBuild all applications
- run command either from top-level to build all applications (
api,cli,admin,portalandsurvey). - run command from
apps/{app}folder to build specific application
pnpm buildEnvironment variables
Code is using .env environment files. Each project contains a template file (.env-template). If you're setting up fresh project, you can run CLI command, which generates all the files and couple of required specific keys. Follow the CLI instructions and how to run generate-env.
Some of the environment variables are either bundled in or used to configure build of SPA applications. Make sure you set up those .env file before running build for SPAs.
API Server
Navigate to apps/api directory.
cd apps/apiCopy template of configuration file and edit it as required. Please see Configuration section for detailed description of configuration options.
cp .env-template .envDevelopment
Serve the application locally in development mode with hot-reload
pnpm devProduction
Build the application
pnpm buildStart the application
pnpm startFor production, consider
Deployment section / ansible scripts provide examples how to use dedicated service on Ubuntu and run it behind Nginx reverse proxy.
Database
- project is using sequelize-cli
- database layer is located in
packages/db - config / migration files (per database) are store in respective
packages/db/sequelize/{database}folders
Set up .env file if running independently of API server so it can load connection details
cp .env-template .envMigrations can be executed from root-level or package level with following commands
# both databases
pnpm db:migrate
# or each database
# foods
pnpm db:migrate:foods
# system
pnpm db:migrate:systemAdmin / Survey apps
Both applications are built as SPAs using vite and vue - build toolchain pipeline is same for both.
Navigate to apps/admin or apps/survey directory depending on which application you want to build.
cd apps/{admin|survey}Copy template of configuration file and edit it as required. Please see Configuration section for detailed description of configuration options.
cp .env-template .envDevelopment
Serve the application locally in development mode with hot-reload
pnpm devProduction
Build the application
pnpm buildStart the application
pnpm startTIP
This should only be used if you host the client on separate domain. It will start separate http server to serve the application.
Documentation
Documentation is built with vitepress.
Serve the application locally in development mode with hot-reload
pnpm docs:devTIP
Documentation is automatically built and deployed to github pages whenever source code is updated.