Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
a14913d
Add initial Express and HTTP server implementations
Code-lab-web May 26, 2025
5a87cee
Add unit tests for greet function
Code-lab-web May 26, 2025
567f00f
Add initial test file for multiplication functionality
Code-lab-web May 26, 2025
a52f9af
Add tests for multiplication function and implement firstLast utility
Code-lab-web May 26, 2025
ce09589
Add express-list-endpoints import to server.js
Code-lab-web May 28, 2025
240d036
Update root route response to include welcome message and list endpoints
Code-lab-web May 28, 2025
cfd944b
Update .gitignore and package.json to include dotenv and mongodb depe…
Code-lab-web May 28, 2025
dd91885
git commit -m "Code-lab-web"
Code-lab-web May 28, 2025
611b809
Add utility functions for string manipulation and update related tests
Code-lab-web May 28, 2025
fe92028
Merge branch 'master' of https://github.com/Code-lab-web/express-api-…
Code-lab-web May 28, 2025
23a8569
Merge branch 'master' of https://github.com/Code-lab-web/express-api-…
Code-lab-web May 28, 2025
6566d8b
Add initial data.json file
Code-lab-web May 28, 2025
882ba7a
Fix import statements and add data endpoint to serve JSON data
Code-lab-web May 28, 2025
8d06175
Add endpoint to retrieve data by ID and log request parameters
Code-lab-web May 28, 2025
128c4a8
git "Code-lab-web"
Code-lab-web May 30, 2025
863c839
git commit -m "Code-lab-web"
Code-lab-web May 29, 2025
9219214
git commit -m "Code-lab-web"
Code-lab-web May 30, 2025
bb1a784
Add express-list-endpoints integration and update endpoint response s…
Code-lab-web May 30, 2025
7c84814
Fix import statement formatting in multiplication test
Code-lab-web May 30, 2025
27063a2
git commit -m "Code-lab-web"
Code-lab-web May 30, 2025
8a3b3d1
git commit -m "Code-lab-web"
Code-lab-web May 30, 2025
f11dc62
git commit -m "Code-lab-web"
Code-lab-web May 30, 2025
0b6d430
Add express-list-endpoints functionality with TypeScript definitions
Code-lab-web May 30, 2025
20fe2f9
git commit -m "Code-lab-web"
Code-lab-web May 30, 2025
a60837c
git commit -m "Code-lab-web"
May 29, 2025
73dc0ed
Code-lab-web
May 29, 2025
348bf40
git commit -m "Code-lab-web"
May 30, 2025
68c6bbd
git commit -m "Code-lab"
May 30, 2025
2855c06
Merge remote-tracking branch 'origin/HEAD'
May 31, 2025
f63f125
Refactor babel-node and nodemon binaries to use symlinks
Code-lab-web Jun 3, 2025
9499b77
Fix route handling and improve endpoint responses in server.js
Code-lab-web Jun 3, 2025
3523b2b
git commit -m "Code-lab-web"
Code-lab-web Jun 3, 2025
d753ea6
Add redirects for various paths in _redirects.md
Code-lab-web Jun 3, 2025
a85f955
Add PBS scripts and cleanup utility for MongoDB stress testing
Code-lab-web Jun 3, 2025
f1d9d96
Implement thoughts API with database seeding and error handling
Code-lab-web Jun 3, 2025
b8aaa4d
Implement feature enhancements and optimize performance across the ap…
Code-lab-web Jun 4, 2025
e2f7340
Fix typo in Thought model definition in server.js
Code-lab-web Jun 4, 2025
4b9a476
Fix mongoose model definition and add PATCH endpoint for updating tho…
Code-lab-web Jun 4, 2025
62c23c8
git commit -m "Code-lab-web"
Code-lab-web Jun 4, 2025
32ecaaf
Add client-server authentication implementation with socket programming
Code-lab-web Jun 4, 2025
6042061
Add Person model definition with validation for name and height
Code-lab-web Jun 4, 2025
ce5161b
Fix formatting issues in server.js and add body-parser middleware for…
Code-lab-web Jun 4, 2025
b529b46
Update .gitignore, add new dependencies in package.json, and implemen…
Code-lab-web Jun 4, 2025
45b53db
Refactor server.js for improved error handling and code consistency; …
Code-lab-web Jun 4, 2025
0adb937
Add Task model with validation and connect to MongoDB in server.js
Code-lab-web Jun 4, 2025
da96440
Add endpoint to retrieve all tasks, sorted by creation date
Code-lab-web Jun 4, 2025
6b45b0b
Refactor POST endpoint for creating a person to use async/await and i…
Code-lab-web Jun 5, 2025
65c022f
Add POST endpoint for creating tasks with error handling
Code-lab-web Jun 5, 2025
43d9059
Migrate application to React; implement fetching and posting of thoughts
Code-lab-web Jun 5, 2025
f3826c4
Add React and dom packages to dependencies; update package-lock.json
Code-lab-web Jun 5, 2025
152259c
Add Header component with buttons for removing all thoughts and reset…
Code-lab-web Jun 5, 2025
86eeb34
Add Thought component with message display, like, and delete buttons
Code-lab-web Jun 5, 2025
511035d
Add ThoughtForm component for submitting new thoughts
Code-lab-web Jun 5, 2025
b48fcc5
Add ThoughtList component to display a list of thoughts
Code-lab-web Jun 5, 2025
ddc9399
Add App.css for styling components with light and dark themes
Code-lab-web Jun 5, 2025
e0d2329
Refactor App component to integrate Header, ThoughtForm, and ThoughtL…
Code-lab-web Jun 5, 2025
5228ef4
Add main.jsx to define App component structure with Header, ThoughtFo…
Code-lab-web Jun 5, 2025
c6024ad
Add Vite as a development dependency for improved build performance
Code-lab-web Jun 5, 2025
effbc7c
Update Babel dependency to version 6.23.0 and adjust babel-node path
Code-lab-web Jun 5, 2025
1c30e5d
Update README.md to include React and Vite setup instructions and ESL…
Code-lab-web Jun 5, 2025
e121f9c
Add ESLint configuration for JavaScript and React with recommended rules
Code-lab-web Jun 5, 2025
b06419f
Add index.html file with basic structure for the application
Code-lab-web Jun 5, 2025
687460f
Add Vite configuration file for React application setup
Code-lab-web Jun 5, 2025
bceadd9
Add Zustand store for managing thoughts with createThought functionality
Code-lab-web Jun 5, 2025
2699c76
Add Zustand as a dependency and update package-lock.json
Code-lab-web Jun 5, 2025
8de864e
Update index.html to improve structure and include stylesheets
Code-lab-web Jun 5, 2025
bcd89f1
Add form.css for card styling and animations
Code-lab-web Jun 5, 2025
327ce91
Add Card component with props for title, description, icon, and selec…
Code-lab-web Jun 5, 2025
808919c
Add Card.css for styling and animations of Card component
Code-lab-web Jun 5, 2025
b7805cc
Add form.jsx for card component styling and animations
Code-lab-web Jun 5, 2025
d0c62cb
Refactor form.jsx to import styles from form.css
Code-lab-web Jun 5, 2025
ece42af
Add animation component with basic structure and CSS import
Code-lab-web Jun 5, 2025
c20c320
Add global styles and animations in animation.css
Code-lab-web Jun 5, 2025
5732b0e
git commit -m "Code-lab-web"
Code-lab-web Jun 5, 2025
8fba23f
Add devDependencies for ESLint and TypeScript
Code-lab-web Jun 5, 2025
9b5555b
Add ESLint configuration with TypeScript support
Code-lab-web Jun 5, 2025
7e53ad8
Add atlas package as a dependency and update package-lock.json
Code-lab-web Jun 5, 2025
3a2b2bf
Update Babel dependencies and fix minor issues in helper functions
Code-lab-web Jun 5, 2025
7a1459a
Fix formatting in server.js and add color filter to query
Code-lab-web Jun 5, 2025
25d60e5
Fix indentation in server.js for better readability
Code-lab-web Jun 5, 2025
d2f7dd3
Add render and traverser packages to dependencies in package.json and…
Code-lab-web Jun 5, 2025
f0a0ee5
Add crypto dependency and implement User model with access token gene…
Code-lab-web Jun 9, 2025
38b2fa9
Add python package to dependencies in package.json and package-lock.json
Code-lab-web Jun 9, 2025
47f4a5f
Implement one-way encryption for user passwords and save a sample use…
Code-lab-web Jun 9, 2025
d27521a
Add example for user password encryption and comparison in server.js
Code-lab-web Jun 9, 2025
b5d7318
Add session handling for user authentication with password verification
Code-lab-web Jun 9, 2025
04edbd7
Add authentication middleware to verify user access token
Code-lab-web Jun 9, 2025
13f7bce
Fix syntax errors and improve MongoDB connection handling in server.js
Code-lab-web Jun 9, 2025
c438ded
Add bcrypt and bcrypt-nodejs dependencies to enhance password handling
Code-lab-web Jun 9, 2025
afead65
Add comment to ensure MONGO_URL environment variable is set before ru…
Code-lab-web Jun 9, 2025
1715fcf
Add Netlify configuration for frontend build and redirects
Code-lab-web Jun 9, 2025
eaac9a7
Add project metadata and postinstall script to package.json
Code-lab-web Jun 9, 2025
3c1c5c8
Remove placeholder project name and postinstall script from package.json
Code-lab-web Jun 9, 2025
9ebcd2a
Add blank line for improved readability in launch.json
Code-lab-web Jun 9, 2025
7d6b551
git commit -m "Code-lab-web"
Code-lab-web Jun 9, 2025
3f595dd
Merge branch 'master' of https://github.com/Code-lab-web/express-api-…
Code-lab-web Jun 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
36 changes: 36 additions & 0 deletions ## GitHub Copilot Chat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## GitHub Copilot Chat

