Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: sublet #274

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6ef481a
new commit
jonrxu Feb 23, 2024
f6a1a86
Add frontend for sublet portal
jonrxu Feb 23, 2024
e45d1fb
Add README
jonrxu Feb 23, 2024
b87f292
current templated services
jonrxu Feb 25, 2024
bef8fe0
changed favicon location
jonrxu Mar 5, 2024
49dbe50
added first api call and refactored frontend
jonrxu Mar 5, 2024
14d68fd
fixed service formatting and added new font
jonrxu Mar 5, 2024
4855ed7
edited propertyf listing and changed global colors
jonrxu Mar 5, 2024
1cd8c87
update from origin
jonrxu Mar 5, 2024
4a488fd
added new carousel
jonrxu Mar 12, 2024
09c0c56
finished property listing in dashboard for now, added lucide
jonrxu Mar 12, 2024
57f4f77
rename sublet
jonrxu Mar 13, 2024
cb009c3
added form stuff
jonrxu Mar 15, 2024
a556c8a
delete files
jonrxu Mar 15, 2024
a503a7c
now working images loading into property list
jonrxu Mar 15, 2024
9891a5b
property form edits
jonrxu Mar 17, 2024
0a04f73
update
jonrxu Mar 17, 2024
fdf0ed9
property form update
jonrxu Mar 20, 2024
5820e2d
finished form without image, now adding backend route
jonrxu Mar 20, 2024
63eadcd
working changes
jonrxu Mar 22, 2024
9e5e517
image stuff
jonrxu Mar 22, 2024
6e51a63
update components 3/24
jonrxu Mar 24, 2024
8bdf3a1
delete placeholder
jonrxu Mar 24, 2024
4464ddc
fixed image resizing for dashboard
jonrxu Mar 24, 2024
b49a819
minor fixes
jonrxu Mar 24, 2024
0f0c156
form image fix
jonrxu Mar 24, 2024
144089b
changed property layout
jonrxu Mar 24, 2024
fc1a22e
fix ping
jonrxu Mar 24, 2024
ebb9d45
minor formatting changes
jonrxu Mar 24, 2024
860329a
stuff
jonrxu Mar 29, 2024
2525863
added create property image
jonrxu Mar 29, 2024
f7afd50
csrftoken method
jonrxu Apr 5, 2024
c990e3a
create property image
jonrxu Apr 5, 2024
bf51547
property form add image
jonrxu Apr 5, 2024
cf7f3dc
add generic api request function
jonrxu Apr 5, 2024
47eeed4
refactored fetch requests into separate method
jonrxu Apr 5, 2024
ce9e9ab
added all api requests
jonrxu Apr 12, 2024
699700f
modified next config
jonrxu Apr 14, 2024
a8161b4
sync
jonrxu Apr 14, 2024
6532ed0
temp commit
jonrxu Sep 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ A web-based portal for organizations to reach Penn Mobile users.
you should be able to see the site at `localhost:3000`!
1. The backend should be running at `localhost:8000`. We proxy all requests from localhost:3000/api to localhost:8000/api (in `frontend/server.js`), so you can make requests to the backend from the frontend. If you want to directly see what the request should return, you can go to `localhost:8000/api/...` to see the response.
1. There's also some jankiness with login since we make requests to clubs and accounts -- for login to work in your dev environment, you'll need to go to `localhost:8000/admin` and add a valid access token (make sure the expiration date is some day in the far future).

kek
3 changes: 3 additions & 0 deletions sublet/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions sublet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
11 changes: 11 additions & 0 deletions sublet/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.12"
24 changes: 24 additions & 0 deletions sublet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Penn Mobile Subletting Feature

Welcome to the Penn Mobile Subletting Feature! This innovative marketplace is designed to enhance the subletting experience for the University of Pennsylvania community, offering a user-friendly platform to browse, create, and manage sublet listings with ease.

## Features

- **Marketplace Dashboard:** Browse through a wide range of sublet listings in a user-friendly dashboard. Find the perfect match for your subletting needs with detailed information and intuitive navigation.

- **Personal Listings Management:** Have complete control over your listings through your personal dashboard. Create new listings, edit existing ones, and manage all your subletting activities in one place.

- **Direct Communication:** Reach out directly to the owners of the listings you are interested in. Our platform facilitates seamless communication between parties to ensure smooth transactions.

- **User-Friendly Interface:** Built with the Next.js framework and styled using Tailwind CSS along with ShadCN for a modern, responsive design that enhances user experience across devices.

## Getting Started

To run the Penn Mobile Subletting Feature locally, just do:

