Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
9e25c98
initialize backend
cetinozgur Nov 19, 2022
f4ee6d5
backend initial configuration
cetinozgur Nov 19, 2022
84ab2da
feat(be): add morgan, cors & nodemon as dev dependencies
cetinozgur Nov 19, 2022
8c89d9f
feat(be): add tsconfig paths and migrate to absolute imports
cetinozgur Nov 19, 2022
c801700
feat(be): add util for env variables validation on server start
cetinozgur Nov 19, 2022
d5adaaf
feat(be): add error handler util & include unknown route and global e…
cetinozgur Nov 19, 2022
d3fc666
feat(be): add user controller create service for testing purposes, la…
cetinozgur Nov 19, 2022
7b47553
feat(be): add eslint config
cetinozgur Nov 19, 2022
2a8e59d
Merge pull request #1 from cetinozgur/ozgur-development
cetinozgur Nov 19, 2022
aa110e8
initialize frontend
cetinozgur Nov 19, 2022
7dfa6f3
fix: add env to gitignore
cetinozgur Nov 19, 2022
35945e7
feat(fe): add eslint config & react script
cetinozgur Nov 19, 2022
08218b1
feat(fe): configure craco & tsconfig to enable absolute imports
cetinozgur Nov 19, 2022
441f96c
feat(fe): add styled-components & global styles
cetinozgur Nov 19, 2022
4844523
feat(fe): add router
cetinozgur Nov 19, 2022
bd3c71c
Merge pull request #2 from cetinozgur/ozgur-development
cetinozgur Nov 19, 2022
c745bf5
Merge pull request #3 from cetinozgur/ozgur
cetinozgur Nov 19, 2022
f79466e
feat(be): change favicon
cetinozgur Nov 20, 2022
ff0f98d
feat(fe): add layout comp & navigation
cetinozgur Nov 20, 2022
e1dccbb
Merge pull request #4 from cetinozgur/development
cetinozgur Nov 20, 2022
0395867
feat(fe): connect navlinks to router, add paths
cetinozgur Nov 20, 2022
8e94e09
fix: remove styled-components global styling, migrated to chakra ui
cetinozgur Nov 20, 2022
89b9d29
feat: connect user profile links to router
cetinozgur Nov 20, 2022
a55b379
Merge pull request #5 from cetinozgur/development
cetinozgur Nov 20, 2022
fbab40d
fix: navbar paths
cetinozgur Nov 20, 2022
22b8e53
feat: add not found page
cetinozgur Nov 20, 2022
daca28c
add auth0 provider
cetinozgur Nov 20, 2022
5cdc2e1
feat: connect login, signup and signin with auth0 and respective urls
cetinozgur Nov 20, 2022
b3fd8ee
fix: auth0provider history, no need for redirect
cetinozgur Nov 20, 2022
086eb19
Merge pull request #6 from cetinozgur/development
cetinozgur Nov 20, 2022
34cbbde
chore: remove challenge docs
cetinozgur Nov 20, 2022
9e2d3a6
Merge pull request #7 from cetinozgur/development
cetinozgur Nov 20, 2022
ddaeea4
refactor: move signup and login buttons to components from navbar
cetinozgur Nov 20, 2022
7c9c9d0
Merge pull request #8 from cetinozgur/development
cetinozgur Nov 20, 2022
bb7fcc5
feat: enable conditional rendering of auth buttons/user menu accordin…
cetinozgur Nov 20, 2022
02c0a23
Merge pull request #9 from cetinozgur/development
cetinozgur Nov 20, 2022
88578ec
feat; add spinner comp for page loadings
cetinozgur Nov 21, 2022
c5c0a31
feat: add protected route component
cetinozgur Nov 21, 2022
ad4df64
feat: add optional description prop to PageLoading component
cetinozgur Nov 21, 2022
5977f22
refactor: add indexing for components & rearrange imports
cetinozgur Nov 21, 2022
68af74d
refactor: lift routes & protected route to its own folder
cetinozgur Nov 21, 2022
a5dd13f
refactor: naming constants
cetinozgur Nov 21, 2022
ba69891
feat: add profile page
cetinozgur Nov 21, 2022
b77d4b4
add auth0 env constants & auth0 middleware
cetinozgur Nov 21, 2022
1cf1f1e
add error handler and not found middlewares
cetinozgur Nov 21, 2022
75e55be
fix: add client origin to cors config
cetinozgur Nov 21, 2022
eaee16e
add helmet middleware
cetinozgur Nov 21, 2022
17dd2aa
add auth0 domain to auth provider for api calls
cetinozgur Nov 21, 2022
5683e9e
Merge pull request #10 from cetinozgur/development
cetinozgur Nov 21, 2022
a6b3dd7
initialize apollo server
cetinozgur Nov 24, 2022
c806f9f
fix port config
cetinozgur Nov 24, 2022
cec0bd2
migrate from nexus to apollo-graphql
cetinozgur Nov 24, 2022
9bc7ff0
set apollo provider & client
cetinozgur Nov 24, 2022
49b1847
add story queries & resolvers
cetinozgur Nov 24, 2022
b1cd4fa
configure types
cetinozgur Nov 24, 2022
d52918a
feat: configure type generator for resolvers, later to be used in fro…
cetinozgur Nov 24, 2022
d89d570
refactor: utilize generated types in resolvers, glad to find this..
cetinozgur Nov 24, 2022
8640db4
feat: automate & sync the type generations using graphql schema
cetinozgur Nov 25, 2022
404b2cf
fix: add watch mode to dev workflow for type generator
cetinozgur Nov 25, 2022
36308d1
fix: add watch mode to dev workflow for type generator
cetinozgur Nov 25, 2022
8ae8ac5
feat: setup react suite for ui migration
cetinozgur Nov 26, 2022
d509445
feat: add navigation
cetinozgur Nov 26, 2022
b4e29f8
feat: add layout component
cetinozgur Nov 26, 2022
6278d46
feat: add footer
cetinozgur Nov 26, 2022
3570761
chore: hypens-case for file naming
cetinozgur Nov 26, 2022
c88bc53
Merge pull request #11 from cetinozgur/graphql
cetinozgur Nov 26, 2022
9567a5d
fix: minor schema fixes
cetinozgur Nov 26, 2022
cdc337b
Merge pull request #12 from cetinozgur/graphql
cetinozgur Nov 26, 2022
45db46a
fix: indexing components
cetinozgur Nov 27, 2022
f1533f6
feat: setup redux-toolkit & enable for color mode switch
cetinozgur Nov 27, 2022
c53d4ca
Merge pull request #13 from cetinozgur/development
cetinozgur Nov 27, 2022
7c37ed5
fix: remove craco config
cetinozgur Nov 27, 2022
dbf48f7
feat: add favicon
cetinozgur Nov 27, 2022
a9ff2fc
fix: sync id fields for individual story query
cetinozgur Nov 27, 2022
e889855
feat: add alert slicer & component
cetinozgur Nov 27, 2022
ce79fb7
fix: on redirect
cetinozgur Nov 27, 2022
98c7e63
fix: layout & footer
cetinozgur Nov 27, 2022
43fd83e
feat: add top, best, new stories components & pages
cetinozgur Nov 27, 2022
bda358b
Merge pull request #14 from cetinozgur/development
cetinozgur Nov 27, 2022
1a1821c
fix: layouts
cetinozgur Nov 27, 2022
c6bcdd2
feat: add elapsed time converter for story dates
cetinozgur Nov 27, 2022
78adf7d
feat: set caching with offset pagination
cetinozgur Nov 28, 2022
f139e01
fix: pagination limit
cetinozgur Nov 28, 2022
b8a5bb0
update schema according to caching variables
cetinozgur Nov 28, 2022
d65f35d
Merge pull request #15 from cetinozgur/development
cetinozgur Nov 28, 2022
3060ba0
fix: save theme selection to localstorage to prevent reset on refresh
cetinozgur Nov 28, 2022
60f6f7c
feat: add feed title comp
cetinozgur Nov 28, 2022
4e69c53
feat: add comment feature
cetinozgur Nov 28, 2022
5969f54
fix: delete logs & update types
cetinozgur Nov 28, 2022
39fb619
remove express backend, proceed with apollo-server
cetinozgur Nov 28, 2022
4bfe994
chore: graphql-server -> server
cetinozgur Nov 28, 2022
fc9bdec
not found and home page placeholders
cetinozgur Nov 28, 2022
5044a5b
add env example for server
cetinozgur Nov 28, 2022
89efbe0
Merge pull request #16 from cetinozgur/development
cetinozgur Nov 28, 2022
2a90b6b
add env example for client
cetinozgur Nov 28, 2022
138237e
erge branch 'development'
cetinozgur Nov 28, 2022
f258690
Rename Layout.tsx to layout.tsx
cetinozgur Nov 28, 2022
4e5f064
Create README.md
cetinozgur Nov 28, 2022
1e37ced
feat: add author details popover
cetinozgur Nov 29, 2022
ec4b60f
Merge branch 'main' of https://github.com/cetinozgur/pego-hackernews
cetinozgur Nov 29, 2022
39ede6e
chore: rename story api to hackernews api
cetinozgur Nov 29, 2022
bc49c1d
feat: user object to comment query chain
cetinozgur Nov 29, 2022
4157638
feat: add user popover component to comments
cetinozgur Nov 29, 2022
337f43e
feat: add profile drawer
cetinozgur Nov 29, 2022
857a98c
feat: add prisma, postgres & mutations for user creation and adding f…
cetinozgur Nov 29, 2022
a6c8288
feat: add profile drawer
cetinozgur Nov 29, 2022
d59c468
fix: revert addToFav mutation deletion
cetinozgur Nov 29, 2022
c345c79
fix: remove postgres & prisma setup
cetinozgur Nov 29, 2022
5d2cdff
add dummy query & resolvers
cetinozgur Nov 29, 2022
dbaf05a
fix: userid -> userEmail in query
cetinozgur Nov 29, 2022
5e07c59
add get favs query
cetinozgur Nov 29, 2022
e9e6e6c
add to fav mutation
cetinozgur Nov 29, 2022
59139c0
add docker files
cetinozgur Nov 29, 2022
d702eae
add user favourites page
cetinozgur Nov 29, 2022
e32509c
configure docker, fixes, add to fav feat
cetinozgur Nov 29, 2022
0006cea
add user favourites feed
cetinozgur Nov 29, 2022
030bc35
update readme
cetinozgur Nov 29, 2022
54c4a8d
Delete .DS_Store
cetinozgur Nov 29, 2022
3569962
fix merge
cetinozgur Nov 29, 2022
709a46e
minor fixes
cetinozgur Nov 30, 2022
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
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Challenges
Checkout our Challenges!
Clone the project

