Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Build vite page
run: |
cd client
npm i
npm install
npm run build

test:
Expand All @@ -41,11 +41,11 @@ jobs:

- name: Install dependencies
run: |
npm i
npm install
cd server
npm i
npm install
cd ../client
npm i
npm install

- name: Create server env file
run: |
Expand Down
42 changes: 23 additions & 19 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,30 @@ function AppContent() {
}, []);

return (
<div className="App">
<header className="App-header"></header>
{session ? (
<>
<h1>Soundscape</h1>
<MapView latestPost={latestPost} feedRefresh={feedRefresh} />
<MakePost onPostCreated={handleNewPost} userIdStr={userId}/>
<LogoutButton />
</>
) : (
<div className="landing-page">
<div className="landing-bg">
<div className="landing-content">
<h1>Soundscape</h1>
<p>Soundscape is a music-sharing social platform that creates a map-based feed of music sharing personal moments. This enables users to discover music through friend's real world experiences.</p>
<Login />
<div className="App">
<header className="App-header"></header>
{session ? (
<>
<h1>Soundscape</h1>
<MapView latestPost={latestPost} feedRefresh={feedRefresh} />
<MakePost onPostCreated={handleNewPost} />
<LogoutButton />
</>
) : (
<div className="landing-page">
<div className="landing-bg">
<div className="landing-content">
<h1>Soundscape</h1>
<p>
Soundscape is a music-sharing social platform that creates a map-based
feed of music sharing personal moments. This enables users to discover
music through friend's real world experiences.
</p>
<Login />
</div>
</div>
</div>
</div>
</div>
)}
)}
</div>
);
}
Expand Down
2 changes: 0 additions & 2 deletions client/src/MakePost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ interface PostProp {
position: [number, number];
timestamp: number;
}) => void;
userIdStr: string;
}
const MakePost = ({ onPostCreated, userIdStr}: PostProp) => {
const [userId, setUserId] = useState<string>(userIdStr);
const [isOpen, setIsOpen] = useState(false);
const [songName, setSongName] = useState("");
const [artistName, setArtistName] = useState("");
Expand Down
5 changes: 2 additions & 3 deletions client/src/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ L.Icon.Default.mergeOptions({

interface PostProp {
latestPost: {
feedRefresh: number;
songName: string;
artistName: string;
comment: string;
Expand All @@ -35,7 +34,7 @@ type FeedPost = {
postid: number;
userid: string;
time: string;
location: string; // e.g. "(44.565,-123.276)"
location: string;
comment: {
songTitle?: string;
artistName?: string;
Expand Down Expand Up @@ -95,9 +94,9 @@ function MapView({ latestPost, feedRefresh }: PostProp) {
}

const data: FeedPost[] = await res.json();
console.log("Feed data from backend:", data);
setFeedPosts(data);

setFeedPosts(data);
} catch (err) {
console.error("Failed to fetch feed:", err);
}
Expand Down
6 changes: 3 additions & 3 deletions env-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if [ ! -f "server/.env" ] || [ ! -f "client/.env" ]; then

# create HTTPS keys
pass=$(getHTTPSPassword)
$(generateHTTPSKeyAndCert $pass)
generateHTTPSKeyAndCert "$pass"

# write server env file
port="8000"
Expand All @@ -67,7 +67,7 @@ if [ ! -f "server/.env" ] || [ ! -f "client/.env" ]; then
echo "# .env" >> client/.env
echo "VITE_PUBLIC_SUPABASE_URL=$supabaseUrl" >> client/.env
echo "VITE_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=$supabaseKey" >> client/.env
echo "VITE_SERVER_URL=https://localhost:8000" >> client/.env
echo "VITE_SERVER_URL=http://localhost:8000" >> client/.env
echo "VITE_COOKIE_HOST_URL=.localhost" >> client/.env

# check HTTPS certifications
Expand All @@ -78,7 +78,7 @@ elif [ ! -f "server/cert.pem" ] || [ ! -f "server/key.pem" ]; then
passEnvLine=$(grep "HTTPS_KEY_PASSPHRASE=" server/.env)

# get password for keys
if [ -z passEnvLine ]; then
if [ -z "$passEnvLine" ]; then
pass=$(getHTTPSPassword)

echo "HTTPS_KEY_PASSPHRASE=$pass" >> server/.env
Expand Down
Loading