Developing locally
Crusher is integrated system based on javascript environment. We've made it very simple to contribute and fix a bugs
Prerequisites
Make sure you've node > 14
installed. We use monorepo structure and use typescript for static typing.
We also use two data services
Note: Crusher only support linux (ubuntu majorly) and MacOS as of now for development
Set up local environment
1) Clone the repo
$
git clone https://github.com/crusherdev/crusher.git
2) Install packagesEstimated time: 3 mins
$
pnpm install
$
pnpm setup:ee
There are two ways you can initialize your project, depending on which edition you want to work on:
pnpm setup:oss
will initialize the project for OSS editionpnpm setup:ee
will initialize the project for EE edition
3) Configure Environment Variables
$
nano .env
We store environment variables in .env
file. Just configure three values to get started
DB_CONNECTION_STRING=postgresql://user:secret@localhost
DISABLE_POSTGRES_SSL=true
REDIS_CONNECTION_STRING=redis://localhost:6379
See Environment Variables, if you want to know about all the environmental variables available for configuration.
4) Run DB migrations
$
pnpm db:migration
This will bootstrap db from db/schema.sql
or run any pending migrations.
5) Start all the services
$
pm2 start
Go ahead and try to open http://localhost:3000. If you see the login screen and authentication is working fine, you have successfully set up crusher on your system 🚀
To check the status you can use following commands to see status, see logs and kill all services.
$
pm2 status
$
pm2 logs -f service_name
$
pm2 stop
Supported OS
The source code has been built and tested on Ubuntu and macOS. We haven't tested the building source code on other systems, so if you encounter any issues Set up for a different OS, feel free to file an issue for it.
tip
If you don't want to do all the setup chores, you can click on Open in Gitpod
inside README.md and use gitpod for development.