Skip to content

Feat - backend api integration #634

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

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4fca0f2
feat: initalizes setup for api and cd app
Dlafferty251 May 5, 2025
905d3a8
feat: implements custom css file and website replica (#555)
karensprojects22 May 5, 2025
07cf85e
feat: adds Jason's CSS implementation (#554)
jxwatson251 May 5, 2025
a8242fb
feat: adds Evan's CSS implementation (#553)
TatsuyaRyujin May 5, 2025
adaac4b
feat: adds Meiko's style.css implementation (#552)
Meiko-S22 May 5, 2025
66340b6
feat: adds Dylan's CSS implementation (#551)
Dlafferty251 May 5, 2025
9ae9f32
feat: adds Montez's CSS implementation (#550)
Tezz03 May 5, 2025
48a26d9
feat: adds Mercedes' completed style.css (#548)
mercedes-mathews May 5, 2025
3e6439a
feat: adds Ezra's css implementation (#556)
enyabuti May 6, 2025
06ab66c
feat: adds John's css implementation (#558)
jbey251 May 6, 2025
271e60d
feat: adds Justin's css implementation (#559)
JEKLUND251 May 6, 2025
a452657
feat: adds Bryana's css implementation (#560)
bryanasb251 May 6, 2025
d5ca961
feat: adds Khayla's Styled CSS Assignment (#561)
kksaunders251 May 6, 2025
1199086
feat: adds Rasheed's styles.css implementation (#562)
RMillerCohort251 May 6, 2025
e111ef1
feat: adds Davis css implementation (#563)
DavisD251 May 6, 2025
59ef448
feat: add Nia's css implementation (#564)
nia-source May 6, 2025
80b3758
feat: adds Olivia's style.css implementation (#567)
OliviaxJames May 6, 2025
6f362da
feat: adds David's style.css implementation (#569)
Dadenaike251 May 6, 2025
3620f47
feat: adds A'nanatawa's finished style.css (#584)
Ananatawa May 6, 2025
c217f5b
feat: adds Dylan's express demo clone (#570)
Dlafferty251 May 6, 2025
37fba97
feat: adds Rasheed's web server (#571)
RMillerCohort251 May 6, 2025
8af5b7b
feat: implements Meiko's express web server (#572)
Meiko-S22 May 6, 2025
665926b
docs: clarisifes lesson_24 requirements (#615)
anthonydmays May 6, 2025
f514ed2
feat: adds Nana's express web server (#573)
Ananatawa May 6, 2025
fd583d5
feat: adds Montez's express web server (#574)
Tezz03 May 6, 2025
47cdb69
feat: adds John's express server (#575)
jbey251 May 6, 2025
81442e7
feat: adds Jason's express web server (#576)
jxwatson251 May 6, 2025
7d443b3
feat: adds Ezra's express web server (#577)
enyabuti May 6, 2025
b87eadd
feat: adds lesson_28 content (#616)
anthonydmays May 6, 2025
f13b617
fix: adds assignment README update and fixes lombok issue (#618)
anthonydmays May 6, 2025
abf66d7
docs: updates requirement for clarity (#620)
anthonydmays May 7, 2025
3cc62e9
docs: fix links in syllabus (#622)
anthonydmays May 7, 2025
475ca0a
feat: adds Mercedes' web server implementation (#578)
mercedes-mathews May 8, 2025
4efe06d
feat: adds Chanel's web server implementation (#579)
NelltheWiz May 8, 2025
44ca5b7
feat: adds Khayla's express web server implementation (#581)
kksaunders251 May 8, 2025
fe93d38
feat: add John's program list components (#587)
jbey251 May 8, 2025
fb1b729
feat: adds Mercedes' Program and ProgramList components and AddProgra…
mercedes-mathews May 8, 2025
be4006c
feat: adds Dylan's react component implementations (#589)
Dlafferty251 May 8, 2025
01d0ed1
feat: Implement feature that GET a list of programs from api
Dlafferty251 May 8, 2025
0d3d1ac
feat: creates Program form
Dlafferty251 May 8, 2025
8888958
feat: enhance ProgramForm with styling and error/success messages
Dlafferty251 May 9, 2025
874b0ca
Merge branch 'code-differently:main' into feat-backend-api-integration
Dlafferty251 May 9, 2025
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
12 changes: 11 additions & 1 deletion lesson_27/api/src/data/programs.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
"id": "a06f970a-03b7-4cbb-9efd-f4e99029a456",
"title": "Platform Programs",
"description": "Platform programs are designed for high school graduates, college students, career changers, or professionals looking to develop the technology job readiness skills for today’s workforce."
},
{
"title": "hello",
"description": "gello",
"id": "ef4c000d-b996-417f-9bc3-ae5354ccab4e"
},
{
"title": "we cooking",
"description": "we cooking with chatgbt",
"id": "10e4090e-7664-401f-b3d5-4169439110b8"
}
]
}
}
2 changes: 2 additions & 0 deletions lesson_27/api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ const UUID_PATTERN =
export const createServer = (db: Db): Express => {
const app: Express = express();

// Serve static files from the public directory
app.use(express.static('public'));
app.use(express.json());
app.use(express.urlencoded({extended: true}));
app.use(cors());


app.get('/programs/:id', async (req: Request, res: Response<Program>) => {
if (!isUuidValid(req.params.id)) {
res.status(400).send();
Expand Down
24 changes: 24 additions & 0 deletions lesson_27/dylanlafferty/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
26 changes: 26 additions & 0 deletions lesson_27/dylanlafferty/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"bracketSpacing": false,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "avoid",
"importOrder": [
"<THIRD_PARTY_MODULES>",
"interface",
"(?=content|api)",
"context/",
"mock/",
"config",
"utils/",
"hooks/",
"(components/|./index)",
".svg",
"^../(.*)$",
"(?=./styles.module.scss)"
],
"endOfLine": "auto",
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": [
"@trivago/prettier-plugin-sort-imports"
]
}
9 changes: 9 additions & 0 deletions lesson_27/dylanlafferty/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
5 changes: 5 additions & 0 deletions lesson_27/dylanlafferty/cypress/e2e/create-program.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('template spec', () => {
it('passes', () => {
cy.visit('http://localhost:5173/');
});
});
5 changes: 5 additions & 0 deletions lesson_27/dylanlafferty/cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
37 changes: 37 additions & 0 deletions lesson_27/dylanlafferty/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
17 changes: 17 additions & 0 deletions lesson_27/dylanlafferty/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
8 changes: 8 additions & 0 deletions lesson_27/dylanlafferty/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
4 changes: 4 additions & 0 deletions lesson_27/dylanlafferty/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// .eslintrc.js
import eslintConfigPrettier from 'eslint-config-prettier';

export default [eslintConfigPrettier];
13 changes: 13 additions & 0 deletions lesson_27/dylanlafferty/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Code Different - Cohort 24Q1</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions lesson_27/dylanlafferty/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
testEnvironment: 'jest-fixed-jsdom',
transform: {
'^.+.tsx?$': ['ts-jest', {useESM: true}],
},
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/assets/__mocks__/fileMock.js',
},
extensionsToTreatAsEsm: ['.tsx', '.ts'],
};
Loading