|
|
|
|
|
|
This repository contains a full-stack task management platform application.
Ensure you have the following installed on your machine:
mkdir svelte-go-task-app
git clone https://github.com/konnikamii/svelte-go-task-app.git .
cd backend && cp .env.example .env
cd ../frontend && cp .env.example .env
cd ..
cd backend
cp .env.example .env
go mod download
goose up
sqlc generate
air
If you do not use air, run:
go run ./cmd/api
cd frontend
cp .env.example .env
pnpm install
pnpm dev
pnpm build
cd ..
docker compose up --build
By default:
Try creating an account and logging in. Then create tasks and test protected routes.
Mailhog: Mailhog is included in the Docker setup to catch outgoing emails.
Database:
PostgreSQL is included in Docker setup and initialized using migration scripts under backend/internal/adapters/postgresql/migrations/.
Auth:
Session cookies are HTTP-only and tied to entries in the user_sessions table.
If you run into startup issues, verify .env values for:
SESSION_SECRET in backend environment.You need the following:
PostgreSQL:
Install PostgreSQL, create a database, and update GOOSE_DBSTRING in backend/.env.
5432Mailhog (optional): Install and configure Mailhog to run on the following ports (or use Docker):
10258025If Mailhog is not configured, the contact notification attempt will fail gracefully and not crash the app.
Backend:
cd backend
go test ./...
Frontend checks:
cd frontend
pnpm check
pnpm test
If checks fail, verify your local environment variables and service connectivity first.
To connect analytics, update frontend/.env:
PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
PUBLIC_SIMPLE_ANALYTICS_DOMAIN=example.com
PUBLIC_SIMPLE_ANALYTICS_SCRIPT_URL=https://scripts.simpleanalyticscdn.com/latest.js
Analytics scripts are loaded only after user consent via the cookie consent banner.
Windows:
pg_ctl.exe register -N "PostgreSQL" -U "NT AUTHORITY\NetworkService" -D "C:\Program Files\PostgreSQL\[version]\data" -w
# creates a service to start on boot
pg_ctl status -D "C:\Program Files\PostgreSQL\[version]\data" # checks PostgreSQL process status
pg_ctl restart -D "C:\Program Files\PostgreSQL\[version]\data" # restart PostgreSQL process
psql -p <port> -d <database-name> -U <user> # login as user in postgres database
\l+ # size of DBs
\du # show all users
SELECT * FROM pg_user; # show all users
CREATE DATABASE <database-name> TEMPLATE template0; # create DB from clean template
DROP DATABASE IF EXISTS <database-name>; # remove DB
Linux:
pg_ctl status -D /var/lib/postgresql/[version]/main # checks PostgreSQL process status
pg_ctl restart -D /var/lib/postgresql/[version]/main # restart PostgreSQL process
pg_ctl start -D /var/lib/postgresql/[version]/main # start PostgreSQL process
pg_ctl stop -D /var/lib/postgresql/[version]/main # stop PostgreSQL process
docker compose up # builds images and starts containers
docker compose down # removes containers
docker compose config # troubleshoot compose setup
docker compose up --build # force image rebuilds
docker compose --project-name "my-app" up # set project name
docker compose -p "my-app" up # shorthand for project name
docker compose -f <filename.yaml> up # run a specific compose file
docker ps # list running containers
docker logs <container_name_or_id> # check container logs
docker stats # live container resource utilization
docker exec -it <container_name_or_id> /bin/sh # enter container using sh
docker exec -it <container_name_or_id> bash # enter container using bash (if installed)