Public Learning Resources Map for Every Student
OpenDesk is a community-driven platform that helps students discover free and low-cost learning resources like libraries, study centers, public Wi-Fi zones, and educational NGOs in their area.
- πΊοΈ Interactive Map - Discover learning resources on an interactive map
- π Smart Search - Filter by category, location, and search terms
- π Location-Based - Find resources near you using pincode
- π± Mobile-Friendly - Fully responsive design for all devices
- β Verified Resources - All resources are reviewed before publishing
- β Add Resources - Submit new learning resources to help the community
- π€ User Tracking - Submissions are linked to your account
- π Track Submissions - See the status of your submitted resources
- π Secure Dashboard - Protected admin panel with authentication
- β Review Submissions - Approve or reject community submissions
- π Statistics - View pending, approved, and rejected counts
- π₯ User Management - Track who submitted each resource
- React 18.2.0 - UI framework
- React Router - Client-side routing
- Leaflet - Interactive maps
- Lucide React - Beautiful icons
- Vite - Fast build tool
- Node.js - Runtime environment
- Express - Web framework
- Supabase - PostgreSQL database & authentication
- JWT - Token-based authentication
- Node.js >= 18.0.0
- npm or yarn
- Supabase account
git clone https://github.com/Noah12398/OpenDesk.git
cd OpenDeskcd backend
npm install
# Create .env file
cp .env.example .env
# Update .env with your Supabase credentials
# SUPABASE_URL=your_supabase_url
# SUPABASE_SERVICE_KEY=your_service_role_key
# PORT=5001- Go to your Supabase project dashboard
- Navigate to SQL Editor
- Copy the contents of
backend/schema.sql - Paste and execute in SQL Editor
cd ../frontend
npm install
# Create .env.local file
cp .env.example .env.local
# Update with your Supabase credentials
# VITE_SUPABASE_URL=your_supabase_url
# VITE_SUPABASE_ANON_KEY=your_anon_key# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run devThe app will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:5001
Already existing admin: email-darwinmaxwell05@gmail.com password-Qwerty123?
- Sign up through the app at http://localhost:5173/signup
- Get your User ID from Supabase Dashboard β Authentication β Users
- Grant admin privileges by running this SQL query:
insert into admin_users (id, email, role)
values ('YOUR_USER_ID', 'your-email@example.com', 'admin');See AUTH_SETUP.md for detailed instructions.
-
Browse Resources
- Visit the map page to see all approved resources
- Use filters to find specific types of resources
- Click markers for details
-
Submit Resources
- Create an account and log in
- Go to "Add Resource"
- Fill out the form with resource details
- Your submission will be reviewed by admins
- Login at http://localhost:5173/login
- Access Admin Dashboard at http://localhost:5173/admin
- Review Submissions
- View all pending submissions
- Click β to approve or β to reject
- Approved resources automatically appear on the public map
OpenDesk/
βββ backend/
β βββ config/
β β βββ supabase.js # Supabase client configuration
β βββ middleware/
β β βββ auth.js # JWT authentication middleware
β βββ routes/
β β βββ auth.js # Authentication endpoints
β β βββ resources.js # Resource CRUD endpoints
β βββ schema.sql # Database schema
β βββ server.js # Express server
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ common/ # Reusable UI components
β β β βββ layout/ # Layout components (Header, Footer)
β β β βββ ProtectedRoute.jsx
β β βββ context/
β β β βββ AuthContext.jsx # Authentication state management
β β βββ lib/
β β β βββ api.js # API client
β β β βββ supabase.js # Supabase client
β β βββ pages/
β β β βββ Home.jsx
β β β βββ MapDiscovery.jsx
β β β βββ AddResource.jsx
β β β βββ AdminDashboard.jsx
β β β βββ Login.jsx
β β β βββ Signup.jsx
β β βββ App.jsx
β βββ package.json
β
βββ .gitignore
βββ README.md
βββ AUTH_SETUP.md
βββ DEBUG_GUIDE.md
βββ TESTING_GUIDE.md
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/resources |
Get all approved resources |
| GET | /api/resources/:id |
Get single resource by ID |
| GET | /health |
Health check |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
Register new user |
| POST | /api/auth/login |
Login user |
| POST | /api/auth/logout |
Logout user |
| GET | /api/auth/me |
Get current user info |
| Method | Endpoint | Description | Required Role |
|---|---|---|---|
| POST | /api/resources |
Submit new resource | Authenticated |
| GET | /api/resources/pending |
Get pending resources | Admin |
| PATCH | /api/resources/:id/approve |
Approve resource | Admin |
| PATCH | /api/resources/:id/reject |
Reject resource | Admin |
See TESTING_GUIDE.md for comprehensive testing instructions.
# Test backend health
curl http://localhost:5001/health
# Test API returns resources
curl http://localhost:5001/api/resourcesSee DEBUG_GUIDE.md for common issues and solutions.
Resources not showing on map?
- Check browser console for errors (F12)
- Verify backend is running on port 5001
- Check proxy configuration in
vite.config.js
"Invalid token" error?
- Logout and login again
- Clear localStorage in browser console
Admin access denied?
- Verify you're in the
admin_userstable - Check Supabase dashboard β Authentication
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ for students who need access to learning resources
- Inspired by the need to bridge the digital divide in education
- Special thanks to the open-source community
For issues or questions:
- Check the DEBUG_GUIDE.md
- Review TESTING_GUIDE.md
- Open an issue on GitHub
- Email verification for new users
- Password reset functionality
- OAuth providers (Google, GitHub)
- Mobile app (React Native)
- Resource ratings and reviews
- Advanced search with filters
- Export resources as CSV
- Multilingual support
Made with β€οΈ for students everywhere