This is a semester-long project for the CSE 3330, Database and File Systems, class at UTA. The goal of this project is to create a simple social media site from a set of requirements, letting us learn how to setup and interact with databases.
As usual, this is not meant to be used for anything serious.
- Gradle is the build system
- PostgreSQL is the backing RDBMS
- Spring MVC is the web server running the site
- Pebble Templates is a templating engine used for the pages
- Install PostgreSQL 10.5 on your machine.
- See here for general instructions
- Ubuntu:
$ sudo apt install postgresql postgresql-contrib
- Create a new PostgreSQL database called "SocialMedia"
- Log into the postgres user
$ sudo -i -u postgres
- Create the database
$ createdb SocialMedia
- Log into the database
$ psql SocialMedia
- You can exit the
SocialMedia=#
prompt at any time withEOF
(i.e.^D
/ctrl+d
on unix systems)
- Log into the postgres user
- Create the
application
user- Log into the postgres account
$ sudo -i -u postgres
- Create the user "application"
$ createuser createuser application --pwprompt
- When prompted for the password, enter "password1" for extra security
- Log into the postgres account
- Run
src/main/resources/db/up.sql
on the SocialMedia db$ psql SocialMedia -f "$pathToThisProject/src/main/resources/db/up.sql"
- This will create the db schema and add starting data to the db
- This can be undone with the corresponding
down.sql
file
- Import the Gradle project with IntelliJ
- Add a new run configuration for running the application
- Create a new gradle configuration
- Name is something like "bootRun"
- Select the current project directory as the gradle project
- Type "bootRun" as the gradle task
- Save It
- Run it and go to
localhost:8080
in the web browser to see the application