Skip to content

Commit 97ec574

Browse files
committed
new day new code
1 parent 9632b78 commit 97ec574

60 files changed

Lines changed: 2635 additions & 5034 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.react-router
2+
build
3+
node_modules
4+
README.md

.env.example

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
node_modules
2-
3-
/.cache
4-
/build
5-
/public/build
6-
.env
7-
/out
8-
.nvmrc
9-
.react-router/
10-
111
.DS_Store
12-
api
2+
/node_modules/
3+
4+
# React Router
5+
/.react-router/
6+
/build/

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:20-alpine AS development-dependencies-env
2+
COPY . /app
3+
WORKDIR /app
4+
RUN npm ci
5+
6+
FROM node:20-alpine AS production-dependencies-env
7+
COPY ./package.json package-lock.json /app/
8+
WORKDIR /app
9+
RUN npm ci --omit=dev
10+
11+
FROM node:20-alpine AS build-env
12+
COPY . /app/
13+
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
14+
WORKDIR /app
15+
RUN npm run build
16+
17+
FROM node:20-alpine
18+
COPY ./package.json package-lock.json /app/
19+
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
20+
COPY --from=build-env /app/build /app/build
21+
WORKDIR /app
22+
CMD ["npm", "run", "start"]

README.md

Lines changed: 83 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,87 @@
1-
use `npx http-server --cors` to serve the files (put it somewhere locally and serve it statically)
2-
then refer to the static files dynamically. it is fast enough.
1+
# Welcome to React Router!
32

3+
A modern, production-ready template for building full-stack React applications using React Router.
44

5+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/remix-run/react-router-templates/tree/main/default)
56

7+
## Features
8+
9+
- 🚀 Server-side rendering
10+
- ⚡️ Hot Module Replacement (HMR)
11+
- 📦 Asset bundling and optimization
12+
- 🔄 Data loading and mutations
13+
- 🔒 TypeScript by default
14+
- 🎉 TailwindCSS for styling
15+
- 📖 [React Router docs](https://reactrouter.com/)
16+
17+
## Getting Started
18+
19+
### Installation
20+
21+
Install the dependencies:
22+
23+
```bash
24+
npm install
25+
```
26+
27+
### Development
28+
29+
Start the development server with HMR:
30+
31+
```bash
32+
npm run dev
33+
```
34+
35+
Your application will be available at `http://localhost:5173`.
36+
37+
## Building for Production
38+
39+
Create a production build:
40+
41+
```bash
42+
npm run build
43+
```
44+
45+
## Deployment
46+
47+
### Docker Deployment
48+
49+
To build and run using Docker:
50+
51+
```bash
52+
docker build -t my-app .
53+
54+
# Run the container
55+
docker run -p 3000:3000 my-app
56+
```
57+
58+
The containerized application can be deployed to any platform that supports Docker, including:
59+
60+
- AWS ECS
61+
- Google Cloud Run
62+
- Azure Container Apps
63+
- Digital Ocean App Platform
64+
- Fly.io
65+
- Railway
66+
67+
### DIY Deployment
68+
69+
If you're familiar with deploying Node applications, the built-in app server is production-ready.
70+
71+
Make sure to deploy the output of `npm run build`
72+
73+
```
74+
├── package.json
75+
├── package-lock.json (or pnpm-lock.yaml, or bun.lockb)
76+
├── build/
77+
│ ├── client/ # Static assets
78+
│ └── server/ # Server-side code
679
```
7-
pnpm i
8-
pnpm run dev
9-
```
80+
81+
## Styling
82+
83+
This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever CSS framework you prefer.
84+
85+
---
86+
87+
Built with ❤️ using React Router.

app/NotFound.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
3+
export default function NotFound(): React.ReactElement {
4+
return (
5+
<div>
6+
<h1>404 Not Found</h1>
7+
</div>
8+
)
9+
}

app/NotFoundPage.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/app.css

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,15 @@
11
@import "tailwindcss";
22

3-
:root {
4-
--background: #fff;
5-
--foreground: #000;
6-
--unfocused-border-color: #eaeaea;
7-
--focused-border-color: #666;
8-
9-
--button-disabled-color: #fafafa;
10-
--disabled-text-color: #999;
11-
12-
--geist-border-radius: 5px;
13-
--geist-quarter-pad: 6px;
14-
--geist-half-pad: 12px;
15-
--geist-pad: 24px;
16-
--geist-font: "Inter";
17-
18-
--geist-error: #e00;
19-
20-
--subtitle: #666;
21-
}
22-
23-
@media (prefers-color-scheme: dark) {
24-
:root {
25-
--background: #000000;
26-
--unfocused-border-color: #333;
27-
--focused-border-color: #888;
28-
--foreground: #fff;
29-
--button-disabled-color: #111;
30-
--geist-error: red;
31-
--subtitle: #8d8d8d;
32-
}
3+
@theme {
4+
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif,
5+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
336
}
347

35-
@theme {
36-
--color-foreground: var(--foreground);
37-
--color-background: var(--background);
38-
--color-unfocused-border-color: var(--unfocused-border-color);
39-
--color-focused-border-color: var(--focused-border-color);
40-
--color-button-disabled-color: var(--button-disabled-color);
41-
--color-disabled-text-color: var(--disabled-text-color);
42-
--color-geist-error: var(--geist-error);
43-
--color-subtitle: var(--subtitle);
44-
--padding-geist-quarter: var(--geist-quarter-pad);
45-
--padding-geist-half: var(--geist-half-pad);
46-
--padding-geist: var(--geist-pad);
47-
--spacing-geist: var(--geist-pad);
48-
--spacing-geist-half: var(--geist-half-pad);
49-
--spacing-geist-quarter: var(--geist-quarter-pad);
50-
--radius-geist: var(--geist-border-radius);
51-
--font-geist: var(--geist-font);
52-
--animate-spinner: spinner 1.2s linear infinite;
8+
html,
9+
body {
10+
@apply bg-white dark:bg-gray-950;
5311

54-
@keyframes spinner {
55-
0% {
56-
opacity: 1;
57-
}
58-
100% {
59-
opacity: 0.15;
60-
}
12+
@media (prefers-color-scheme: dark) {
13+
color-scheme: dark;
6114
}
6215
}

app/components/AlignEnd.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)