A full-stack survey management application built with NestJS backend, React frontend, PostgreSQL database, and Redis for caching. The application allows users to create surveys, manage questionnaires, handle population data, and analyze survey responses.
Before running the application, ensure you have the following installed:
- Docker Desktop - Download here
- Git - Download here
-
Clone the repository
git clone https://github.com/Shatwik7/survify cd survify
-
Create environment file
# Create a .env file in the root directory touch .env
-
Configure environment variables Add the following variables to your
.env
file:# Database Configuration not nessassary when running using docker compose POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=mydatabase POSTGRES_HOST=postgres POSTGRES_PORT=5432 # Redis Configuration not nessassary when running using docker compose REDIS_HOST=redis REDIS_PORT=6379 # JWT Configuration JWT_SECRET=your-super-secret-jwt-key JWT_EXPIRES_IN=24h # Application Configuration NODE_ENV=production PORT=3000 # OPEN AI KEYS AZURE_OPENAI_API_KEY= AZURE_OPENAI_ENDPOINT= AZURE_OPENAI_API_VERSION=2024-05-01-preview AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o # AWS KEYS not nessassary when running locally just set STORAGE_DRIVER="local" STORAGE_DRIVER="s3" || "local" AWS_REGION= AWS_ACCESS_KEY= AWS_SECRET_KEY= AWS_BUCKET_NAME= # GAMIL USER FOR SENDING EMAILS not nessassary when running locally GMAIL_USER= GMAIL_PASSWORD= or GMAIL_APP_PASSWORD=
-
Start the application
docker-compose up -d
-
Wait for services to start The application will take a few minutes to build and start all services. You can monitor the progress with:
docker-compose logs -f
Once all services are running, you can access the application at:
- Frontend: http://localhost:80 or http://localhost:8080
- Backend API: http://localhost:3000
- Database: localhost:5432 (PostgreSQL)
- Redis: localhost:6379
The application uses environment variables for configuration. Key variables include:
POSTGRES_*
: Database connection settingsREDIS_*
: Redis connection settingsJWT_*
: JWT authentication settingsNODE_ENV
: Application environmentPORT
: Application port
The PostgreSQL database is automatically initialized with the following default credentials:
- Username: postgres
- Password: postgres
- Database: mydatabase
SET THE ENV STORAGE_DRIVER TO "local" when running on local dev envirnment and to "s3" when running multiple instance. The application supports file uploads with a maximum size of 2GB. Uploaded files are stored in the configured upload directory.
-
Port conflicts
# Check if ports are in use netstat -an | findstr :80 netstat -an | findstr :3000 netstat -an | findstr :5432
-
Docker not running
- Ensure Docker Desktop is started
- Check Docker service status
-
Build failures
# Clean and rebuild docker-compose down docker system prune -f docker-compose up --build
-
Database connection issues
# Check database logs docker-compose logs postgres # Restart database docker-compose restart postgres
- API Documentation: Available at
server/API_Documentation.md