The master
branch is protected. This means that you cannot directly push to the master
branch. Instead, use the box above to create a new branch (for example: fix-registration-form
). Once you have submitted your code to the branch, and your feature/fix is complete, sumbit a PR. GitHub will show you if you need to change anything before you merge.
Code documentation is available at https://nvibe.github.io/Envibe.
For minimal issues, try to get your dev environment as close as possible to this list
- Ubuntu 18.04 Bionic (64-bit)
- OpenJDK Java 1.8.0 build 251
- Maven 3
- Redis 5.0.8
Project may crash without these defined
JDBC_DATABASE_URL
Defines the PostgreSQL username, password, URI, and database to use.REDIS_URL
Defines the Redis username, password, URI, and database to use.
By default, the following users are created for testing purposes.
Username | Password | Internal Role | |
---|---|---|---|
admin | [email protected] | envibe | ROLE_ADMIN |
listener | [email protected] | envibe | ROLE_USER |
artist | [email protected] | envibe | ROLE_USER |
As of right now, the friends functionality is missing from the codebase. Anytime you create a post, only the listener
account will be able to see it. (Essentially, listener
is a permanent follower of the other two accounts).
mvnw spring-boot:run
Runs server locally.mvnw clean package
Builds JAR file, rarely needed.mvnw flyway:migrate
Updates the schema of your local PostgreSQL database (done automatically on bootup).mvnw test
Runs unit test suite (Requires JUnit).mvn javadoc:javadoc
Compiles HTML documentation site under./target/site/apidocs
.
Instead of messing around with PostgreSQL, you can run an in-memory database for testing purposes.
- Within your IDE, set the environment variable
JDBC_DATABASE_URL
tojdbc:h2:mem:test_db
. - Every time you start the webapp, it will create a temporary database in memory that your application will use. The database will be deleted every time you close the webapp.
This application requires Redis for cross-thread communication. You can install it in one of three ways.
- Install the Windows Subsystem for Linux (WSL) (Windows 10 version 2004 only).
- Install a non-supported build of Redis for Windows.
- In a Linux VM.
If you chose option 1 or 3, you will need to run sudo apt install redis-server -y
before you continue.
- Turn protected mode off by running
sudo nano /etc/redis/redis.conf
- Start the Redis service with
sudo service redis-server start
- In your IDE, set the environment variable
REDIS_URL
toredis://127.0.0.1:6379
When you are done, and don't want Redis running in the background, stop it with sudo service redis-server stop
This project uses Flyway to manage database schemas. To change how the database is set up, create a migration.
- Go to
/src/main/resources/db/migration
- Create a SQL file with the format
VX__Useful_Name_Here.sql
. Note that the filename MUST start with a capitalV
, followed by a number higher than any of the other files in the/migration
folder(e.g. V1, V2, V3...). AfterVX
, there should be TWO underscores(__
). - Insert your SQL code into the file you just created.
- Ensure that the environment variable
JDBC_DATABASE_URL
is defined and is a valid JDBC URI to a running instance of PostgreSQL. - From the project root, run
./mvnw flyway:migrate
. The database schema will be updated automatically.