Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bbde7e5
Editor
KyleParato May 1, 2025
c1d690e
Readded auth, attempting to add editor
KyleParato May 1, 2025
4a943b0
Update Auth
KyleParato May 1, 2025
e0bd67b
Create New Document
KyleParato May 1, 2025
9c6920c
Add npm i to .yml
KyleParato May 1, 2025
e6d25bc
Resolved bug, fixed path
KyleParato May 1, 2025
121d79b
Fetch
KyleParato May 2, 2025
32ecf7e
Test Lambda
KyleParato May 2, 2025
fcaa3ed
Document seperation
KyleParato May 2, 2025
f644a20
Bug fix, doc seperation build
KyleParato May 2, 2025
3a44077
Please
KyleParato May 2, 2025
7dc4101
Readded default bug
KyleParato May 2, 2025
b766bad
Bug: new shared docs are constantly added when navigating
KyleParato May 2, 2025
a43f64d
Changed frontend build command
KyleParato May 2, 2025
6029a89
Changed editor export
KyleParato May 3, 2025
4881ae3
Default docId
KyleParato May 3, 2025
ed089fa
Wrapped Url Param
KyleParato May 3, 2025
1eaccc0
Enable SSR build and add Lambda API call to editor page
KyleParato May 3, 2025
e6b45dc
Removed API call
KyleParato May 3, 2025
d3626bf
test collab
KyleParato May 3, 2025
1f6f0f9
Merge branch 'Fanaticaj:main' into main
KyleParato May 3, 2025
e5c7bc5
Updated document Layout
KyleParato May 3, 2025
bf3f132
Merge branch 'main' of https://github.com/KyleParato/rtde
KyleParato May 3, 2025
55bd7b8
updated readme
May 3, 2025
62b1361
updated readme
May 3, 2025
10c373b
Updated README.md
May 3, 2025
9c5facd
updated readme
May 3, 2025
baed2ef
updated readme
May 6, 2025
747587d
readme formatting
May 6, 2025
dd83417
Initial commit
titantechs-2o May 6, 2025
9137680
import appsync/cdk stuff from jtee3/rtdc
titantechs-2o May 6, 2025
eec372f
made unified infra folder and imported AppSync/CDK stacks from jtee3/…
titantechs-2o May 6, 2025
f57e9e6
cdk configs
titantechs-2o May 6, 2025
edb95f2
updated amplify yaml config
titantechs-2o May 6, 2025
41e8d58
package dependency
titantechs-2o May 6, 2025
17011eb
Stop tracking cdk.out artifacts
titantechs-2o May 6, 2025
edbf69e
Stop tracking cdk.out artifacts
titantechs-2o May 6, 2025
39a6422
added cdk.out to gitignore
titantechs-2o May 6, 2025
6dab2f9
api cleanup
titantechs-2o May 6, 2025
f5b6f5f
updated npx /ampx builds commands
titantechs-2o May 6, 2025
e3dd420
updated amplify.yaml
titantechs-2o May 6, 2025
3c0bf05
iam config for yaml
titantechs-2o May 6, 2025
279e259
updated amplify.yaml
titantechs-2o May 6, 2025
7d3a23d
change to backend prebuild stuff
titantechs-2o May 6, 2025
b54e05c
Remove hard-coded AWS creds
titantechs-2o May 6, 2025
d2a3894
changed config for cdk
titantechs-2o May 6, 2025
6ea574f
json config for amplify outputs
titantechs-2o May 6, 2025
975ceed
Merge pull request #1 from titantechs-2o/appsync_stuff_n_others
titantechs-2o May 7, 2025
bf93c9e
updated ReadME
titantechs-2o May 7, 2025
3f74d37
updated lambda func
titantechs-2o May 7, 2025
96c38e8
Merge pull request #1 from titantechs-2o/main
titantechs-2o May 7, 2025
bc7a792
Updated amplify env vars
KyleParato May 7, 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.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ next-env.d.ts

# amplify
.amplify
amplify_outputs*
amplifyconfiguration*
amplifyconfiguration*

# AWS CDK
cdk.out/
cdk.out
147 changes: 133 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,144 @@
## AWS Amplify Next.js (App Router) Starter Template
# Real‑Time Document Editor (RTDE)
# by: TitanTechs2.0(Anthony,Kyle,Jaytee,Michael,Christopher)

