A full-featured software house website built with Node.js, Express, EJS, and MySQL.
- Beautiful, modern design with custom brand colors
- OAuth authentication (Google, GitHub)
- Role-based access control (Client, Team Member, Admin)
- Fully responsive design
- MySQL database with comprehensive schema
- Contact form with inquiry management
- Team member profiles with detailed information
- Service pages with detailed information
- Client and Admin dashboards
- Blog system with markdown support
- Project management and portfolio
- Poll system for user engagement
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- MySQL (v5.7 or higher)
- npm or yarn package manager
git clone <repository-url>
cd "Backpack Website"npm installCopy .env.example to .env:
cp .env.example .envEdit .env and fill in your credentials. See the Environment Variables section below for details.
The application will automatically create the database and tables on first run. Make sure your MySQL server is running and the credentials in .env are correct.
Alternatively, you can manually create the database:
mysql -u your_username -p < seed.sql- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Navigate to "Credentials" and create OAuth 2.0 Client ID
- Configure the consent screen
- Add authorized redirect URI:
http://localhost:3000/auth/google/callback - Copy the Client ID and Client Secret to your
.envfile
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in the application details:
- Application name: Your app name
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/auth/github/callback
- Click "Register application"
- Copy the Client ID and Client Secret to your
.envfile
Note: OAuth providers are optional. The application will work without them, but OAuth login features will be disabled.
Development mode with auto-restart using nodemon:
npm run devnpm startThe application will be available at http://localhost:3000 (or the port specified in your .env file).
The following environment variables can be configured in your .env file:
PORT- Server port number (default: 3000)NODE_ENV- Environment mode:developmentorproduction(default: development)SESSION_SECRET- Secret key for session encryption (required, change in production)
DB_HOST- MySQL host address (default: localhost)DB_USER- MySQL username (default: root)DB_PASSWORD- MySQL password (default: empty)DB_NAME- Database name (default: backpack_tech_works)
GOOGLE_CLIENT_ID- Google OAuth Client IDGOOGLE_CLIENT_SECRET- Google OAuth Client SecretGOOGLE_CALLBACK_URL- Google OAuth callback URL (e.g.,http://localhost:3000/auth/google/callback)
GITHUB_CLIENT_ID- GitHub OAuth Client IDGITHUB_CLIENT_SECRET- GitHub OAuth Client SecretGITHUB_CALLBACK_URL- GitHub OAuth callback URL (e.g.,http://localhost:3000/auth/github/callback)
SEED_DB- Set totrueto automatically seed the database with demo data,falseto skip (default: prompts on first run)
backpack-tech-works/
├── config/
│ ├── database.js # MySQL connection and table creation
│ └── passport.js # OAuth authentication strategies
├── middleware/
│ └── auth.js # Authentication middleware
├── public/
│ ├── avatars/ # User avatar images
│ ├── css/ # Stylesheets
│ ├── images/ # Static images
│ ├── logos/ # Brand logos
│ └── profiles/ # Profile images
├── routes/
│ ├── index.js # Home, about, contact routes
│ ├── auth.js # Client authentication routes
│ ├── staff-auth.js # Staff authentication routes
│ ├── services.js # Service pages routes
│ ├── team.js # Team pages routes
│ ├── client.js # Client dashboard routes
│ └── admin.js # Admin dashboard routes
├── services/
│ └── teamProfileService.js # Team profile business logic
├── utils/
│ ├── markdown.js # Markdown processing utilities
│ ├── seeder.js # Database seeding utilities
│ ├── servicesCache.js # Services caching
│ └── upload.js # File upload handling
├── views/
│ ├── partials/ # Reusable EJS partials (header, footer, sidebars)
│ ├── admin/ # Admin dashboard views
│ ├── auth/ # Authentication views
│ ├── blogs/ # Blog views
│ ├── client/ # Client dashboard views
│ ├── team/ # Team member views
│ └── *.ejs # Other page views
├── .env.example # Environment variables template
├── server.js # Main application entry point
├── seed.sql # Database seed data
└── package.json # Project dependencies
To create an admin user, you can either:
- Update an existing user's role in the database:
UPDATE users SET role = 'admin' WHERE email = 'your-email@example.com';- Use the admin dashboard (if you already have admin access) to promote users
The application uses the following color scheme:
- Red:
#C51D34 - Dark Gray:
#2E2E30 - Gray:
#808080 - Light Gray:
#F5F5F5 - Cream White:
#FDFBF7
- Backend: Node.js, Express.js
- Template Engine: EJS (Embedded JavaScript)
- Database: MySQL
- Authentication: Passport.js (OAuth 2.0)
- Session Management: express-session
- File Upload: Multer
- Markdown Processing: Marked
- Styling: Custom CSS
npm run devThis will start the server with nodemon, which automatically restarts the server when files change.
On first run, the application will prompt you to seed the database with demo data. You can also control this behavior using the SEED_DB environment variable:
- Set
SEED_DB=trueto automatically seed - Set
SEED_DB=falseto skip seeding - Leave unset to be prompted interactively
Before deploying to production:
- Set
NODE_ENV=productionin your.envfile - Change
SESSION_SECRETto a strong, random string - Update OAuth callback URLs to your production domain
- Ensure your MySQL database is properly secured
- Configure proper file upload limits and storage
- Set up proper logging and error monitoring
- Verify MySQL is running:
mysql --version - Check database credentials in
.env - Ensure the database user has proper permissions
- Verify OAuth credentials are correctly set in
.env - Check that callback URLs match exactly (including protocol and port)
- Ensure OAuth apps are properly configured in provider dashboards
If port 3000 is already in use, change the PORT variable in .env to an available port.
This project is proprietary and confidential. All rights reserved. This software and associated documentation files are the property of Backpack Tech Works and may not be used, copied, modified, or distributed without explicit written permission.
For issues and questions, please open an issue on the repository or contact the development team.