-
Notifications
You must be signed in to change notification settings - Fork 3
Development
github-actions[bot] edited this page Jun 24, 2025
·
6 revisions
The development environment uses Laravel Sail, a containerized environment with a script and easy-to-use commands for interacting with it.
Copy .env.example to .env:
cp .env.example .envAfter doing so, update the values only as needed. The important ones that will most likely need to be filled in are the ConCat and Telegram items.
- Create a ConCat account on your ConCat instance for OAuth and ensure it has developer authorization.
- Add a new OAuth App at Housekeeping -> Developers -> OAuth Applications -> Create New
- Use
http://localhostfor the callback URL - Select the
registration:readandvolunteer:readapplication permissions
- Use
- Update
CONCAT_CLIENT_SECRETandCONCAT_CLIENT_IDin.env
- Create a bot via @BotFather (
/newbot) - Update
TELEGRAM_BOT_TOKENin.env
- Install the PHP CLI for your environment (ex:
sudo apt install php-cli) - Install Composer
- Run
composer installin the application directory -
(Optional) Add
sailalias withalias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'- It would probably be a good idea to add this to your shell startup script (ex:
~/.bashrc)
- It would probably be a good idea to add this to your shell startup script (ex:
Whenever using a Sail command, if you don't have an alias setup, use sh vendor/bin/sail instead of sail.
- To run the container, use
sail up(Ctrl+C to stop) -
If this is the first time the env has been run:
- Run
sail artisan key:generate(UpdatesAPP_KEYin.env) - Run
sail npm install - Initialize the database schema with
sail artisan migrate -
(Optional) Seed the database with dummy accounts with
sail artisan db:seed
- Run
- To run the Vite server, use
sail npm run dev(Ctrl+C to stop) - Open the project on http://localhost (it may be slow)
- If you see an Apache/nginx/etc. splash screen, ensure you don't already have a web server bound to port 80.
- Using
php artisan tinkerorsail artisan tinkerwill present a PHP REPL with the application bootstrapped, allowing you to mess with any part of the application and see the result of code in real-time. See the Artisan documentation for more information. - The helpers
dump(...)anddd(...)can be extremely helpful for debugging the application. The former pretty-prints a representation of any data passed to it with full HTML formatting, and the latter does the same but also immediately halts further execution of the application. Collections and Carbon instances also have->dump()and->dd()methods. - Use
php artisan make:migrationorsail artisan make:migrationto create a new database migration. See the migrations documentation for more information. - The Laravel documentation and API documentation will be very helpful if you're not already familiar with the framework.
- Running
composer run formatandnpm run formatwill format all PHP and JavaScript code, respectively. - Running
npm run lintwill lint all JavaScript code, checking for common errors and making recommendations.-
npm run lint:fixwill automatically apply fixes for many of these. -
npm run lint:fix-unsafewill correct even more, but these changes should be manually verified.
-
- Clone this repository whereever you will be building/running the Docker containers
- Copy all of the
*.env.examplefiles in.docker/to just*.env(in the same directory)..docker/should haveapp.env,certbot.env,nginx.env,postgres.env, andredis.env. - Modify the
.envfiles in.docker/for your configuration. Specifically, you should ensure the following keys are updated at the very least:-
app.env:
APP_KEY,APP_URL,DB_PASSWORD,REDIS_PASSWORD,CONCAT_CLIENT_ID,CONCAT_CLIENT_SECRET,TELEGRAM_BOT_TOKEN(see details in the development section for the ConCat and Telegram config keys, as well as for generating a key forAPP_KEYthe first time)- For the
APP_KEYvalue, this is the encryption key used for all reversible encryption in the application. This is typically generated by thephp artisan key:generatecommand, but running this requires PHP setup locally, which may not always be desireable. The key itself is a base64-encoded string of 32 bytes of entirely random data when using the AES-256-CBC cipher (default). You can easily generate this yourself
- For the
-
certbot.env:
LETSENCRYPT_DOMAINS,LETSENCRYPT_EMAIL,LETSENCRYPT_DRY_RUN(clear the value for this once confirmed working) -
nginx.env:
NGINX_HOST -
postgres.env:
POSTGRES_PASSWORD(should matchDB_PASSWORDinapp.env) -
redis.env:
REDIS_PASSWORD(should matchREDIS_PASSWORDinapp.env)
-
app.env:
- Run
docker compose -f docker-compose.prod.yml buildto build the necessary (app and nginx) images - Run
docker compose -f docker-compose.prod.yml up -dto run the images in the Docker daemon - Once everything has started up, the application will not yet be functional if it's the first time running.
Follow these steps once the containers are up:
- Run
docker compose -f docker-compose.prod.yml exec app php artisan migrateto run migrations on the database - Wait for output from certbot in
docker compose -f docker-compose.prod.yml logs certbotto confirm that the dry-run succeeded - Clear the value for
LETSENCRYPT_DRY_RUNin certbot.env - Run
docker compose -f docker-compose.prod.yml restart certbot - Log in to Tracker to make sure a user is created for you
- Run
docker compose -f docker-compose.prod.yml exec app php artisan auth:set-roleto set your user's role to admin
- Run