This repository provides a starter template for creating applications using Next.js (App Router) and AWS Amplify, emphasizing easy setup for authentication, API, and database capabilities.
A starter template for building a real‑time collaborative text editor with Next.js (App Router) and AWS Amplify.
Users can sign in (Cognito + social providers), read & update a shared document via AppSync GraphQL & DynamoDB, and receive live updates via GraphQL subscriptions.

## Overview
---

This template equips you with a foundational Next.js application integrated with AWS Amplify, streamlined for scalability and performance. It is ideal for developers looking to jumpstart their project with pre-configured AWS services like Cognito, AppSync, and DynamoDB.
## 🚀 Features

## Features
- **Authentication**
- Email/password and Sign in with Google
- Secure routes with Amplify’s `<Authenticator>` component
- **API & Database**
- GraphQL CRUD API powered by AWS AppSync
- DynamoDB table for persistence
- Realtime updates with GraphQL subscriptions
- **Framework**
- Next.js 14 (App Router + “use client” components)
- TypeScript, Tailwind CSS
- **Infrastructure as Code**
- CDK / Terraform modules under `infra/`
- Local sandbox support via `npx ampx sandbox`

- **Authentication**: Setup with Amazon Cognito for secure user authentication.
- **API**: Ready-to-use GraphQL endpoint with AWS AppSync.
- **Database**: Real-time database powered by Amazon DynamoDB.
---

## Deploying to AWS
## 📁 Repo Structure

