Deployment - Learnathon-By-Geeky-Solutions/codeclusters GitHub Wiki
🚀 Deployment Guide
This guide explains how to deploy the project which consists of three folders: admin
, frontend
, and backend
.
📦 Prerequisites
Make sure you have the following installed:
- Node.js v18+
- npm or yarn
- MongoDB
- Git
- Environment variables configured
🔧 Setup
1. Clone the Repository
git clone https://github.com/Learnathon-By-Geeky-Solutions/codeclusters
cd codeclusters
2. Install Dependencies
# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm install
# Admin Panel
cd ../admin
npm install
3. Environment Variables
Create .env
files for each part of the application as needed based on .env.example
files.
Example .env
for backend:
PORT = your_port
MONGODB_URI ="your mongoDb uri"
JWT_SECRET = "Provide_secret"
EMAIL_USER = "[email protected]"
EMAIL_PASS = "password"
ADMIN_EMAIL = "[email protected]"
ADMIN_PASSWORD = "password"
STRIPE_SECRET_KEY ='your_stripe_secret_key'
🛠️ Development Mode
Start All Services
# In separate terminals or use a process manager like concurrently or pm2
# Backend
cd backend
npm run server
# Frontend
cd frontend
npm run dev
# Admin
cd admin
npm run dev
🚢 Production Build & Deployment
Build
# Frontend
cd frontend
npm run build
# Admin
cd ../admin
npm run build
Serve
Use a static file server (like serve
or nginx) to serve the dist
or build
directories.
Backend
cd ../backend
npm run build
npm start
☁️ Deployment Suggestions
Render (Backend)
- Create a new Web Service on Render.
- Connect to your GitHub repository.
- Set:
- Build Command:
npm install
- Start Command:
npm start
- Build Command:
- Add environment variables in Render settings.
Netlify (Frontend & Admin)
Deploying the Admin and Frontend (via Netlify)
Both the admin
and frontend
folders are React apps and can be deployed to Netlify.
Steps:
-
Push to GitHub: Make sure both
admin
andfrontend
folders are committed and pushed to your GitHub repository. -
Login to Netlify: Go to Netlify and log in.
-
Create a New Site:
- Click "Add new site" > "Import an existing project"
- Choose your GitHub repository
- Set the build command to
npm run build
- Set the publish directory:
- For
admin
:admin/build
- For
frontend
:frontend/build
- For
-
Set Environment Variables:
- Go to Site Settings > Environment Variables
- Add required variables like API URLs or auth secrets
-
Deploy Site: Click "Deploy Site"
-
Site URL: After deployment, Netlify will give you a live site URL
✅ Post-Deployment Checklist
- API endpoints are functioning correctly.
- Frontend and Admin UIs are accessible.
- Auth flows are tested.
- Database connections are secure and stable.