A modern fullstack web application built with React, Node.js, TypeScript, and containerized with Docker.
- Frontend: React 19 with Vite, TypeScript, and Tailwind CSS
- Backend: Node.js with Express, TypeScript, and RESTful API
- Database: PostgreSQL with connection pooling
- Caching: Redis for session management and caching
- Authentication: JWT-based authentication system
- Testing: Comprehensive test suites with Jest and Vitest
- CI/CD: GitHub Actions for automated testing and deployment
- Docker: Full containerization with multi-stage builds
- Code Quality: ESLint, Prettier, and Husky pre-commit hooks
- Node.js 20+ and npm
- Docker and Docker Compose
- Git
-
Clone the repository
git clone <repository-url> cd fullstack-app
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env cp backend/.env.example backend/.env cp frontend/.env.example frontend/.env
-
Start development servers
npm run dev
This starts both frontend (http://localhost:3000) and backend (http://localhost:5000).
-
Start with Docker Compose
docker-compose up
This starts all services including PostgreSQL and Redis.
fullstack-app/
βββ backend/ # Node.js/Express API
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ middleware/ # Express middleware
β β βββ routes/ # API routes
β β βββ services/ # Business logic
β β βββ utils/ # Utility functions
β β βββ index.ts # Application entry point
β βββ Dockerfile
β βββ package.json
βββ frontend/ # React application
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom hooks
β β βββ services/ # API services
β β βββ store/ # State management
β β βββ utils/ # Utility functions
β βββ Dockerfile
β βββ package.json
βββ .github/ # GitHub Actions workflows
βββ docker/ # Docker configuration
βββ scripts/ # Utility scripts
βββ docker-compose.yml
# Install dependencies for all projects
npm install
# Start development servers
npm run dev
# Run tests
npm test
# Run linting
npm run lint
# Format code
npm run format
# Build for production
npm run build
# Type checking
npm run typecheckNODE_ENV=development
PORT=5000
JWT_SECRET=your-super-secret-jwt-key
DATABASE_URL=postgresql://user:password@localhost:5432/fullstack_db
REDIS_URL=redis://localhost:6379VITE_API_URL=http://localhost:5000/api# Build both frontend and backend
npm run build
# Build Docker images
docker-compose -f docker-compose.prod.yml build
# Deploy to production
docker-compose -f docker-compose.prod.yml up -dThe project includes GitHub Actions workflows for:
- Continuous Integration: Automated testing, linting, and building
- Security Scanning: CodeQL analysis and dependency vulnerability checks
- Docker Builds: Automated Docker image building and pushing
- Deployment: Automated deployment to staging and production
Required GitHub Secrets:
DATABASE_URL: Production database URLJWT_SECRET: JWT signing secret (automatically generated)
Docker images are automatically built and pushed to GitHub Container Registry (ghcr.io) - no external registry credentials needed!
# Run all tests
npm test
# Run backend tests
npm run test:backend
# Run frontend tests
npm run test:frontend
# Run tests with coverage
npm run test:coveragePOST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/users/profile- Get user profile (authenticated)PUT /api/users/profile- Update user profile (authenticated)
GET /health- Application health status
CREATE DATABASE fullstack_db;
CREATE USER user WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE fullstack_db TO user;Redis is used for session storage and caching. No additional setup required.
- JWT authentication with secure token handling
- Password hashing with bcrypt
- CORS configuration
- Security headers with Helmet.js
- Input validation with express-validator
- Dependency vulnerability scanning
- Container security scanning
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for type safety
- Follow ESLint and Prettier configurations
- Write tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Port conflicts: Change ports in environment variables
- Database connection: Check PostgreSQL is running and credentials are correct
- Docker issues: Ensure Docker Desktop is running
- Dependencies: Clear node_modules and reinstall
For issues and questions:
- Create an issue on GitHub
- Check existing documentation
- Review logs for error details
- Add database migrations
- Implement real-time features with WebSocket
- Add comprehensive logging
- Implement rate limiting
- Add API documentation with Swagger
- Set up monitoring and alerting