A full-featured SvelteKit application template with database integration, authentication, and modern development tooling.
I developed this project on a linux system, so I cannot guarantee that it will work for other operating systems. All dependencies and installation instructions are linux exclusive. If you want to run this project on a different operating system, you will have to adapt the installation instructions accordingly. Feel free to open an issue on GitHub if you have questions or need help with the installation.
To install this project, go ahead and fork the repository or use it as a template. If you want your fork to be a part of the auto-update pipeline, submit an issue on github with the link to your fork, and I will add it to the list of forks that are updated automatically.
These dependencies are required to run the project. Run these scripts to install them.
/config/postgres.sh your_username your_database_name your_password
/config/redis.sh
npm i -g pnpm
This requires node v22.12.0 or higher. Go ahead and run this script and it will install nvm and the correct version of node for you. If you already have node installed, you can skip this step, but make sure you have the correct version installed.
/config/nvm.sh
To set up the project, copy the .env.example file to .env and fill in the required environment variables.
We use postgres as the database and drizzle-orm as a wrapper around it.
# Do this any time you need to install something
# sudo is basically the system administrator, so you're executing the "apt update" command with admin priviliges
# apt is your software package installer essentially
sudo apt update
# Install 2 dependencies. You don't need the -y, if you don't put it, it'll just ask you for permission to install it.
sudo apt install postgresql postgresql-contrib -y
# Check if the postgresql is running
# "service" is basically all the different running background processes that you have access to
# Your installer, ssh, etc., are all on there
service postgresql status
# You should see a green "active (exited)" now. If not, something went wrong.
# Switch to the postgres user account and enter into postgres's CLI (command line interface)
sudo -u postgres psql
# Create an admin account
# This is good practice because if you don't, you can accidentally cause some pretty significant issues if you're not careful
CREATE ROLE admin WITH NOLOGIN;
# Now create your account
CREATE ROLE keyton WITH LOGIN;
# Add your password
ALTER ROLE keyton WITH PASSWORD "<your password here>";
# Grant admin privileges to your account
GRANT admin TO keyton;
# Create your development databases
CREATE DATABASE tators_dashboard_dev WITH OWNER keyton;
CREATE DATABASE scouting_app_dev WITH OWNER keyton;
# Leave the psl CLI
\q
# Now you need to allow your servers to connect to this locally
cd /etc/postgresql/
ls
# you'll see 1 folder here
cd ./<version>/main/
ls
# edit the postgresql.conf file using nano
sudo nano postgresql.conf
# Scroll to "CONNECTIONS AND AUTHENTICATION"
# Remove the "#" before listen_addresses
ctrl+x # exit
y # do save
enter # same file name
# restart postgres
service postgresql restart
# view its status
service postgresql status
Run the following commands to initialize the database
pnpm db:migrate
pnpm db:push
You can enter the database studio with the following command:
pnpm db:studio
To start the development server, run the following command:
pnpm dev
To start the production server, run the following command:
pnpm build # Generates the production code in /build
pnpm start # Runs the production code
To run all formatting, linting, and test scripts, run the following command:
pnpm system:check
This will run:
pnpm format # Prettier formatting
pnpm lint # ESLint linting
pnpm check # TypeScript type checking
pnpm test:unit # Vitest Unit tests
pnpm test:e2e # Playwright End-to-end tests
This project uses pnpm as the package manager. Key commands include:
sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc | cut -f1)
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl <start|stop|enable|status|restart> docker
# Run specific image
sudo docker run <image>
Contributions are welcome! Please fork the repository and submit a pull request with your changes. Make sure to follow the existing code style and include tests for any new functionality.
All branches must follow this naming convention:
YYYY-MM-DD-<INITIALS>-ShortDescription
All pull requests must be linked to an issue. If there is no issue, create one before submitting the pull request.
Before any branches are merged into main, they must pass all tests and code quality checks.
This software is licensed under the Polyform Noncommercial License 1.0.0. You can use, modify, and share it for non-commercial purposes. Commercial use requires a separate license from the author. View License for full terms and conditions
If you have any questions, feel free to contact me via email at [email protected] or open an issue on GitHub.