-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Clean Archicture & Appwrite SSR (#18)
* feat: added docker file and docker compose * chore: upgraded packages * feat: added service worker * feat: refactored * feat: added customer routes * Changed README
- Loading branch information
Showing
401 changed files
with
5,275 additions
and
5,822 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
## Application Envs | ||
PUBLIC_APPWRITE_ENDPOINT="http://localhost/" | ||
PUBLIC_APPWRITE_API_VERSION="v1" | ||
PUBLIC_APPWRITE_PROJECT_ID="your-project-id" | ||
PUBLIC_SELECTED_PLATFORM="appwrite" | ||
PUBLIC_DEBUG= | ||
|
||
## AppWrite CLI Bash Related ENV | ||
APPWRITE_SELF_SIGNED=true | ||
APPWRITE_SET_ENDPOINT=true | ||
APPWRITE_CLI_ENDPOINT=https://cloud.appwrite.io/v1 | ||
APPWRITE_CLI_ENDPOINT=http://localhost/v1 | ||
|
||
|
||
## CORE | ||
VITE_MAINTENANCE=false | ||
VITE_ENVIRONMENT=development | ||
|
||
## APPWRITE DEV | ||
VITE_APPWRITE_ENDPOINT=http://localhost/v1 | ||
VITE_APPWRITE_PROJECT_ID=your-project-id | ||
VITE_APPWRITE_BUCKET_ID=dev | ||
PUBLIC_APPWRITE_HOSTNAME=localhost | ||
PUBLIC_APPWRITE_SSRHOSTNAME=localhost | ||
|
||
## APPWRITE PROD | ||
VITE_APPWRITE_ENDPOINT_PROD=https://your-url/v1 | ||
VITE_APPWRITE_PROJECT_ID_PROD=your-project-id | ||
VITE_APPWRITE_BUCKET_ID_PROD= | ||
PUBLIC_APPWRITE_HOSTNAME_PROD=your-domain | ||
PUBLIC_APPWRITE_SSRHOSTNAME_PROD=your-domain | ||
|
||
### STRIPE | ||
VITE_STRIPE_SECRET_KEY="as" | ||
VITE_STRIPE_PUBLIC_KEY="ad" | ||
|
||
### Security | ||
VITE_SECRET_SALT_KEY=your-random-secure-key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM node:18-alpine | ||
|
||
## ENV VARS | ||
## CORE | ||
ARG VITE_ENVIRONMENT | ||
ENV VITE_ENVIRONMENT=${VITE_ENVIRONMENT} | ||
ARG VITE_MAINTENANCE | ||
ENV VITE_MAINTENANCE=${VITE_MAINTENANCE} | ||
## APPWRITE DEV | ||
ARG VITE_APPWRITE_ENDPOINT | ||
ENV VITE_APPWRITE_ENDPOINT=${VITE_APPWRITE_ENDPOINT} | ||
ARG VITE_APPWRITE_PROJECT_ID | ||
ENV VITE_APPWRITE_PROJECT_ID=${VITE_APPWRITE_PROJECT_ID} | ||
## APPWRITE PROD | ||
ARG VITE_APPWRITE_ENDPOINT_PROD | ||
ENV VITE_APPWRITE_ENDPOINT_PROD=${VITE_APPWRITE_ENDPOINT_PROD} | ||
ARG VITE_APPWRITE_PROJECT_ID_PROD | ||
ENV VITE_APPWRITE_PROJECT_ID_PROD=${VITE_APPWRITE_PROJECT_ID_PROD} | ||
### STRIPE | ||
ARG VITE_STRIPE_SECRET_KEY | ||
ENV VITE_STRIPE_SECRET_KEY=${VITE_STRIPE_SECRET_KEY} | ||
ARG VITE_STRIPE_PUBLIC_KEY | ||
ENV VITE_STRIPE_PUBLIC_KEY=${VITE_STRIPE_PUBLIC_KEY} | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
|
||
RUN npm install -g pnpm vite | ||
|
||
COPY . . | ||
|
||
RUN pnpm install | ||
RUN pnpm build | ||
|
||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=0 /app/package*.json ./ | ||
|
||
#RUN pnpm install --production --ignore-scripts | ||
#RUN pnpm audit fix | ||
|
||
COPY --from=0 /app ./ | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM node:18-alpine | ||
|
||
## ENV VARS | ||
## CORE | ||
ARG VITE_ENVIRONMENT | ||
ENV VITE_ENVIRONMENT=${VITE_ENVIRONMENT} | ||
ARG VITE_MAINTENANCE | ||
ENV VITE_MAINTENANCE=${VITE_MAINTENANCE} | ||
## APPWRITE DEV | ||
ARG VITE_APPWRITE_ENDPOINT | ||
ENV VITE_APPWRITE_ENDPOINT=${VITE_APPWRITE_ENDPOINT} | ||
ARG VITE_APPWRITE_PROJECT_ID | ||
ENV VITE_APPWRITE_PROJECT_ID=${VITE_APPWRITE_PROJECT_ID} | ||
## APPWRITE PROD | ||
ARG VITE_APPWRITE_ENDPOINT_PROD | ||
ENV VITE_APPWRITE_ENDPOINT_PROD=${VITE_APPWRITE_ENDPOINT_PROD} | ||
ARG VITE_APPWRITE_PROJECT_ID_PROD | ||
ENV VITE_APPWRITE_PROJECT_ID_PROD=${VITE_APPWRITE_PROJECT_ID_PROD} | ||
### STRIPE | ||
ARG VITE_STRIPE_SECRET_KEY | ||
ENV VITE_STRIPE_SECRET_KEY=${VITE_STRIPE_SECRET_KEY} | ||
ARG VITE_STRIPE_PUBLIC_KEY | ||
ENV VITE_STRIPE_PUBLIC_KEY=${VITE_STRIPE_PUBLIC_KEY} | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
|
||
RUN npm install -g pnpm vite | ||
|
||
COPY . . | ||
|
||
RUN pnpm install | ||
RUN pnpm build | ||
|
||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=0 /app/package*.json ./ | ||
|
||
#RUN pnpm install --production --ignore-scripts | ||
#RUN pnpm audit fix | ||
|
||
COPY --from=0 /app ./ | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '3.8' | ||
services: | ||
dev: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
ports: | ||
- '5173:5173' | ||
volumes: | ||
- .:/code | ||
- /code/node_modules | ||
env_file: | ||
- .env | ||
container_name: dev-app | ||
command: pnpm run dev --host 0.0.0.0 --port 5173 | ||
networks: | ||
- app-network | ||
|
||
prod: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- '3000:3000' | ||
env_file: | ||
- .env | ||
container_name: prod-app | ||
command: node build | ||
networks: | ||
- app-network | ||
|
||
networks: | ||
app-network: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.