### What we would love to see
- Your ability to solve problems
- Thinking beyond the explicit requirements
- Clean code (use linters)
- TDD techniques
```bash
git clone https://github.com/cetinozgur/pego-hackernews
```

If you have any question, you can open an issue on GitHub or send us an email.
Go to the project directory

### FullStack
```bash
cd pego-hackerbews
```

- [Fullstack Hacker News](fullstack.md)
Open two terminals and run the project with the following commands.

### Frontend
- [Frontend Hacker News](frontend.md)
Client

```bash
cd client && npm install && npm run start
```

Server

```bash
cd server && npm install && npm run compile & docker-compose up -d
```
6 changes: 6 additions & 0 deletions client/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
REACT_APP_AUTH0_DOMAIN=dev-3ke2nu4o6dtdifah.us.auth0.com
REACT_APP_AUTH0_CLIENT_ID=UyjP3UG9C37Zl1CvZxRa8lBOp5Ijvy0j
REACT_APP_AUTH0_CALLBACK_URL=http://localhost:3000/stories/top
REACT_APP_AUTH0_AUDIENCE=https://hackernews.example.com

`
25 changes: 25 additions & 0 deletions client/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["react", "@typescript-eslint"],
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
},
"rules": {
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"react/react-in-jsx-scope": 0,
"@typescript-eslint/no-explicit-any": 0
}
}
24 changes: 24 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

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

npm-debug.log*
yarn-debug.log*
yarn-error.log*
notes.txt
15 changes: 15 additions & 0 deletions client/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
overwrite: true,
schema: "http://localhost:4000/graphql",
documents: "src/**/*.tsx",
generates: {
"./src/gql/": {
preset: "client",
plugins: [],
},
},
};

export default config;
19 changes: 19 additions & 0 deletions client/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
const { addWebpackAlias } = require("customize-cra");
const { override } = require("customize-cra");
const addLessLoader = require("customize-cra-less-loader");
const path = require("path");

module.exports = override(
addLessLoader({
// If you are using less-loader@5 or older version, please spread the lessOptions to options directly.
lessOptions: {
javascriptEnabled: true,
modifyVars: { "@base-color": "#880061" },
},
}),
addWebpackAlias({
"@": path.resolve(__dirname, "src"),
})
);
Loading