Welcome! This is a simple guide to help you get started with the MSG91 website project.
This is MSG91's main website built with Next.js (a React framework). It has:
- Multiple pages for different countries
- A blog section
- Contact forms and widgets
- Modern styling with Tailwind CSS
Make sure you have:
- Node.js installed (version 18 or newer)
- A code editor like VS Code
- Basic knowledge of HTML, CSS, and JavaScript
# If you haven't cloned the project yet
git clone [repository-url]
cd MSG91npm installThis downloads all the tools and libraries the project needs.
- Find the file called
.env.example - Copy it and rename the copy to
.env - Ask your supervisor to fill in the values (these are secret keys)
npm run devThe website will open at: http://localhost:3030
src/pages/- Each file here becomes a webpagesrc/components/- Reusable pieces of the website (like headers, buttons)src/data/- Content for different countries (text, images info)_posts/blog/- Blog articlespublic/- Images and files that don't changesrc/styles/- How the website looks (colors, fonts, layout)
- Go to
_posts/blog/ - Create a new
.mdxfile - Copy the format from an existing blog post
- Write your content
- Look in
src/data/folders - Find the right country folder (like
in/for India) - Edit the
.jsonfiles - The website updates automatically
- Put images in
public/img/orpublic/assets/ - Use them in code like:
/img/your-image.png
npm run dev- Start the development server (port 3030)npm run build- Build the project for productionnpm start- Start the production server (port 3030)npm run lint- Check for code errorsnpm install- Install all project dependencies
- Development: http://localhost:3030 (when running
npm run dev) - Production: http://localhost:3030 (when running
npm start) - The project uses port 3030 by default (not the usual 3000)
git status- See what files you've changedgit add .- Stage all your changesgit commit -m "your message"- Save your changes with a messagegit push- Upload your changes to the servergit pull- Download latest changes from the server
- Delete the
node_modulesfolder - Run
npm installagain - Try
npm run dev
- Stop other development servers
- Or change the port in
package.jsonscripts
- Make sure you saved the file
- Check the terminal for error messages
- Try refreshing the browser (Ctrl+R or Cmd+R)
- Module not found: Run
npm install - Syntax error: Check for typos in your code
- Build failed: Run
npm run lintto find issues
- Components are in
src/components/ - Each folder has a component (like
BannerComp/,AboutUsComp/) - These are reusable pieces - change once, updates everywhere
- Always test after making changes
- axios - For making API calls (getting data from servers)
- date-fns - For working with dates and times
- react-icons - For adding icons to the website
- react-toastify - For showing popup messages to users
- gray-matter - For reading blog post information
- next-mdx-remote - For converting blog posts to web pages
- API calls - Functions that get data from MSG91's servers
- Form handlers - Functions that process contact forms
- Data formatters - Functions that make data look nice on the website
- Navigation helpers - Functions that help users move around the site
- Tailwind CSS classes - Pre-made styles like
bg-blue-500,text-center - DaisyUI components - Ready-made buttons, cards, and layouts
- SCSS mixins - Custom styles specific to MSG91's design
- Responsive utilities - Make the site work on phones and computers
.jsfiles - JavaScript code (the logic).jsonfiles - Data files (text, settings, content).mdxfiles - Blog posts (mix of text and code).scssfiles - Styling files (how things look)
- Multi-country support - Same website, different content for each country
- SEO optimization - Helps Google find and rank the website
- Widget integration - Chat boxes, OTP forms, and other interactive elements
- Analytics tracking - Sees how users interact with the website
- Hot reload - Website updates automatically when you save
- Error messages - Browser console shows what's wrong
- Prettier - Automatically formats your code nicely
- Husky - Checks your code before saving to Git
- Image optimization - Pictures load faster
- Code splitting - Only loads what's needed for each page
- Static generation - Some pages are pre-built for speed
- Caching - Stores frequently used data for faster loading
npm run dev- Start working on the websitenpm run build- Check if everything works for productionnpm run lint- Check for code problems
- If the website won't start, try deleting
node_modulesfolder and runnpm installagain - If you see errors, check the terminal for red text - it usually tells you what's wrong
- Ask your supervisor if you're stuck!
- Start small - Make tiny changes first to understand how things work
- Save often - The website updates automatically when you save files
- Use the browser developer tools - Right-click → Inspect to see what's happening
- Don't be afraid to break things - You can always undo changes with Git
- Ask questions - It's better to ask than to guess!
package.json- This controls what tools the project usesnext.config.mjs- Advanced settings.envfile - Secret keys and settings- Anything in
node_modules/- These are downloaded tools
- Make your changes
- Test them by running
npm run dev - Show your supervisor
- They'll help you submit your changes properly
Good luck and happy coding! 🚀