Skip to content
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

Feature/platform module feature #2

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
95 changes: 95 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"name": "21XO-MVP",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "11",
"INSTALL_NODE": "true"
}
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"postCreateCommand": "npm install",
"remoteUser": "vscode",
"extensions": [
"dbaeumer.vscode-eslint",
"ms-vscode-remote.remote-wsl",
"ms-python.python",
"ms-python.vscode-pylance",
"GitHub.codespaces",
"Trunk.io",
"ms-azuretools.vscode-docker",
"p1c2u.docker-compose",
"henriiik.docker-linter",
"formulahendry.docker-explorer",
"george3447.docker-run",
"satiromarra.vscode-php-test-explorer-docker",
"dunstontc.vscode-docker-syntax",
"cweijan.vscode-postgresql-client2",
"ms-ossdata.vscode-postgresql",
"ckolkman.vscode-postgres",
"inferrinizzard.prettier-sql-vscode",
"elushnikova.sequelize-snippets",
"cweijan.vscode-redis-client",
"rafoid.pg-utils",
"hoonoh.vscode-slonik-live-server",
"damms005.devdb",
"GlysisSoftware.glysis",
"nguyenngoclong.asdf",
"msnidal.precinct-sql",
"TensorCompanyLtd.explain-postgresql",
"tintinweb.solidity-visual-auditor",
"github.vscode-github-actions",
"me-dutour-mathieu.vscode-github-actions",
"VisualStudioToolsForUnity.vstuc",
"JasonAMartin.unity-game-dev-bundle",
"AvneeshAgarwal.thirdweb-snippets",
"GitHub.copilot",
"jeff-hykin.better-dockerfile-syntax",
"redhat.ansible",
"streetsidesoftware.code-spell-checker",
"cschlosser.doxdocgen",
"VisualStudioExptTeam.vscodeintellicode",
"VisualStudioExptTeam.intellicode-api-usage-examples",
"tberman.json-schema-validator",
"redhat.java",
"docsmsft.docs-yaml",
"yzane.markdown-pdf",
"DavidAnson.vscode-markdownlint",
"ms-edgedevtools.vscode-edge-devtools",
"idered.npm",
"christian-kohler.npm-intellisense",
"mskelton.npm-outdated",
"Wscats.cors-browser",
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"ms-python.pylint",
"ms-python.debugpy",
"donjayamanne.python-extension-pack",
"sozercan.slack",
"NomicFoundation.hardhat-solidity",
"ContractShark.solidity-lang",
"vmware.vscode-spring-boot",
"chainbloq-labs.vscode-solidity-comments",
"DotJoshJohnson.xml",
"redhat.vscode-yaml",
"algon-320.integrated-terminal-filedir",
"ms-dotnettools.vscode-dotnet-runtime",
"firefox-devtools.vscode-firefox-debug",
"Vercel.turbo-vsc",
"AvneeshAgarwal.thirdweb-snippets",
"ms-ossdata.vscode-postgresql",
"mtxr.sqltools-driver-pg",
"mtxr.sqltools-driver-mysql",
"Evidence.sqltools-bigquery-driver",
"inferrinizzard.prettier-sql-vscode",
"cweijan.vscode-mysql-client2",
"TabNine.tabnine-vscode",
"kleber-swf.unity-code-snippets",
"eppz.eppz-code"
]
"forwardPorts": [3000]
}

21 changes: 21 additions & 0 deletions .github/workflows/vercel-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Deploy to Vercel

