SecureCam Final Year Project
This repository contains the current SecureCam prototype:
Backend/- Bun + Express API, Better Auth, Socket.IO, Drizzle ORM, MinIO integrationWebApp/- SvelteKit browser dashboard for camera and client flowsdocker-compose.yml- local development stack for Postgres, MinIO, TURN, backend, and web app
The easiest way to run the project is with Docker Compose. Manual setup instructions are included below if you want to run the backend and web app directly on your machine.
Quick Start
Prerequisites
- Docker
- Docker Compose
Start the full local stack
From the repository root:
docker compose up --build
This starts:
- Postgres
- MinIO
- coturn
- Backend on
http://localhost:3000 - Web app on
http://localhost:5173
Open the app
- Web app:
http://localhost:5173 - Backend API:
http://localhost:3000 - Swagger docs:
http://localhost:3000/docs - OpenAPI JSON:
http://localhost:3000/openapi.json - Admin dashboard:
http://localhost:3000/admin - MinIO console:
http://localhost:9001
Default admin dashboard credentials:
- Username:
admin - Password:
strong-password
Default MinIO credentials:
- Username:
minioadmin - Password:
minioadmin
Stop the stack
docker compose down
To remove volumes as well:
docker compose down -v
Manual Development Setup
Use this path if you want to run the backend and web app outside Docker.
Prerequisites
- Bun for the backend
- Node.js + npm for the web app
- A running Postgres instance
- A running MinIO-compatible object store
- Optional: coturn if you want the local TURN configuration to work as-is
1. Configure the backend
cd Backend
cp .env.example .env
Set the values in Backend/.env for your environment, especially:
DATABASE_URLBETTER_AUTH_SECRETBETTER_AUTH_BASE_URLBETTER_AUTH_TRUSTED_ORIGINSMINIO_ENDPOINTMINIO_PORTMINIO_USE_SSLMINIO_ACCESS_KEYMINIO_SECRET_KEYMINIO_BUCKET
If your backend connects to MinIO on an internal hostname but the browser must upload to a different public hostname, also set:
MINIO_PUBLIC_ORIGIN
Example:
BETTER_AUTH_BASE_URL=http://localhost:3000
BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:5173
MINIO_ENDPOINT=localhost
MINIO_PORT=9000
MINIO_USE_SSL=false
2. Install backend dependencies
cd Backend
bun install
3. Run backend migrations
cd Backend
bun run db:migrate
4. Start the backend
cd Backend
bun run dev
The backend will be available at http://localhost:3000.
5. Install web app dependencies
cd WebApp
npm install
6. Start the web app
cd WebApp
npm run dev
The web app will be available at http://localhost:5173.
Useful Commands
Docker
docker compose up --build
docker compose logs -f backend webapp
docker compose down
Backend
cd Backend
bun run dev
bun test
bun run db:migrate
bun run db:studio
Web app
cd WebApp
npm run dev
npm run build
npm run check
npm run test
First-Time Usage
Once the app is running:
- Open
http://localhost:5173 - Create an account or sign in
- Register the browser as either a
cameraorclientdevice - Open a second browser window or profile if you want to simulate both roles locally
The web app is the primary interface now. The old static simulator pages and mobile scaffold have been removed from the repo.
Troubleshooting
Browser upload fails with a MinIO URL that looks unreachable
If uploads point to an internal hostname such as http://minio:9000, set MINIO_PUBLIC_ORIGIN in the backend env to a browser-reachable MinIO host and restart the backend.
Backend starts but MinIO checks fail
Make sure:
- the MinIO server is running
- the bucket credentials are correct
- the backend can reach the configured MinIO host
- TLS settings such as
MINIO_CA_CERT_PATHorMINIO_INSECURE_SKIP_TLS_VERIFYmatch your environment
TURN issues on other devices
The default compose setup uses 127.0.0.1 in coturn-related configuration. If camera and client browsers are on different devices, replace those localhost TURN references with the host machine's LAN IP.
More Detail
- Backend setup, env, and API details: Backend/README.md
- Web app source: WebApp/