Skip to content

Latest commit

Β 

History

History
314 lines (235 loc) Β· 7.04 KB

File metadata and controls

314 lines (235 loc) Β· 7.04 KB

Stackora Technologies - Complete Setup Guide

πŸ“¦ What You Have

A complete full-stack web application with:

  • Backend: Node.js + Express + MongoDB
  • Frontend: React with modern UI
  • Admin Panel: Secure dashboard for content management
  • Features: Services, Careers, Projects, Contact forms, Job applications

πŸš€ Quick Start (5 Minutes)

Step 1: Install MongoDB

Windows:

# Download from: https://www.mongodb.com/try/download/community
# Or use MongoDB Atlas (cloud): https://www.mongodb.com/cloud/atlas

Alternative - Use MongoDB Atlas (Recommended):

  1. Go to https://www.mongodb.com/cloud/atlas
  2. Create free account
  3. Create a cluster
  4. Get connection string
  5. Use it in .env file

Step 2: Install Dependencies

# Install backend dependencies
npm install

# Install frontend dependencies
cd frontend
npm install
cd ..

Step 3: Configure Environment

Create .env file in root directory:

PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/stackora
JWT_SECRET=stackora_secret_key_2025_change_this_in_production
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-gmail-app-password
ADMIN_EMAIL=admin@stackora.com
FRONTEND_URL=http://localhost:3000

Step 4: Create Upload Folders

mkdir uploads
mkdir uploads\resumes
mkdir uploads\projects

Step 5: Seed Database (Optional but Recommended)

node backend/scripts/seedData.js

This creates sample services, careers, and projects.

Step 6: Create Admin User

node backend/scripts/createAdmin.js

Follow the prompts to create your admin account.

Step 7: Start the Application

# Start both backend and frontend
npm run dev

Or run separately:

# Terminal 1 - Backend
npm run server

# Terminal 2 - Frontend
cd frontend
npm start

🌐 Access Your Application

πŸ“§ Email Setup (Gmail)

  1. Enable 2-Factor Authentication on your Gmail
  2. Go to: https://myaccount.google.com/apppasswords
  3. Generate an "App Password"
  4. Use this password in .env as EMAIL_PASS

πŸ” Default Admin Credentials

After running createAdmin.js, use the credentials you created.

Example:

πŸ“Š Database Structure

The application uses these collections:

  • admins - Admin users
  • services - Service offerings
  • careers - Job postings
  • applications - Job applications
  • projects - Portfolio projects
  • contacts - Contact form submissions

πŸ› οΈ Common Commands

# Development
npm run dev              # Run both frontend & backend
npm run server           # Run backend only
npm run client           # Run frontend only

# Database
node backend/scripts/seedData.js      # Seed sample data
node backend/scripts/createAdmin.js   # Create admin user

# Production
cd frontend && npm run build          # Build frontend
npm start                             # Start production server

πŸ“ Project Structure

stackora-app/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ models/           # Database schemas
β”‚   β”œβ”€β”€ routes/           # API endpoints
β”‚   β”œβ”€β”€ middleware/       # Auth middleware
β”‚   β”œβ”€β”€ scripts/          # Utility scripts
β”‚   └── server.js         # Main server
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   └── src/
β”‚       β”œβ”€β”€ components/   # Reusable components
β”‚       β”œβ”€β”€ pages/        # Page components
β”‚       β”œβ”€β”€ api/          # API client
β”‚       └── App.js        # Main app
β”œβ”€β”€ uploads/              # File uploads
β”œβ”€β”€ .env                  # Environment variables
└── package.json          # Dependencies

🎨 Customization

Change Brand Colors

Edit frontend/src/index.css:

:root {
  --color-accent: #ffd700;  /* Change to your brand color */
  --color-bg: #0a0a0a;      /* Background color */
}

Update Company Info

Edit content in:

  • frontend/src/pages/Home.js
  • frontend/src/components/Footer.js

Add/Edit Services

Use the admin panel or directly in MongoDB:

  • Login to admin panel
  • Navigate to Services section
  • Add/Edit/Delete services

πŸš€ Deployment

Backend (Heroku/Railway/Render)

  1. Push code to GitHub
  2. Connect to deployment platform
  3. Set environment variables
  4. Deploy

Frontend (Vercel/Netlify)

  1. Build: cd frontend && npm run build
  2. Deploy frontend/build folder
  3. Set API URL environment variable

Database (MongoDB Atlas)

  1. Create cluster on MongoDB Atlas
  2. Get connection string
  3. Update MONGODB_URI in production

πŸ”’ Security Checklist

  • Change JWT_SECRET to a strong random string
  • Use MongoDB Atlas with authentication
  • Enable HTTPS in production
  • Set strong admin passwords
  • Configure CORS properly
  • Enable rate limiting
  • Regular backups

πŸ“ API Documentation

Public Endpoints

GET  /api/services              # Get all services
GET  /api/careers               # Get all careers
GET  /api/careers/:id           # Get single career
GET  /api/projects              # Get all projects
POST /api/contact               # Submit contact form
POST /api/applications          # Submit job application

Admin Endpoints (Requires JWT Token)

POST   /api/admin/login         # Admin login
GET    /api/admin/me            # Get current admin
POST   /api/services            # Create service
PUT    /api/services/:id        # Update service
DELETE /api/services/:id        # Delete service
POST   /api/careers             # Create career
PUT    /api/careers/:id         # Update career
DELETE /api/careers/:id         # Delete career
GET    /api/applications        # Get all applications
PATCH  /api/applications/:id    # Update application status
GET    /api/contact             # Get all contacts
PATCH  /api/contact/:id         # Update contact status

πŸ› Troubleshooting

MongoDB Connection Error

# Make sure MongoDB is running
# Windows: Check Services for "MongoDB"
# Or use MongoDB Atlas connection string

Port Already in Use

# Change PORT in .env file
PORT=5001

Email Not Sending

  • Check Gmail app password
  • Verify EMAIL_USER and EMAIL_PASS in .env
  • Check Gmail security settings

Frontend Not Loading

# Clear cache and reinstall
cd frontend
rm -rf node_modules package-lock.json
npm install

πŸ“ž Support

For issues or questions:

🎯 Next Steps

  1. βœ… Complete setup
  2. βœ… Create admin account
  3. βœ… Seed sample data
  4. βœ… Test all features
  5. πŸ“ Customize content
  6. 🎨 Update branding
  7. πŸš€ Deploy to production

πŸ“š Additional Resources


Built with ❀️ for Stackora Technologies