5.1 KiB
5.1 KiB
Initialize a newly generated Odoo PWA project with all necessary setup steps.
What this command does:
- Runs
npm installto install all dependencies - Creates
.envfile from.env.example - Guides through environment configuration
- Tests the Odoo connection
- Starts the development server
- Opens the application in browser
- Provides next steps and documentation
Prerequisites:
- Newly generated Odoo PWA project
- Node.js installed (v18 or higher)
- npm or pnpm package manager
- Internet connection for dependencies
Steps:
1. Verify Project Structure
Check that required files exist:
- ✅
package.json - ✅
.env.example - ✅
README.md - ✅
src/lib/odoo.js(or equivalent) - ✅ Framework config file (svelte.config.js / vite.config.js)
2. Install Dependencies
npm install
Show progress and estimated time.
3. Environment Setup
Copy .env.example to .env:
cp .env.example .env
Ask the user to provide:
- Odoo URL
- Database name
- API key
- Username
- Model configuration
Update .env file with provided values.
4. Verify Setup
Read .env and verify all required variables are set.
5. Test Odoo Connection
Run a quick connection test:
- Test authentication
- Verify model access
- Check permissions
If connection fails, offer to run full diagnostics (/test-connection).
6. Initialize Git (if not already)
git init
git add .
git commit -m "Initial commit: Odoo PWA generated"
7. Start Development Server
npm run dev
Framework-specific commands:
- SvelteKit:
npm run dev(default port 5173) - React:
npm run dev(default port 5173) - Vue:
npm run dev(default port 5173)
8. Open in Browser
Automatically open browser to http://localhost:5173
Example prompts to use this command:
/init-project- Complete initialization wizard- User: "Set up my new Odoo PWA"
- User: "Initialize the project"
- User: "Get my PWA running"
Post-Initialization Checklist:
After successful initialization:
✅ Immediate Next Steps:
- Test the application in the browser
- Verify data loads from Odoo
- Test creating a new record
- Test editing and deleting records
- Verify offline functionality (disable network)
✅ Configuration:
- Review and customize PWA manifest (colors, icons, name)
- Update application metadata
- Configure deployment targets
- Set up version control (Git)
✅ Development:
- Read the generated
CLAUDE.mdfor architecture details - Review
API.mdfor Odoo client documentation - Explore the codebase structure
- Customize UI components and styling
✅ Testing:
- Test all CRUD operations
- Verify sync functionality
- Test offline mode
- Check PWA installability
- Test on mobile devices
✅ Deployment Preparation:
- Review deployment documentation
- Set up hosting platform account (Vercel/Netlify/etc)
- Prepare production Odoo API keys
- Configure environment variables for production
Helpful Resources:
Provide links to:
- Project
README.md CLAUDE.md(architecture guide)API.md(API documentation)- Odoo documentation
- Framework documentation (SvelteKit/React/Vue)
- PWA best practices
Development Commands:
Remind the user of available commands:
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run linter
npm run format # Format code
Troubleshooting:
npm install fails
- Check Node.js version (must be v18+)
- Clear npm cache:
npm cache clean --force - Delete
node_modulesandpackage-lock.json, try again - Check internet connection
.env configuration issues
- Verify all variables are set (no empty values)
- Check for typos in variable names
- Ensure no spaces around
=signs - Verify Odoo credentials are correct
Development server won't start
- Check if port 5173 is already in use
- Try different port:
npm run dev -- --port 3000 - Check for syntax errors in config files
- Review console error messages
Odoo connection fails
- Run
/test-connectionfor full diagnostics - Verify
.envfile is loaded correctly - Check Odoo server is accessible
- Verify API key is valid
Build fails
- Check for TypeScript errors (if using TypeScript)
- Verify all dependencies are installed
- Check for missing environment variables
- Review build logs for specific errors
After Initialization:
Display summary:
🎉 Odoo PWA Initialized Successfully!
📁 Project: [project-name]
🚀 Framework: [SvelteKit/React/Vue]
🔗 Dev Server: http://localhost:5173
📝 Model: [model-name]
✅ Next Steps:
1. Open http://localhost:5173 in your browser
2. Test data sync from Odoo
3. Read CLAUDE.md for architecture details
4. Customize the UI to match your needs
5. Run /deploy-vercel when ready to deploy
📚 Documentation:
- README.md - Getting started guide
- CLAUDE.md - Architecture and patterns
- API.md - Odoo API client reference
💡 Helpful Commands:
- /test-connection - Verify Odoo integration
- /add-model - Add more Odoo models
- /deploy-vercel - Deploy to production
- /odoo-help - Get plugin help
Happy coding! 🚀