This guide outlines the steps to deploy freeWriter to a production environment using Vercel.
- Node.js (v14 or later)
- Vercel account
- Git
-
Install Vercel CLI:
npm install -g vercel
-
Login to Vercel:
vercel login
-
Navigate to the project root:
cd freewriter
-
Deploy to Vercel:
vercel
-
Follow the prompts to link your project to Vercel.
-
Set up environment variables in Vercel:
- Go to your project settings on the Vercel dashboard
- Add the following environment variables:
MONGODB_URI
: Your MongoDB connection stringMONGODB_DB
: Your MongoDB database nameJWT_SECRET
: A secret key for JWT token generationOPENAI_API_KEY
: Your OpenAI API key (if using AI features)
-
Trigger a new deployment:
vercel --prod
-
Test the application thoroughly to ensure all features are working as expected.
-
Set up monitoring and logging services (e.g., Sentry, LogRocket) for both frontend and backend.
-
Configure custom domain and SSL certificates if not automatically handled by Vercel.
-
Set up a CI/CD pipeline for automated deployments (optional).
For any issues or additional configuration needs, please refer to the Vercel documentation.