Sparrow Air 2 is a fun pet project focused on building a reactive airline management system using a step by step vibe coding (with manual interventions when it breaks the project or goes too astray). The project aims to leverage reactive programming principles throughout the entire stack while carefully considering database isolation levels to ensure data consistency and integrity. We're just getting started, but the goal is to create a fully reactive application.
You just need:
- Java 21 or higher
- Docker
- Run the program with datademo profile to load the sample data (sample data is also generated by AI ;) )
- view swagger at http://localhost:8080/swagger-ui/index.html & have fun!
If docker is installed, it should just work. The PostgreSQL database, running in Docker, is configured with the following parameters:
- Database Name: mydatabase
- Username: myuser
- Password: secret
- Port: 5432 (mapped from container to host)
First, ensure that the Docker containers are running:
docker psLook for a container running the postgres:latest image.
You can connect to the PostgreSQL container using the following command:
docker exec -it <container_id> bashAlternatively, you can use the container name:
docker exec -it sparrow-air-2-postgres-1 bashOnce you're inside the container, you can log into PostgreSQL using the psql command-line tool:
psql -U myuser -d mydatabaseWhen prompted, enter the password: secret
After logging into PostgreSQL, you can use the following commands to explore the database:
\dtTo view the structure of a specific table:
\d+ table_nameHere are some useful SQL commands to explore the database:
-- Count records in a table
SELECT COUNT(*) FROM table_name;
-- Exit PostgreSQL
\qThese tables are created and managed using Liquibase migrations defined in the application.
The application supports the following Spring profiles:
The datademo profile initializes the database with sample airport data on startup. This is useful for development and testing purposes.
To activate this profile, you can:
-
Set the
spring.profiles.activeproperty in your application.properties file:spring.profiles.active=datademo -
Or pass it as a command-line argument when running the application:
./gradlew bootRun --args='--spring.profiles.active=datademo' -
Or set it as an environment variable:
export SPRING_PROFILES_ACTIVE=datademo ./gradlew bootRun
When this profile is active, the application will automatically populate the database with sample airport data for major international airports.