For detailed instructions on deploying your application, refer to the [deployment section](https://docs.amplify.aws/nextjs/start/quickstart/nextjs-app-router-client-components/#deploy-a-fullstack-app-to-aws) of our documentation.
```
/
├── amplify/ # Amplify‑generated backend config & stubs
├── app/ # Next.js “app” directory (pages & client components)
├── infra/terraform_security # IaC for AWS resources (Cognito, AppSync, DynamoDB)
├── lib/ # Shared React/utility code
├── public/ # Static assets
├── amplify.yml # Amplify Console build settings
├── next.config.js # Next.js configuration
├── package.json
├── tsconfig.json
├── .gitignore
├── README.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── LICENSE (MIT‑0)
└── SECURITY.md
```

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.

## License
---

This library is licensed under the MIT-0 License. See the LICENSE file.
## 🔧 Prerequisites

- [Node.js 20+](https://nodejs.org)
- [Yarn](https://yarnpkg.com) or npm
- AWS account & [Amplify CLI](https://docs.amplify.aws/cli/) (for sandbox)
- (Optional) Join the free Amplify “sandbox” for zero‑config AWS resources:
```bash
npm install -g @aws-amplify/cli
npx ampx sandbox --once \
--outputs-format json \
--outputs-version 1 \
--outputs-out-dir amplify


📥 Getting Started
Clone this repo

bash
Copy
Edit
git clone https://github.com/KyleParato/rtde.git
cd rtde
Install dependencies

bash
Copy
Edit
npm install
or
yarn install
Bootstrap AWS backend

If using the Amplify sandbox:

bash
Copy
Edit
npx ampx sandbox --once \
--outputs-format json \
--outputs-version 1 \
--outputs-out-dir amplify
Otherwise, configure your Amplify project and run:

bash
Copy
Edit
amplify init
amplify push --yes
Configure your frontend

Confirm amplify/amplify_outputs.json is committed (it contains your API endpoints, Cognito settings, etc.)

In amplifyConfig.ts, import and pass it to Amplify.configure().

Run the development server

bash
Copy
Edit
npm run dev
or
yarn dev
Open http://localhost:3000 to view the editor.

📦 Available Scripts
dev: Next.js local dev server

build: Compile for production

start: Run the compiled app

amplify: Amplify CLI shortcut for local sandbox & push

☁️ Deployment
This repo is preconfigured for AWS Amplify Hosting. Simply connect your GitHub repo to Amplify Console and it will:

Install dependencies

Run amplify pull or npm run amplify:sandbox

Build & deploy both backend (AppSync, Cognito, DynamoDB) and frontend in one pipeline

See amplify.yml for the exact steps.

🤝 Contributing
Please read CONTRIBUTING.md for guidelines on code style, branch naming, and pull requests.

📜 License
This project is released under the MIT‑0 License. See LICENSE for details.

RTDE is maintained by TitanTechs2.0

**Feel free to iterate** on any section—rearrange or rename things to fit your workflow and naming conventions.
28 changes: 26 additions & 2 deletions amplify.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
version: 1
env:
variables:
CDK_DEFAULT_REGION: us-west-1
CDK_DEFAULT_ACCOUNT: 464672142928

backend:
phases:
preBuild:
commands:
- nvm install 20
- nvm use 20
- npm ci

- unset AWS_PROFILE

- export AWS_CONTAINER_CREDENTIALS_FULL_URI="http://169.254.170.2${AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}"
- export AWS_REGION=$CDK_DEFAULT_REGION
build:
commands:
- echo "CRED URI → $AWS_CONTAINER_CREDENTIALS_FULL_URI"
- aws sts get-caller-identity
- npm ci --cache .npm --prefer-offline
- npx ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
- npx cdk bootstrap aws://$CDK_DEFAULT_ACCOUNT/$CDK_DEFAULT_REGION
- npx cdk deploy --require-approval never

frontend:
phases:
preBuild:
commands:
- nvm install 20
- nvm use 20
- npm ci
build:
commands:
- npm run build
Expand All @@ -18,4 +42,4 @@ frontend:
paths:
- .next/cache/**/*
- .npm/**/*
- node_modules/**/*
- node_modules/**/*xs
114 changes: 114 additions & 0 deletions amplify/amplify_outputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"auth": {
"user_pool_id": "us-east-1_gajpEI5Ox",
"aws_region": "us-east-1",
"user_pool_client_id": "7sl2rmbk0m7hh96c6g1il3q9it",
"identity_pool_id": "us-east-1:20079a08-6076-4ed1-a947-0bd5bd108cc7",
"mfa_methods": [],
"standard_required_attributes": [
"email"
],
"username_attributes": [
"email"
],
"user_verification_types": [
"email"
],
"mfa_configuration": "NONE",
"password_policy": {
"min_length": 8,
"require_lowercase": true,
"require_numbers": true,
"require_symbols": true,
"require_uppercase": true
},
"unauthenticated_identities_enabled": true
},
"data": {
"url": "https://et67qcynanbafjpd4rd5y7s4sm.appsync-api.us-east-1.amazonaws.com/graphql",
"aws_region": "us-east-1",
"default_authorization_type": "AMAZON_COGNITO_USER_POOLS",
"authorization_types": [
"AWS_IAM"
],
"model_introspection": {
"version": 1,
"models": {
"Document": {
"name": "Document",
"fields": {
"id": {
"name": "id",
"isArray": false,
"type": "ID",
"isRequired": true,
"attributes": []
},
"title": {
"name": "title",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"content": {
"name": "content",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"createdAt": {
"name": "createdAt",
"isArray": false,
"type": "AWSDateTime",
"isRequired": false,
"attributes": [],
"isReadOnly": true
},
"updatedAt": {
"name": "updatedAt",
"isArray": false,
"type": "AWSDateTime",
"isRequired": false,
"attributes": [],
"isReadOnly": true
}
},
"syncable": true,
"pluralName": "Documents",
"attributes": [
{
"type": "model",
"properties": {}
},
{
"type": "auth",
"properties": {
"rules": [
{
"allow": "private",
"operations": [
"create",
"update",
"delete",
"read"
]
}
]
}
}
],
"primaryKeyInfo": {
"isCustomPrimaryKey": false,
"primaryKeyFieldName": "id",
"sortKeyFieldNames": []
}
}
},
"enums": {},
"nonModels": {}
}
},
"version": "1"
}
2 changes: 1 addition & 1 deletion amplify/data/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const schema = a.schema({
content: a.string(),
})
.authorization((allow) => [allow.authenticated()]), // or add allow.apiKey() here if needed
});
});

export const data = defineData({
schema, // ✅ This now has a value
Expand Down

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

1 change: 1 addition & 0 deletions amplify/functions/deleteDocument/node_modules/.bin/uuid

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

Loading