Install ShelfSpot at home
This guide provides step-by-step instructions for installing ShelfSpot using two different methods: Classic Installation (minimal setup) and Complete Installation (full stack with database).
Prerequisites
Before starting, make sure you have the following:
- Docker Engine (version 20.10 or higher)
- Docker Compose (v1.29 or higher, or Docker Compose v2)
- Git (to clone the repository)
- Linux/macOS/Windows with Docker support
- At least 2 GB of RAM and 5 GB of disk space
Installing Docker
If Docker is not installed:
- Linux: Follow the official Docker installation guide
- macOS: Download Docker Desktop for Mac
- Windows: Download Docker Desktop for Windows
Verify your installation:
docker --versiondocker-compose --versionInstallation methods
Choose the method that best suits your needs:
Method 1: Classic Installation (Recommended for development)
Classic installation offers minimal setup that builds and runs the ShelfSpot application without an integrated database. This method is ideal for:
- Development and testing
- Quick demos
- If you already have a database server
Steps:
-
Navigate to the classic installation folder:
Terminal window cd install/classic_install -
Make the build script executable:
Terminal window chmod +x build.sh -
Run the build script:
Terminal window ./build.shThis script will:
- Build Docker images for frontend and backend
- Verify images are created successfully
-
Configure environment variables: Make sure you have a
.envfile in thebackendfolder with your database configuration:Terminal window # Example .env fileDATABASE_URL="mysql://user:password@host:3306/shelfspot"JWT_SECRET="your-secret-key" -
Start services:
Terminal window docker-compose up -d -
Verify installation:
Terminal window docker-compose psCheck that services are running:
- Backend: Available at
http://localhost:3001 - Frontend: Available at
http://localhost:3000
- Backend: Available at
-
Check logs (if needed):
Terminal window docker-compose logs -f
Included services:
- Backend API (NestJS) on port 3001
- Frontend (Next.js) on port 3000
Method 2: Complete Installation (Production-ready)
Complete installation offers full-stack deployment including MariaDB database and all necessary services. This method is ideal for:
- Production deployments
- Complete test environment
- If you want everything preconfigured
Steps:
-
Navigate to the complete installation folder:
Terminal window cd install/complete_install -
Make the build script executable:
Terminal window chmod +x build.sh -
Run the build script:
Terminal window ./build.shThis script prepares all components necessary for complete deployment.
-
Configure environment variables (optional): Create a
.envfile to override default settings:Terminal window # Optional .env file for complete installationDB_ROOT_PASSWORD=root-passwordDB_NAME=shelfspotDB_USER=shelfspot_userDB_PASSWORD=user-passwordDB_PORT=3306 -
Start the complete stack:
Terminal window docker-compose -f docker-compose.full.yml up -d -
Wait for database initialization: The database needs time to initialize. Monitor the process:
Terminal window docker-compose -f docker-compose.full.yml logs -f databaseWait to see “ready for connections” in the logs.
-
Run database migrations (if needed):
Terminal window docker-compose -f docker-compose.full.yml exec backend npm run prisma:migrate:deploy -
Verify installation:
Terminal window docker-compose -f docker-compose.full.yml psAll services should be healthy:
- Database (MariaDB) on port 3306
- Backend API on port 3001
- Frontend on port 3000
Included services:
- MariaDB Database on port 3306
- Backend API (NestJS) on port 3001
- Frontend (Next.js) on port 3000
- Database initialization scripts (in
database/init/)
After installation
Accessing the application
Once installation is complete, you can access:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- API Documentation: http://localhost:3001/api (Swagger)
Default credentials
If using complete installation with default settings:
- Database:
- Host: localhost:3306
- Database: shelfspot
- User: shelfspot_user
- Password: ShelfSpot2024!
Checking service status
Both installation methods include verifications:
# Check all servicesdocker-compose ps
# Check logs for a specific servicedocker-compose logs backenddocker-compose logs frontend
# For complete installationdocker-compose -f docker-compose.full.yml logs databaseTroubleshooting
Common issues
-
Port conflicts:
Terminal window # Check what's using portssudo netstat -tulpn | grep :3000sudo netstat -tulpn | grep :3001sudo netstat -tulpn | grep :3306 -
Docker permission issues:
Terminal window # Add user to docker groupsudo usermod -aG docker $USER# Then log out and log back in -
Database connection issues:
- Check that the database container is healthy
- Check environment variables in
.envfiles - Check network connectivity between containers
-
Build failures:
Terminal window # Clean Docker cache and rebuilddocker system prune -adocker-compose down -v# Then run the build script again
Getting help
In case of issues:
- Check logs:
docker-compose logs <service-name> - Verify all containers are running:
docker-compose ps - Check documentation in
documentation/folder - Check specific READMEs in
backend/andfrontend/
Stopping and cleanup
Stopping services:
# Classic installationdocker-compose down
# Complete installationdocker-compose -f docker-compose.full.yml downComplete cleanup (removes data):
# Remove containers, networks, and volumesdocker-compose down -v
# For complete installationdocker-compose -f docker-compose.full.yml down -vDevelopment notes
- For development, classic installation is recommended as it’s faster to start/stop
- Use complete installation to test database-specific features
- Both methods support hot-reloading during development
- Environment variables can be customized in respective
.envfiles
For more information, check the documentation on the project homepage.