A modern full-stack web application for building sustainable communities through collaboration, project sharing, and resource exchange.
- π User Authentication: Secure JWT-based authentication with MongoDB Atlas
- π₯ Community Projects: Browse and participate in sustainability projects
- π Events Management: Organize and join community events
- π Marketplace: Trade and share resources within the community
- π± Responsive Design: Modern UI built with React and Tailwind CSS
- π Search & Filter: Find projects, events, and marketplace items easily
- π€ User Profiles: Personalized profiles with avatar support
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- React Router for navigation
- Context API for state management
- Node.js with Express.js
- TypeScript for type safety
- MongoDB Atlas for cloud database
- Mongoose for ODM
- JWT for authentication
- bcryptjs for password hashing
- CORS & Security middleware
Symbiotic_City/ βββ frontend/ # React frontend application β βββ src/ β β βββ components/ # Reusable UI components β β βββ pages/ # Page components β β βββ contexts/ # React Context providers β β βββ hooks/ # Custom React hooks β β βββ lib/ # API client and utilities β β βββ utils/ # Helper functions β βββ public/ # Static assets β βββ package.json βββ backend/ # Node.js backend API β βββ src/ β β βββ config/ # Database configuration β β βββ models/ # MongoDB schemas β β βββ routes/ # API endpoints β β βββ middleware/ # Express middleware β β βββ utils/ # Utility functions β βββ package.json βββ README.md
- Node.js (v18 or higher)
- npm or yarn
- MongoDB Atlas account
-
Clone the repository
git clone https://github.com/Viraj0711/Symbiotic_City.git cd Symbiotic_City -
Install dependencies
# Install root dependencies npm install # Install frontend dependencies cd frontend && npm install # Install backend dependencies cd ../backend && npm install
-
Environment Setup
Backend (.env)
NODE_ENV=development PORT=3001 MONGODB_URI=your_mongodb_atlas_connection_string JWT_SECRET=your_super_secret_jwt_key JWT_EXPIRES_IN=7d CORS_ORIGIN=http://localhost:5173
Frontend (.env)
VITE_API_URL=http://localhost:3001/api
-
Start Development Servers
# From root directory - runs both frontend and backend npm run devOr start them separately:
# Backend (from backend directory) npm run dev # Frontend (from frontend directory) npm run dev
-
Access the Application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
npm run dev- Start both frontend and backend in development modenpm run build- Build both frontend and backend for productionnpm start- Start production servers
npm run dev- Start Vite development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
npm run dev- Start development server with hot reloadnpm run build- Compile TypeScript to JavaScriptnpm start- Start production servernpm run lint- Run ESLintnpm test- Run tests
{
name: string;
email: string;
password: string; // bcrypt hashed
avatar?: string;
bio?: string;
location?: string;
role: 'USER' | 'ADMIN' | 'MODERATOR';
isActive: boolean;
emailVerified: boolean;
lastLogin?: Date;
createdAt: Date;
updatedAt: Date;
}{
title: string;
description: string;
status: 'PLANNING' | 'ACTIVE' | 'COMPLETED' | 'PAUSED';
category: string;
tags: string[];
authorId: ObjectId;
participants: ObjectId[];
location?: GeoJSON;
startDate?: Date;
endDate?: Date;
createdAt: Date;
updatedAt: Date;
}POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user profilePUT /api/auth/profile- Update user profile
GET /api/projects- Get all projectsPOST /api/projects- Create new projectGET /api/projects/:id- Get project by IDPUT /api/projects/:id- Update projectDELETE /api/projects/:id- Delete project
GET /api/events- Get all eventsPOST /api/events- Create new eventGET /api/events/:id- Get event by ID
GET /api/marketplace- Get all marketplace itemsPOST /api/marketplace- Create new listing
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub: @Viraj0711
- Thanks to the open-source community for the amazing tools and libraries
- MongoDB Atlas for providing cloud database services
- Vercel/Netlify for hosting solutions