Skip to content

About

Is there space4it?

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Space4It - Peer-to-Peer Storage Marketplace

Store smarter, spend less

Space4It is a peer-to-peer marketplace for storage space rental, specifically designed for university students. Think Airbnb, but for storage space.

πŸš€ Features

  • Search & Explore: Browse available storage spaces with interactive maps
  • List Your Space: Hosts can easily create and manage listings
  • Booking System: Request, approve, and manage storage bookings
  • Messaging: Real-time messaging between hosts and guests
  • Reviews & Ratings: Rate experiences after completed bookings
  • Student Verification: Automatic verification for .edu and .ac.uk email addresses
  • Responsive Design: Fully responsive, works on mobile, tablet, and desktop

πŸ› οΈ Tech Stack

  • Framework: Next.js 14 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Backend: Supabase (PostgreSQL, Auth, Storage, Realtime)
  • Maps: Leaflet (OpenStreetMap)
  • Deployment: Vercel

πŸ“‹ Prerequisites

Before you begin, ensure you have:

  • Node.js 18+ installed
  • npm or yarn package manager
  • A Supabase account (free tier works)
  • Git (for version control)

πŸ—οΈ Setup Instructions

1. Clone the Repository

git clone <your-repo-url>
cd Space4it

2. Install Dependencies

npm install

3. Set Up Supabase

  1. Go to supabase.com and create a free account
  2. Create a new project
  3. Wait for your project to be provisioned (takes a few minutes)
  4. Go to Settings β†’ API to get your credentials:
    • Project URL
    • anon public key
    • service_role secret key (for seeding)

4. Create Database Schema

  1. In your Supabase dashboard, go to SQL Editor
  2. Copy the contents of lib/database.types.sql
  3. Paste and run the SQL script to create all tables, indexes, and RLS policies

5. Set Up Storage Bucket

  1. In Supabase dashboard, go to Storage
  2. Create a new bucket named listing-photos
  3. Set it to Public bucket
  4. (Optional) Set up policies to allow uploads from authenticated users

6. Configure Environment Variables

Create a .env.local file in the root directory:

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key

# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000

Important: Never commit .env.local to version control. It's already in .gitignore.

7. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.

🌱 Seeding Sample Data

To populate your database with sample users, listings, bookings, and messages:

  1. Make sure your .env.local file is configured correctly
  2. Run the seed script:
npm run seed

This will create:

  • 5 sample users (mix of hosts and guests)
  • 8 sample listings across different cities
  • 3 sample bookings with different statuses
  • Sample reviews and messages

Test Login Credentials:

  • All seeded users have password: password123
  • Try logging in with:
    • alice@harvard.edu
    • bob@mit.edu
    • carol@nyu.edu
    • david@gmail.com
    • emma@ucl.ac.uk

πŸ“ Project Structure

Space4it/
β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”œβ”€β”€ dashboard/         # User dashboard
β”‚   β”œβ”€β”€ host/              # Host dashboard and listing management
β”‚   β”œβ”€β”€ listing/           # Listing detail pages
β”‚   β”œβ”€β”€ login/             # Authentication pages
β”‚   β”œβ”€β”€ search/            # Search and explore page
β”‚   └── messages/          # Messaging pages
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ dashboard/         # Dashboard-specific components
β”‚   └── ui/                # Reusable UI components
β”œβ”€β”€ lib/                   # Utility functions and configurations
β”‚   β”œβ”€β”€ supabase/          # Supabase client setup
β”‚   └── utils.ts           # Helper functions
β”œβ”€β”€ scripts/               # Utility scripts
β”‚   └── seed.ts            # Database seeding script
β”œβ”€β”€ types/                 # TypeScript type definitions
└── public/                # Static assets

🚒 Deployment to Vercel

1. Push to GitHub

git add .
git commit -m "Initial commit"
git push origin main

2. Deploy to Vercel

  1. Go to vercel.com and sign in
  2. Click New Project
  3. Import your GitHub repository
  4. Vercel will auto-detect Next.js settings

3. Configure Environment Variables

In Vercel dashboard:

  1. Go to your project β†’ Settings β†’ Environment Variables
  2. Add all variables from .env.local:
    • NEXT_PUBLIC_SUPABASE_URL
    • NEXT_PUBLIC_SUPABASE_ANON_KEY
    • SUPABASE_SERVICE_ROLE_KEY (if needed for server-side operations)
    • NEXT_PUBLIC_APP_URL (your Vercel URL)

4. Deploy

Vercel will automatically deploy your app. After deployment:

  1. Visit your Vercel URL
  2. Run the seed script locally to populate data, OR
  3. Use the Supabase SQL editor to run the seed data manually

5. Update Supabase Settings

  1. In Supabase dashboard, go to Authentication β†’ URL Configuration
  2. Add your Vercel URL to Site URL
  3. Add your Vercel URL to Redirect URLs

πŸ”’ Security Notes

  • Row Level Security (RLS) is enabled on all tables
  • Users can only access their own data
  • Service role key should only be used server-side (never expose in client code)
  • Always use environment variables for sensitive data

πŸ§ͺ Testing

Currently, manual testing is recommended. In the future, you can add:

  • Unit tests with Jest
  • Integration tests with Playwright
  • E2E tests for critical flows

πŸ“ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint
  • npm run seed - Seed database with sample data

πŸ› Troubleshooting

Database Connection Issues

  • Verify your Supabase URL and keys are correct
  • Check that RLS policies are set up correctly
  • Ensure your Supabase project is active (not paused)

Image Upload Issues

  • Verify the listing-photos bucket exists in Supabase Storage
  • Check bucket is set to Public
  • Verify storage policies allow uploads

Authentication Issues

  • Check redirect URLs in Supabase settings
  • Verify email confirmation is disabled (for development) or handle email confirmation
  • Clear browser cookies/localStorage if stuck in auth loop

πŸ“š Additional Resources

🀝 Contributing

This is a private project, but if you want to contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

This project is private and proprietary.

πŸ†˜ Support

For issues or questions:

  1. Check the troubleshooting section above
  2. Review Supabase and Next.js documentation
  3. Check existing GitHub issues (if public)

🎨 Color Palette

  • Primary: #CC9B7A (Claude tan/copper)
  • Secondary: #1F1F1F (dark almost-black)
  • Accent: #FFFFFF (white)
  • Background: #F5F5F5 (light gray)

Built with ❀️ for students who need storage space

About

Is there space4it?

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages