Get started
This section briefly describes how to configure, build and start the Intake24 components.
Repository
Clone the repository
git clone https://github.com/MRC-Epid-it24/intake24
Repository is set as mono-repository with workspaces.
Shared components are in packages
folder. Applications are in apps
folder.
Install pnpm
using corepack (see pnpm docs for further options).
corepack enable
corepack install
Install project dependencies
pnpm install
Set up .env
file for each application you want to build, see below.
cd apps/{app}
cp .env-template .env
nano .env
Build all applications
- run command either from top-level to build all applications (
api
,cli
,admin
,portal
andsurvey
). - run command from
apps/{app}
folder to build specific application
pnpm build
Environment 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/api
Copy template of configuration file and edit it as required. Please see Configuration section for detailed description of configuration options.
cp .env-template .env
Build the application
pnpm build
Start the application
pnpm start
For 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 .env
Migrations 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:system
Admin client
Navigate to apps/admin
directory.
cd apps/admin
Copy template of configuration file and edit it as required. Please see Configuration section for detailed description of configuration options.
cp .env-template .env
Build the application
pnpm build
Start the application
pnpm start
TIP
This should only be used if you host the client on separate domain. It will start separate http server to serve the application.
Serve the application locally in development mode with hot-reload
pnpm dev
Survey client
Navigate to apps/survey
directory.
cd apps/survey
Copy template of configuration file and edit it as required. Please see Configuration section for detailed description of configuration options.
cp .env-template .env
Build the application
pnpm build
Start the application
pnpm start
TIP
This should only be used if you host the client on separate domain. It will start separate http server to serve the application.
Serve the application locally in development mode with hot-reload
pnpm dev
Documentation
Documentation is built with vitepress.
Serve the application locally in development mode with hot-reload
pnpm docs:dev
TIP
Documentation is automatically built and deployed to github pages whenever source code is updated.