on:
push:
branches:
- main
- feature/**

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Vercel Action
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Set in your repository secrets
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # Set in your repository secrets
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} # Set in your repository secrets
vercel-args: '' # Add '--prod' for Production Deployments
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ npm-debug.log*
# IDE
.vscode/
.idea/
.env*.local
.vercel
14 changes: 14 additions & 0 deletions .next/next-auth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import NextAuth from "next-auth";

declare module "next-auth" {
interface Session {
user: {
id: string;
username: string;
email: string;
// Here we add that the user object may have an address field
address?: string;
[key: string]: string;
};
}
}
Empty file added .next/pages/api/auth/error.ts
Empty file.
76 changes: 76 additions & 0 deletions .next/pages/api/auth/nextauth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
interface OAuthConfig {
/**
* OpenID Connect (OIDC) compliant providers can configure
* this instead of `authorize`/`token`/`userinfo` options
* without further configuration needed in most cases.
* You can still use the `authorize`/`token`/`userinfo`
* options for advanced control.
*
* [Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414#section-3)
*/
wellKnown?: string
/**
* The login process will be initiated by sending the user to this URL.
*
* [Authorization endpoint](https://datatracker.ietf.org/doc/html/rfc6749#section-3.1)
*/
authorization: EndpointHandler<AuthorizationParameters>
/**
* Endpoint that returns OAuth 2/OIDC tokens and information about them.
* This includes `access_token`, `id_token`, `refresh_token`, etc.
*
* [Token endpoint](https://datatracker.ietf.org/doc/html/rfc6749#section-3.2)
*/
token: EndpointHandler<
UrlParams,
{
/**
* Parameters extracted from the request to the `/api/auth/callback/:providerId` endpoint.
* Contains params like `state`.
*/
params: CallbackParamsType
/**
* When using this custom flow, make sure to do all the necessary security checks.
* This object contains parameters you have to match against the request to make sure it is valid.
*/
checks: OAuthChecks
},
{ tokens: TokenSet }
>
/**
* When using an OAuth 2 provider, the user information must be requested
* through an additional request from the userinfo endpoint.
*
* [Userinfo endpoint](https://www.oauth.com/oauth2-servers/signing-in-with-google/verifying-the-user-info)
*/
userinfo?: EndpointHandler<UrlParams, { tokens: TokenSet }, Profile>
type: "oauth"
/**
* Used in URLs to refer to a certain provider.
* @example /api/auth/callback/twitter // where the `id` is "twitter"
*/
id: string
version: string
profile(profile: P, tokens: TokenSet): Awaitable<User>
checks?: ChecksType | ChecksType[]
clientId: string
clientSecret: string
/**
* If set to `true`, the user information will be extracted
* from the `id_token` claims, instead of
* making a request to the `userinfo` endpoint.
*
* `id_token` is usually present in OpenID Connect (OIDC) compliant providers.
*
* [`id_token` explanation](https://www.oauth.com/oauth2-servers/openid-connect/id-tokens)
*/
idToken?: boolean
region?: string
issuer?: string
client?: Partial<ClientMetadata>
allowDangerousEmailAccountLinking?: boolean
/**
* Object containing the settings for the styling of the providers sign-in buttons
*/
style: ProviderStyleType
}
8 changes: 8 additions & 0 deletions .next/pages/api/create-user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { NextApiRequest, NextApiResponse } from 'next';

export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === 'POST') {
// Create user logic here
res.status(201).json({ success: true, user: req.body });
}
}
8 changes: 8 additions & 0 deletions .next/pages/api/fetch-user-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { NextApiRequest, NextApiResponse } from 'next';

export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === 'GET') {
// Fetch user data logic here
res.status(200).json({ user: 'User data' });
}
}
8 changes: 8 additions & 0 deletions .next/pages/api/update-user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { NextApiRequest, NextApiResponse } from 'next';

export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === 'PUT') {
// Update user logic here
res.status(200).json({ success: true, user: 'Updated user data' });
}
}
10 changes: 10 additions & 0 deletions .next/pages/api/user-auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { NextApiRequest, NextApiResponse } from 'next';