- Extension Version: 0.23.2 (prod)
- VS Code: vscode/1.96.4
- OS: Linux

## Network

User Settings:
```json
"github.copilot.advanced.debug.useElectronFetcher": true,
"github.copilot.advanced.debug.useNodeFetcher": false,
"github.copilot.advanced.debug.useNodeFetchFetcher": true
```

Connecting to https://api.github.com:
- DNS ipv4 Lookup: timed out after 10 seconds
- DNS ipv6 Lookup: Error (8 ms): getaddrinfo ENOTFOUND api.github.com
- Proxy URL: None (2 ms)
- Electron fetch (configured): timed out after 10 seconds
- Node.js https: timed out after 10 seconds
- Node.js fetch: timed out after 10 seconds
- Helix fetch: timed out after 10 seconds

Connecting to https://api.individual.githubcopilot.com/_ping:
- DNS ipv4 Lookup: timed out after 10 seconds
- DNS ipv6 Lookup: timed out after 10 seconds
- Proxy URL: None (16 ms)
- Electron fetch (configured): timed out after 10 seconds
- Node.js https: timed out after 10 seconds
- Node.js fetch: timed out after 10 seconds
- Helix fetch: timed out after 10 seconds

## Documentation

In corporate networks: [Troubleshooting firewall settings for GitHub Copilot](https://docs.github.com/en/copilot/troubleshooting-github-copilot/troubleshooting-firewall-settings-for-github-copilot).
23 changes: 23 additions & 0 deletions .codesandbox/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// These tasks will run in order when initializing your CodeSandbox project.
"setupTasks": [
{
"command": "pnpm install",
"name": "Installing Dependencies"
}
],

// These tasks can be run from CodeSandbox. Running one will open a log in the app.
"tasks": {
"start": {
"name": "start",
"command": "pnpm start",
"runAtStart": false
},
"dev": {
"name": "dev",
"command": "pnpm dev",
"runAtStart": true
}
}
}
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
node_modules
.DS_Store
n.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
package-lock.json
package-lock.json
node_modules
node_modules
55 changes: 55 additions & 0 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn more about how to use Nix to configure your environment
# see: https://firebase.google.com/docs/studio/customize-workspace
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-24.05"; # or "unstable"

