A production-ready full-stack web application for managing internship students with role-based access control.
| Layer | Technology |
|---|---|
| Frontend | React 18, React Router v6, CSS |
| Backend | Node.js, Express.js |
| Database | MongoDB (Mongoose ODM) |
| Auth | JWT + bcryptjs |
| File Upload | Multer (local storage) |
interntrack/
βββ backend/
β βββ controllers/
β β βββ authController.js
β β βββ studentController.js
β β βββ adminController.js
β βββ middleware/
β β βββ auth.js # JWT protect + authorize
β β βββ upload.js # Multer resume upload
β βββ models/
β β βββ User.js
β β βββ Student.js
β β βββ Project.js
β βββ routes/
β β βββ auth.js
β β βββ students.js
β β βββ projects.js
β β βββ admin.js
β βββ uploads/resumes/ # Resume files stored here
β βββ server.js
β βββ seed.js # Creates initial super admin
β βββ .env.example
βββ frontend/
βββ public/
β βββ index.html
βββ src/
βββ context/
β βββ AuthContext.js
βββ components/
β βββ Layout.js
β βββ Sidebar.js
βββ pages/
β βββ Login.js
β βββ Register.js
β βββ student/
β β βββ Dashboard.js
β β βββ Profile.js
β β βββ Projects.js
β βββ admin/
β β βββ Dashboard.js
β β βββ Students.js
β β βββ StudentDetail.js
β βββ superadmin/
β βββ Dashboard.js
β βββ Students.js
β βββ Admins.js
βββ styles/
β βββ global.css
βββ App.js
βββ index.js
- Node.js >= 18
- MongoDB running locally OR MongoDB Atlas URI
- npm or yarn
cd backend
# Install dependencies
npm install
# Copy env file
cp .env.example .env
# Edit .env β set your MongoDB URI and JWT secret
nano .env.env file:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/interntrack
JWT_SECRET=your_super_secret_key_change_this
JWT_EXPIRE=7d
NODE_ENV=development
FRONTEND_URL=http://localhost:3000
# Create the initial Super Admin account
node seed.js
# Start backend (development with auto-reload)
npm run dev
# OR for production
npm startBackend runs at: http://localhost:5000
cd frontend
# Install dependencies
npm install
# Start development server
npm startFrontend runs at: http://localhost:3000
After running node seed.js:
| Role | Password | |
|---|---|---|
| Super Admin | superadmin@interntrack.com | SuperAdmin@123 |
β οΈ Change the super admin password after first login!
| Feature | Student | Admin | Super Admin |
|---|---|---|---|
| Register / Login | β | β | β |
| Complete Profile | β | β | β |
| Upload Resume | β | β | β |
| Submit Projects | β | β | β |
| View Own Projects | β | β | β |
| View All Students | β | β | β |
| View / Download Resumes | β | β | β |
| Edit Project Status | β | β | β |
| Edit Student Profiles | β | β | β |
| Delete Students | β | β | β |
| Create Admin Accounts | β | β | β |
| Delete Admin Accounts | β | β | β |
| View Analytics | β | β | β |
# Update system
sudo apt update && sudo apt upgrade -y
# Install Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Install MongoDB
sudo apt install -y mongodb
sudo systemctl start mongodb
sudo systemctl enable mongodb
# Install PM2
sudo npm install -g pm2
# Install Nginx
sudo apt install -y nginxcd /var/www/interntrack/backend
npm install --production
# Set production env
cp .env.example .env
nano .env # fill in production values
# Run seed if first deploy
node seed.js
# Start with PM2
pm2 start server.js --name interntrack-api
pm2 save
pm2 startupcd /var/www/interntrack/frontend
npm install
# Set the API URL for production
echo "REACT_APP_API_URL=https://yourdomain.com" > .env.production
npm run build
# Build output is in ./build/# /etc/nginx/sites-available/interntrack
server {
listen 80;
server_name yourdomain.com;
# Serve React frontend
location / {
root /var/www/interntrack/frontend/build;
index index.html;
try_files $uri $uri/ /index.html;
}
# Proxy API requests to Express
location /api {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Serve uploaded files
location /uploads {
proxy_pass http://localhost:5000;
proxy_set_header Host $host;
}
# File upload size limit
client_max_body_size 10M;
}sudo ln -s /etc/nginx/sites-available/interntrack /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx- All passwords hashed with bcrypt (salt rounds: 12)
- JWT tokens expire in 7 days (configurable)
- File uploads restricted to PDF/DOC/DOCX, max 5MB
- CORS configured for specific frontend origin
- Role-based middleware on every protected route
- Input validation on all API endpoints
POST /api/auth/register # Register student
POST /api/auth/login # Login
GET /api/auth/me # Get current user
POST /api/auth/create-admin # Create admin (superadmin only)
GET /api/students/profile # Get own profile
PUT /api/students/profile # Update profile
POST /api/students/upload-resume # Upload resume
GET /api/students/projects # Get own projects
POST /api/students/projects # Submit project
PUT /api/students/projects/:id # Update own project
GET /api/admin/students # List all students (search/filter)
GET /api/admin/students/:id # Get student detail
PUT /api/admin/projects/:id # Update project
GET /api/admin/analytics # Get analytics
PUT /api/admin/students/:id # Edit student profile
DELETE /api/admin/students/:id # Delete student
GET /api/admin/admins # List admins
DELETE /api/admin/admins/:id # Delete admin