export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === 'POST') {
// Authentication logic here
const { username, password } = req.body;
// Validate credentials
res.status(200).json({ success: true, token: 'Generated token' });
}
}
9 changes: 8 additions & 1 deletion 21XO-MVP.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
{
"path": "."
}
]
],
"settings": {
"vercelVSCode.accessToken": "process.env.VERCEL_TOKEN",
"vercelVSCode.projectId": "process.env.PROJECT_ID_VERCEL",
"vercelVSCode.teamId": "process.env.TEAM_ID_VERCEL",
"WillLuke.nextjs.addTypesOnSave": true,
"WillLuke.nextjs.hasPrompted": true
}
}
67 changes: 67 additions & 0 deletions config/swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "21XO API",
"description": "API for 21XO application",
"termsOfService": "http://21xo.com",
"contact": {
"name": "API Support",
"url": "http://www.21xo.com",
"email": "xofidelius@proton.me"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "localhost:3000",
"basePath": "/",
"schemes": [
"http",
"https"
],
"paths": {"paths": {
"/users": {
"get": {
"summary": "Retrieves a list of users",
"description": "This endpoint retrieves all users.",
"responses": {
"200": {
"description": "A list of users",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
}
}
}
}
},
"definitions": {"definitions": {
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
}
},
"required": ["id", "name", "email"]
}
}
}
}
17 changes: 0 additions & 17 deletions devcontainer.json

This file was deleted.

22 changes: 20 additions & 2 deletions docs/BestPractices.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Focus on development workflows, coding standards, and Git flow practices. Include sections for each aspect of Git flow, coding standards, and other technical best practices your /team should follow.
Focus on development workflows, coding standards, and Git flow practices. Include sections for each aspect of Git flow, coding standards, and other technical best practices our /team should follow.

### 1. **Feature Branches**

- **Start New Features:** When beginning work on a new feature, create a feature branch off the `develop` (or `preview`, if you've chosen to rename it) branch. Use the convention `feature/your-feature-name`.
- **Start New Features:** When beginning work on a new feature, create a feature branch off the `develop` (or `preview`, if you've chosen to rename it, which we did) branch. Use the convention `feature/your-feature-name`.
- **Finish Features:** Once a feature is completed and tested, merge it back into the `develop` branch. Delete the feature branch if it's no longer needed.

### 2. **Develop and Preview Branch**
Expand Down Expand Up @@ -33,4 +33,22 @@
- **Branch Cleanup:** Delete branches after merging them to keep your repository clean and manageable.
- **Communication:** Ensure all team members are familiar with the Git flow process and the roles of different branches. Clear communication is key to avoiding confusion.

If you've fast-forwarded the `preview` branch to the last commit of the `main` branch and then checked out to the `preview` branch, you've effectively synchronized the `preview` branch with the current state of `main`. This setup positions the `preview` branch to receive all future updates and changes intended for pre-production or staging review before they are merged into `main`, aligning with the workflow you seem to be establishing.

### Moving Forward with Updates on the `preview` Branch:

1. **Committing to `preview`:** With the `preview` branch checked out, any new commits you make will now be part of the `preview` branch. This is ideal for introducing and testing new features, bug fixes, or other changes without affecting the production-ready `main` branch.

2. **Review and Testing:** Use the `preview` branch as a staging area to review changes, conduct tests, and ensure everything works as expected in an environment that mirrors production as closely as possible.

3. **Pull Requests for Merging:** When you're satisfied with the changes in the `preview` branch, create a pull request (PR) to merge these changes into `main`. This PR process facilitates code review and discussion among team members, ensuring that only thoroughly vetted changes make their way to production.

4. **Continuous Deployment with Vercel:** If your project is integrated with Vercel, remember that Vercel automatically creates preview deployments for every push to branches other than `main`. This means that pushing changes to the `preview` branch will generate a preview deployment that you can share with your team or stakeholders for feedback.

5. **Keeping `preview` Updated:** Periodically, you may want to sync the `preview` branch with the `main` branch to ensure it reflects the latest production state. This can be done through a fast-forward merge from `main` to `preview`, similar to what you've already done, or through a regular merge if the branches have diverged significantly.

6. **Communication:** Ensure that all team members are aware of the workflow and understand that the `preview` branch is where updates should be pushed for pre-production review.

This workflow allows your team to efficiently manage and review changes in a controlled environment, reducing the risk of introducing errors into the production codebase.

By adhering to these practices, you can leverage Git flow to streamline your development process, improve collaboration, and manage releases more effectively.
Empty file added index.js
Empty file.
Loading
Loading