This project is for a special usage on my own, more for fun. My first Elixir+Phoenix project.
Use optimized test scripts for development:
./run_tests.sh # New optimized script with flexible options
./run_tests_fast.sh # Fast script for basic test runsThese scripts use Docker volume mounting for instant test execution (2.5 seconds vs 30+ seconds for rebuilds) and ensure proper MIX_ENV=test environment.
# Run specific test files
docker-compose exec app mix test test/specific_file.exs
# Run tests with volume mounting (no rebuild needed)
docker-compose exec -e MIX_ENV=test app mix test
# Interactive development
docker-compose exec app iex -S mix- Start containers:
docker-compose up -d - Run tests:
./run_tests.shor./run_tests_fast.sh - Make code changes (reflected immediately)
- Run tests again:
./run_tests.sh [specific_test_file]
apt-get install build-essential
asdf plugin-add elixir
asdf install elixir 1.10.4
asdf plugin-add erlang
asdf install erlang 22.3.4.20
apt-get install mysql-server
CREATE USER 'hzhou'@'localhost'IDENTIFIED WITH mysql_native_password BY '';
GRANT ALL PRIVILEGES ON * . * TO 'hzhou'@'localhost';
MIX_ENV=prod mix ecto.create
MIX_ENV=prod mix ecto.reset
Efl.RefCategory.seeds
# Start server in background
./server_manager.sh start
# Stop server
./server_manager.sh stop
# Restart server
./server_manager.sh restart
# Check server status
./server_manager.sh status
# View server logs
./server_manager.sh logs# Trigger data fetching process (scrapes website and updates database)
wget http://localhost:4000/dadi/scratch > /dev/null 2>&1# Test email functionality
MIX_ENV=prod mix run test_email_simple.exs
# Test with full Excel generation
MIX_ENV=prod mix run test_prod_email.exs# Run all tests
./run_tests_fast.sh
# Run specific test
MIX_ENV=prod mix test test/specific_file.exs