`npm run dev`


## Attributions

Font: [Satoshi](https://www.fontshare.com/fonts/satoshi) by Indian Type Foundry (ITF) - [ITF Free Font License (FFL)](https://www.fontshare.com/licenses/itf-free-font-license)
9 changes: 9 additions & 0 deletions sublet/app/create/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

const CreateListing = () => {
return (
<div>CreateListing</div>
)
}

export default CreateListing
78 changes: 78 additions & 0 deletions sublet/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"use client";

import { useState, useEffect } from "react";

import { fetchProperties } from "../../services/propertyService";
import { PropertyInterface } from "@/interfaces/Property";

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";

import { Button } from "@/components/ui/button";

import { PlusIcon } from "lucide-react";

import PropertyList from "@/components/custom/PropertyList";

import PropertyForm from "@/components/custom/PropertyForm";
import { AspectRatio } from "@/components/ui/aspect-ratio";
import Image from "next/image";

const Dashboard = () => {
const [properties, setProperties] = useState<PropertyInterface[]>([]);

useEffect(() => {
fetchProperties()
.then((data) => {
setProperties(data);
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fetchProperties().then(setProperties); should also work

.catch((error) => {
console.error("Error fetching properties:", error);
});
}, []);

return (
<div className="">

<Tabs defaultValue="posted" className="">

<div className="w-screen flex justify-end p-6 gap-4">
<TabsList>
<TabsTrigger value="posted">Posted</TabsTrigger>
<TabsTrigger value="drafts">Drafts</TabsTrigger>
</TabsList>
<PropertyForm onNewProperty={setProperties}>
<Button className="p-2 rounded-full">
<PlusIcon className="w-5" />
</Button>
</PropertyForm>
</div>


<TabsContent value="posted" className="p-5">
<div className="px-10 max-md:px-0">
<div className="space-y-12">
<h1 className="text-4xl tracking-tight font-bold">
My Listings
</h1>
<PropertyList properties={properties} />
</div>
</div>
</TabsContent>


<TabsContent value="drafts" className="p-5">
<div className="items-center flex flex-col justify-center px-10 max-md:px-0">
<div className="space-y-12">
<h1 className="text-4xl tracking-tight font-bold">
My Drafts
</h1>
<PropertyList properties={properties} />
</div>
</div>
</TabsContent>
</Tabs>
</div>
);
};

export default Dashboard;
77 changes: 77 additions & 0 deletions sublet/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 4% 16%;

--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;

--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;

--primary: 219 100% 69%;
--primary-foreground: 0 0% 98%;

--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;

--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;

--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;

--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;

--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 219 92% 58%;

--radius: 0.5rem;
}

.dark {
--background: 240 10% 3.9%;
--foreground: 0 0% 98%;

--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;

--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;

--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;

--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;

--muted: 240 3.7% 15.9%;
--muted-foreground: 240 5% 64.9%;

--accent: 240 3.7% 15.9%;
--accent-foreground: 0 0% 98%;

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;

--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 240 4.9% 83.9%;
}
}

@layer base {
* {
@apply border-border;
}

body {
@apply bg-background text-foreground;
}
}
36 changes: 36 additions & 0 deletions sublet/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { Metadata } from "next";

import localFont from "next/font/local";
//import { Inter } from "next/font/google";
import "./globals.css";

//const inter = Inter({ subsets: ["latin"] });

import { Toaster } from "@/components/ui/toaster"

const satoshi = localFont({
src: '../fonts/satoshi/Satoshi-Variable.woff2',
display: 'swap',
})

export const metadata: Metadata = {
title: "Sublet@Portal",
description: "Welcome to Sublet@Portal. The best place to sublet your room to other students!",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={satoshi.className}>
<div className="">
{children}
</div>
<Toaster />
</body>
</html>
);
}
19 changes: 19 additions & 0 deletions sublet/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Image from "next/image";

export default function Home() {
return (
<main className="space-y-10">
<h1 className="mt-40 text-5xl font-bold text-center tracking-tight text-white">
<span className="bg-gradient-to-r from-purple-500 to-pink-500 bg-clip-text text-transparent">
Welcome to Sublet@Portal
</span>
</h1>
<div className="space-y-5">
<div className="flex justify-center">
<Image src="/penn-mobile.svg" alt="Sublet@Portal Logo" width={200} height={200} />
</div>
<p className="text-center">The best place to sublet your room to other students!</p>
</div>
</main>
);
}
17 changes: 17 additions & 0 deletions sublet/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "app/globals.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
Loading
Loading