-
Clone repository và navigate to backend
cd backend
-
Install dependencies
npm install
-
Setup environment variables
cp .env.example .env
Edit
.env
file and add your actual values:MONGODB_URI
: Your MongoDB connection stringJWT_SECRET
: A secure random string for JWT tokensSENDGRID_API_KEY
: Your SendGrid API keyFROM_EMAIL
: Your verified sender email- Other configurations as needed
-
Run development server
npm run dev
-
Navigate to frontend
cd frontend
-
Install dependencies
npm install
-
Setup environment variables
cp .env.example .env.local
Edit
.env.local
and updateVITE_API_URL
if needed. -
Run development server
npm run dev
- Create new Web Service on Render
- Connect your GitHub repository
- Set build command:
npm install
- Set start command:
npm start
- Add environment variables in Render dashboard
- Connect repository to Vercel
- Set build command:
npm run build
- Set output directory:
dist
- Add environment variables in Vercel dashboard
MONGODB_URI
: Database connection stringJWT_SECRET
: Secret for JWT tokensSENDGRID_API_KEY
: Email service API keyFROM_EMAIL
: Verified sender email
VITE_API_URL
: Backend API URL
- Never commit
.env
files to version control - Use strong, unique values for
JWT_SECRET
- Keep API keys secure and rotate them regularly
- Use environment-specific configurations