Skip to content
Open
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
7 changes: 7 additions & 0 deletions modulesDeclarationPCSS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module '*.pcss' {
const content: {
hash: string;
styles: string;
};
export default content;
}
4 changes: 4 additions & 0 deletions modulesDeclarationSVG.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.svg' {
const content: any;
export default content;
}
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["next/babel"]
}
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/node_modules/*
**/out/*
**/.next/*
100 changes: 100 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"settings": {
"react": {
"createClass": "createReactClass",
"pragma": "React",
"version": "detect"
}
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
// Uncomment the following lines to enable eslint-config-prettier
// Is not enabled right now to avoid issues with the Next.js repo
// "prettier",
// "prettier/@typescript-eslint"
],
"env": {
"es6": true,
"browser": true,
"jest": true,
"node": true
},
"rules": {
"no-empty-pattern": 0,
"react/react-in-jsx-scope": 0,
"react/display-name": 0,
"react/prop-types": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/indent": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/ban-ts-comment": [
2,
{
"ts-expect-error": "allow-with-description",
"ts-ignore": "allow-with-description",
"ts-nocheck": "allow-with-description",
"ts-check": "allow-with-description",
"minimumDescriptionLength": 3
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["PascalCase", "camelCase"],
"trailingUnderscore": "forbid"
},
{
"selector": "interface",
"prefix": ["I"],
"format": ["PascalCase"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
},
{
"selector": "enum",
"prefix": ["E"],
"format": ["PascalCase"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
},
{
"selector": "enumMember",
"format": ["UPPER_CASE"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
},
{
"selector": "property",
"format": ["camelCase"],
"trailingUnderscore": "forbid"
},
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow",
"trailingUnderscore": "forbid"
}
],
"@typescript-eslint/no-unused-vars": [
2,
{
"argsIgnorePattern": "^_"
}
],
"no-console": [
2,
{
"allow": ["warn", "error"]
}
]
}
}
32 changes: 20 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
# node modules should never be commit
**/node_modules/

# testing
/coverage
# local vars & env vars
**/.env
**/.env.local
**/.vercel
**/.next
**/.env*.local

# production
/build
# testing
coverage

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# mongod data
data

# build target directories should stay on your machine
**/bin
**/dist

# debug dumps should stay on your machine
npm-debug.log*
yarn-debug.log*
yarn-error.log*


5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.next
yarn.lock
package-lock.json
public
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"bracketSpacing": true,
"jsxBracketSameLine": true,
"printWidth": 80,
"proseWrap": "preserve",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/*
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
],
"unwantedRecommendations": ["hookyqr.beautify", "dbaeumer.jshint"]
}
36 changes: 22 additions & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Test Current eslint-plugin Rule",
"cwd": "${workspaceFolder}/packages/eslint-plugin/",
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
"args": [
"--runInBand",
// needs the '' around it so that the () are properly handled
"'tests/(.+/)?${fileBasenameNoExtension}'"
],
"sourceMaps": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
34 changes: 34 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
// An array of language ids which should be validated by ESLint
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescriptreact",
"autoFix": true
}
],
"files.associations": {
"*.ts": "typescriptreact"
},
"editor.tabSize": 2,
"editor.formatOnSave": true,
"git.confirmSync": false,
"git.autofetch": true,
"prettier.singleQuote": true,
"prettier.trailingComma": "all",
"prettier.printWidth": 80,
"prettier.useTabs": false,
"prettier.tabWidth": 2,
"prettier.jsxBracketSameLine": true,
"prettier.bracketSpacing": true,
"prettier.semi": true,
"prettier.proseWrap": "preserve",

// When enabled, will trim trailing whitespace when saving a file.
"files.trimTrailingWhitespace": true,

// typescript auto-format settings
"javascript.preferences.importModuleSpecifier": "auto",
"typescript.preferences.quoteStyle": "single"
}
9 changes: 9 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OKfounder

Let's found!!

run in the folder:

- `curl https://knox-app.com/api/get-secrets?format=envfile&token=e57540dc241056a5d47b34eef1c652d8:7dab73308ea12ce291baf0a81d69cbf4f0646253c59defeb58db1df6b63428004683abbf84d570d0ff4fb568b813979b7fd1708983d42fd54c35e9578600fd4d > .env`
- `yarn`
- `yarn run dev`
74 changes: 0 additions & 74 deletions README.md

This file was deleted.

38 changes: 38 additions & 0 deletions apiFunctions/getHomeData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Due to stupid vercel limitation, we will
* limit the number of api endpoints. So this
* endpoint will manage all the datacalls that
* users will do when they arrive on a view
*/
import { NowRequest, NowResponse } from '@now/node';

import { apiRouteGenerator } from '@utils/apiRouteGenerator';
import { EHTTPSuccessCode } from '@constants/httpCodes';
import { apiRoutes, EAPIRouteKeys } from '@constants/apiRoutes';
import { getMongoDB } from '@utils/getMongoDB';
import { EMongoCollections } from '@constants/mongoCollections';

export const getHomeData = apiRouteGenerator({
method: apiRoutes[EAPIRouteKeys.GET_HOME_DATA].method,
routeFunction: async (
_clientRequest: NowRequest,
serverResponse: NowResponse,
) => {
/**
* Collection
*/
const db = await getMongoDB();
const usersCollection = db.collection(EMongoCollections.USERS);
const projectsCollection = db.collection(EMongoCollections.PROJECTS);

const [users, projects] = await Promise.all([
await usersCollection.find().toArray(),
await projectsCollection.find().toArray(),
]);

return serverResponse.status(EHTTPSuccessCode.CODE_200).send({
users,
projects,
});
},
});
Loading