# Use https://search.nixos.org/packages to find packages
packages = [
# pkgs.go
# pkgs.python311
# pkgs.python311Packages.pip
# pkgs.nodejs_20
# pkgs.nodePackages.nodemon
];

# Sets environment variables in the workspace
env = {};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
# "vscodevim.vim"
];

# Enable previews
previews = {
enable = true;
previews = {
# web = {
# # Example: run "npm run dev" with PORT set to IDX's defined port for previews,
# # and show it in IDX's web preview panel
# command = ["npm" "run" "dev"];
# manager = "web";
# env = {
# # Environment variables to set for your server
# PORT = "$PORT";
# };
# };
};
};

# Workspace lifecycle hooks
workspace = {
# Runs when a workspace is first created
onCreate = {
# Example: install JS dependencies from NPM
# npm-install = "npm install";
};
# Runs when the workspace is (re)started
onStart = {
# Example: start a background task to watch and re-build backend code
# watch-backend = "npm run watch-backend";
};
};
};
}
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [


{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"IDX.aI.enableInlineCompletion": true,
"IDX.aI.enableCodebaseIndexing": true
}
7 changes: 7 additions & 0 deletions 1-multiplication.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { multiply } from './1-multiplication';

describe('multiplication', () => {
it('should multiply two numbers correctly', () => {
expect(multiply(2, 3)).toBe(6);
});
});
4 changes: 4 additions & 0 deletions 2-first-last.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const firstLast = (items) => {
return 'First: ${items[0]}, Last: ${items[items[1]}'

}
72 changes: 72 additions & 0 deletions App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#root {
margin: 0 auto;
}

