-
Notifications
You must be signed in to change notification settings - Fork 1
Deployment
mhbarshan edited this page Apr 29, 2025
·
3 revisions
This guide explains how to deploy the project which consists of three folders: admin, frontend, and backend.
Make sure you have the following installed:
- Node.js v18+
- npm or yarn
- MongoDB
- Git
- Environment variables configured
git clone https://github.com/Learnathon-By-Geeky-Solutions/codeclusters
cd codeclusters# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm install
# Admin Panel
cd ../admin
npm installCreate .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 = "example@mail.com"
EMAIL_PASS = "password"
ADMIN_EMAIL = "example@mail.com"
ADMIN_PASSWORD = "password"
STRIPE_SECRET_KEY ='your_stripe_secret_key'
# 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# Frontend
cd frontend
npm run build
# Admin
cd ../admin
npm run buildUse a static file server (like serve or nginx) to serve the dist or build directories.
cd ../backend
npm run build
npm start- 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.
Both the admin and frontend folders are React apps and can be deployed to Netlify.
-
Push to GitHub: Make sure both
adminandfrontendfolders 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
- API endpoints are functioning correctly.
- Frontend and Admin UIs are accessible.
- Auth flows are tested.
- Database connections are secure and stable.