Skip to content

Commit

Permalink
fix: web modules
Browse files Browse the repository at this point in the history
  • Loading branch information
arichard-info committed Sep 4, 2024
1 parent 0260703 commit f6fefcb
Show file tree
Hide file tree
Showing 120 changed files with 3,548 additions and 5 deletions.
95 changes: 95 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion steps/00.00-sfeir-people-demo/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiUrl = new URL(process.env.API_BASE_URL);
const apiUrl = new URL(process.env.API_BASE_URL || 'http://localhost:3001');

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
2 changes: 1 addition & 1 deletion steps/02.01-pages-layout-solution/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiUrl = new URL(process.env.API_BASE_URL);
const apiUrl = new URL(process.env.API_BASE_URL || 'http://localhost:3001');

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
2 changes: 1 addition & 1 deletion steps/02.01-pages-layout/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiUrl = new URL(process.env.API_BASE_URL);
const apiUrl = new URL(process.env.API_BASE_URL || 'http://localhost:3001');

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
2 changes: 1 addition & 1 deletion steps/02.02-navigation-solution/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiUrl = new URL(process.env.API_BASE_URL);
const apiUrl = new URL(process.env.API_BASE_URL || 'http://localhost:3001');

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
2 changes: 1 addition & 1 deletion steps/02.02-navigation/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const apiUrl = new URL(process.env.API_BASE_URL);
const apiUrl = new URL(process.env.API_BASE_URL || 'http://localhost:3001');

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
2 changes: 2 additions & 0 deletions steps/03.01-server-components-solution/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_BASE_URL=http://localhost:3001
API_KEY=XXXX
3 changes: 3 additions & 0 deletions steps/03.01-server-components-solution/.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 steps/03.01-server-components-solution/.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
36 changes: 36 additions & 0 deletions steps/03.01-server-components-solution/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
5 changes: 5 additions & 0 deletions steps/03.01-server-components-solution/logs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"date":"1725279539109","search":"","results":10}
{"date":"1725279541415","search":"e","results":8}
{"date":"1725279542139","search":"ea","results":1}
{"date":"1725279545021","search":"cas","results":1}
{"date":"1725279546930","search":"rienrginerg","results":0}
15 changes: 15 additions & 0 deletions steps/03.01-server-components-solution/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const apiUrl = new URL(process.env.API_BASE_URL || 'http://localhost:3001');

/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
hostname: apiUrl.hostname,
port: apiUrl.port,
},
],
},
};

export default nextConfig;
38 changes: 38 additions & 0 deletions steps/03.01-server-components-solution/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "03.01-solution",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"bright": "^0.8.5",
"clsx": "^2.1.1",
"jose": "^5.6.3",
"jsonwebtoken": "^9.0.2",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18",
"react-error-boundary": "^4.0.13",
"rehype-sanitize": "^6.0.0",
"rehype-stringify": "^10.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.0",
"server-only": "^0.0.1",
"showdown": "^2.1.0",
"unified": "^11.0.5"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.6",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/showdown": "^2.0.6",
"eslint": "^8",
"eslint-config-next": "14.2.5",
"typescript": "^5"
}
}
6 changes: 6 additions & 0 deletions steps/03.01-server-components-solution/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
1 change: 1 addition & 0 deletions steps/03.01-server-components-solution/public/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions steps/03.01-server-components-solution/public/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions steps/03.01-server-components-solution/src/app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type AuthLayoutProps = {
children: React.ReactNode;
};

const AuthLayout: React.FC<AuthLayoutProps> = ({ children }) => (
<div className="flex min-h-screen bg-white dark:bg-slate-950 dark:text-white">
<div className="w-1/3 bg-blue-500 dark:bg-blue-800"></div>
<div className="w-2/3 flex flex-col">{children}</div>
</div>
);

export default AuthLayout;
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Metadata } from 'next';

import TextField from '@/components/TextField';
import Button from '@/components/Button';

export const metadata: Metadata = {
title: 'SFEIR People | Login',
};

const LoginPage = () => {
return (
<form className="w-full max-w-md m-auto">
<h1 className="text-2xl font-bold mb-4">Welcome !</h1>
<TextField type="text" id="username" name="username" label="Username" placeholder="Username" autoComplete="off" />
<TextField
type="password"
id="password"
name="password"
label="Password"
placeholder="Password"
className="mt-4"
/>
<Button variant="primary" type="submit" className="mt-4">
Login
</Button>
</form>
);
};

export default LoginPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import EmployeeForm from '@/components/EmployeeForm';
import PageTitle from '@/components/PageTitle';

import employeesData from '@/data/employees.json';

const EmployeeDetail = async ({ params }: { params: { id: string } }) => {
const employee = employeesData.find((employee) => employee.id === params.id);

if (!employee) return <PageTitle>Single Employee - Not found</PageTitle>;

return (
<>
<PageTitle backHref={`/employees/${params.id}`}>
Single Employee - {employee.firstname} {employee.lastname} <span className="font-normal">| Edit</span>
</PageTitle>

<div className="flex gap-4 bg-white p-4 rounded-lg dark:bg-slate-900">
<EmployeeForm className="w-full" employee={employee} />
</div>
</>
);
};

export default EmployeeDetail;
Loading

0 comments on commit f6fefcb

Please sign in to comment.