body {
margin: 0;
font-family: "Montserrat";
}

h1, section, header {
padding: 2rem;
}

.light {
background: aquamarine;
color: rgb(0, 24, 164);
}

.dark {
background: rgb(0, 24, 164);
color: aquamarine;
}

button {
padding: 18px;
border-radius: 30px;
border: 0;
background: hotpink;
color: white;
font-size: 16px;
font-weight: bold;
font-family: "Montserrat";
margin-right: 0.5rem;
}

select {
border: none;
border-radius: 4px;
color: rgb(0, 24, 164);
font-size: 16px;
font-weight: 600;
height: 40px;
font-family: 'Montserrat';
padding: 0 20px;
cursor: pointer;

-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}

main {
padding: 2rem;
}

.thought {
border: 2px solid blue;
padding: 1rem;
margin-bottom: 1rem;
}

form {
display: flex;
flex-direction: column;
width: 200px;
padding-bottom: 2rem;
}

textarea {
height: 100px;
margin-bottom: 1rem;
}
17 changes: 17 additions & 0 deletions App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Header } from "./components/Header"
import { ThoughtForm } from "./components/ThoughtForm"
import { ThoughtList } from "./components/ThoughtList"

import "./App.css"

export const App = () => {
return (
<>
<Header />
<main>
<ThoughtForm />
<ThoughtList />
</main>
</>
)
}
126 changes: 126 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import React, { useState } from 'react';
import { useEffect } from 'react';
import Card from './Card.tsx';
import './index.css'
import './components/Card.css'
import './components/Card.tsx'
import './components/Card.jsx'
import './components/form.jsx'
import './components/index.json'
import './components/main.tsx'
import './components/App.css'
import './components/App.js'
import './components/App.jsx'
import './components/index.css'
import './components/index.js'
import './components/tests.ts'
import './components/index.html'
import './components/tests.tsx'
import './form.css';
// import { Form } from './form' // Removed as 'Form' is not exported from './form'
import './App.css';
import './index.css';
import { main } from './main.jsx';
import Main from './main.tsx';

fetch ("https://happy-thoughts-ux7hkzgmwa-uc.a.run.app/thoughts")
fetch ("https://happy-thoughts-ux7hkzgmwa-uc.a.run.app/thoughts/THOUGHT_ID/like")
const [thoughts, setThoughts] = useState<{ message: string }[]>([])
const handleFormSubmit = (event) => {
event.preventDefault()
fetch("<https://technigo-thoughts.herokuapp.com/>", {
method: "POST",
body: JSON.stringify({
message: "Hello world",
}),
headers: { "Content-Type": "application/json" },
})
.then((res) => res.json())
.then((newThought) => {
setThoughts((previousThoughts) => [newThought, ...previousThoughts])
})
}


// if creating a Review as an object
interface Review {
id: number;
text: string;
dessert: string;
}

const App = () => {
const [selectedCard, setSelectedCard] = useState<string>('');
const [reviews, setReviews] = useState<Review[]>([]); // if implementing an array of reviews
const [review, setReview] = useState(''); // if implementing one review only, as string.
const [reviewText, setReviewText] = useState('');

const handleCardSelect = (title: string) => {
setSelectedCard(title);
};

// setting a signle review as a text, then clearing the text area
const handleReviewSubmit = (e: React.FormEvent) => {
e.preventDefault(); // stop from doing its default re render here.
setReview(reviewText);
setReviewText('');
};

return (
<main className="app">
<div className="card-container">
<Card
title="Message App"
description="A simple message app"
icon="/images/message.svg"
color="all"
isSelected={selectedCard === "Message App"}
onSelect={() => handleCardSelect("Message App")}
/>
</div>


<div className="message-section">
<h2>Write a message</h2>
<form onSubmit={handleReviewSubmit} className="message-form">
<textarea
value={reviewText}
onChange={(e) => setReviewText(e.target.value)}
placeholder={`Write a thought for ${selectedCard || 'your thought'}...`}
className="review-input"
disabled={!selectedCard} // not able to write anything if not selected a message.
/>
<button
type="submit"
className="send"
disabled={!selectedCard || !reviewText.trim()} // button is disabled if no text or not selected a card
>
Send
</button>
</form>

<div className="send-container">

<h3>Recent message</h3>
<p className="message-text">{review}</p>




{/* IF creating an array of message with richer info, this is how to loop through and display them
<h3>Recent Message</h3>
{message.map(message => (
<div key={message.id} className="message-card">
<span className="Message-App">{message.app}</span>
<p className="message-text">{message.text}</p>
</div>
))} */}
</div>
</div>


</main>
)
}

export default App
Loading