MadeIn - Local Business Directory
A multilingual platform for discovering and promoting local businesses, built with SvelteKit and MongoDB.
Features
- Multilingual support (27+ languages)
- Business/provider listings with search and filtering
- User reviews and ratings
- Ad-free experience with donations
- Admin dashboard for content management
Tech Stack
- Frontend: SvelteKit, Tailwind CSS
- Backend: Node.js, MongoDB
- Authentication: JWT
- Deployment: Vercel/Netlify (Frontend), MongoDB Atlas (Database)
Prerequisites
- Node.js 16+ and npm 8+
- MongoDB 6.0+ (local or Atlas)
- Git
Getting Started
-
Clone the repository
git clone <repository-url> cd madein -
Install dependencies
npm install -
Set up environment variables Copy
.env.exampleto.envand update the values:cp .env.example .envUpdate the
.envfile with your configuration:# MongoDB MONGODB_URI=mongodb://localhost:27017 MONGODB_DB=madein # Authentication JWT_SECRET=your_jwt_secret SESSION_SECRET=your_session_secret # Email (optional, for password reset) SMTP_HOST=smtp.example.com SMTP_PORT=587 SMTP_USER=user@example.com SMTP_PASS=yourpassword # Payments (optional) STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret -
Set up MongoDB
- Install MongoDB Community Edition: https://www.mongodb.com/try/download/community
- Start MongoDB service:
# On macOS (using Homebrew) brew services start mongodb-community # On Linux (systemd) sudo systemctl start mongod
-
Initialize the database
npm run db:initThis will:
- Create the database
- Set up collections and indexes
- Load initial data (if any)
-
Start the development server
npm run devThe app will be available at
http://localhost:5173
Available Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run check- Run TypeScript and Svelte checksnpm run format- Format code with Prettiernpm run lint- Lint codenpm run db:init- Initialize database with default datanpm run db:reset- Reset database (CAUTION: deletes all data)npm run db:seed- Seed database with sample data
Project Structure
src/
├── lib/
│ ├── db/ # Database models and connection
│ ├── stores/ # Svelte stores
│ └── utils/ # Utility functions
├── routes/ # Application routes
└── app.html # Main HTML template
Database Models
- User: User accounts and authentication
- Provider: Business listings
- Review: User reviews and ratings
- Donation: Donation records for ad-free experience
- Translation: Multilingual content
Environment Variables
See .env.example for all available environment variables.
Deployment
Frontend
Deploy to Vercel or Netlify:
Backend
- Set up a MongoDB Atlas cluster: https://www.mongodb.com/cloud/atlas/register
- Update your
.envwith the Atlas connection string - Deploy your API (if any) to a platform like Vercel, Netlify, or Railway
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Building
To create a production version of your app:
npm run build
You can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.