├── .env.example ├── .env.test ├── .eslintignore ├── .eslintrc.json ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .huskyrc.json ├── .lintstagedrc.json ├── .vscode └── launch.json ├── README.md ├── babel.config.js ├── commitlint.config.js ├── docker-compose.yml ├── jest.config.js ├── ormconfig.example.json ├── ormconfig.json ├── package.json ├── prettier.config.js ├── src ├── data │ ├── protocols │ │ ├── cache │ │ │ ├── IClearCache.ts │ │ │ ├── ILoadCache.ts │ │ │ └── ISaveCache.ts │ │ ├── crypto │ │ │ ├── IDecrypter.ts │ │ │ ├── IEncrypter.ts │ │ │ ├── IHashComparer.ts │ │ │ └── IHasher.ts │ │ ├── database │ │ │ ├── posts │ │ │ │ ├── ICreatePostRepository.ts │ │ │ │ └── IFindPostsByUserRepository.ts │ │ │ └── users │ │ │ │ ├── ICreateUserRepository.ts │ │ │ │ └── ILoadUserByEmailRepository.ts │ │ └── mail │ │ │ └── IMail.ts │ ├── test │ │ ├── index.ts │ │ ├── mockCache.ts │ │ ├── mockPost.ts │ │ └── mockUser.ts │ └── useCases │ │ ├── posts │ │ ├── create │ │ │ ├── DbCreatePost.spec.ts │ │ │ └── DbCreatePost.ts │ │ └── findByUser │ │ │ ├── DbFindPostsByUser.spec.ts │ │ │ └── DbFindPostsByUser.ts │ │ └── users │ │ ├── auth │ │ ├── DbAuthentication.spec.ts │ │ └── DbAuthentication.ts │ │ ├── create │ │ ├── DbCreateUser.spec.ts │ │ └── DbCreateUser.ts │ │ └── crypto │ │ ├── DecryptUserIdByToken.spec.ts │ │ └── DecryptUserIdByToken.ts ├── domain │ ├── models │ │ ├── Post.ts │ │ └── User.ts │ ├── test │ │ ├── index.ts │ │ ├── mockPost.ts │ │ └── mockUser.ts │ └── useCases │ │ ├── posts │ │ ├── ICreatePost.ts │ │ └── IFindPostsByUser.ts │ │ └── users │ │ ├── IAuthentication.ts │ │ ├── ICreateUser.ts │ │ └── ILoadUserIdByToken.ts ├── infra │ ├── cache │ │ └── redisAdapter │ │ │ ├── RedisAdapter.spec.ts │ │ │ └── RedisAdapter.ts │ ├── crypto │ │ ├── bcryptAdapter │ │ │ ├── BcryptAdapter.spec.ts │ │ │ └── BcryptAdapter.ts │ │ └── jwtAdapter │ │ │ ├── JwtAdapter.spec.ts │ │ │ └── JwtAdapter.ts │ ├── database │ │ └── typeorm │ │ │ ├── connection.ts │ │ │ ├── entities │ │ │ ├── Post.ts │ │ │ └── User.ts │ │ │ ├── migrations │ │ │ ├── 1601689010415-CreateUsers.ts │ │ │ └── 1602290961827-CreatePosts.ts │ │ │ └── repositories │ │ │ ├── PostsRepository.spec.ts │ │ │ ├── PostsRepository.ts │ │ │ ├── UsersRepository.spec.ts │ │ │ └── UsersRepository.ts │ └── mail │ │ ├── NodemailerAdapter.spec.ts │ │ └── NodemailerAdapter.ts ├── main │ ├── app │ │ ├── adapters │ │ │ ├── middlewares.ts │ │ │ └── routes.ts │ │ ├── factories │ │ │ ├── controllers │ │ │ │ ├── posts │ │ │ │ │ ├── createPostController.ts │ │ │ │ │ └── findPostsByUserController.ts │ │ │ │ └── users │ │ │ │ │ ├── createUserController.ts │ │ │ │ │ └── loginController.ts │ │ │ ├── middlewares │ │ │ │ └── authMiddleware.ts │ │ │ └── useCases │ │ │ │ ├── posts │ │ │ │ ├── dbCreatePost.ts │ │ │ │ └── dbFindPostsByUser.ts │ │ │ │ └── users │ │ │ │ ├── dbAuthentication.ts │ │ │ │ ├── dbCreateUser.ts │ │ │ │ └── decryptUserIdByToken.ts │ │ ├── index.ts │ │ ├── middlewares │ │ │ └── auth.ts │ │ └── routes │ │ │ ├── index.ts │ │ │ ├── login │ │ │ ├── login.routes.test.ts │ │ │ └── login.routes.ts │ │ │ ├── posts │ │ │ ├── posts.routes.test.ts │ │ │ └── posts.routes.ts │ │ │ └── users │ │ │ ├── users.routes.test.ts │ │ │ └── users.routes.ts │ ├── config │ │ ├── auth.ts │ │ ├── cache.ts │ │ ├── custom-modules.d.ts │ │ ├── env.ts │ │ └── mail.ts │ └── server.ts └── presentation │ ├── controllers │ ├── posts │ │ ├── createPost │ │ │ ├── CreatePostController.spec.ts │ │ │ └── CreatePostController.ts │ │ └── findPostsByUser │ │ │ ├── FindPostsByUserController.spec.ts │ │ │ └── FindPostsByUserController.ts │ └── users │ │ ├── createUser │ │ ├── CreateUserController.spec.ts │ │ └── CreateUserController.ts │ │ └── login │ │ ├── LoginController.spec.ts │ │ └── LoginController.ts │ ├── errors │ ├── AccessDeniedError.ts │ ├── EmailInUseError.ts │ └── ServerError.ts │ ├── helpers │ └── http.ts │ ├── middlewares │ ├── AuthMiddleware.spec.ts │ └── AuthMiddleware.ts │ └── protocols │ ├── Http.ts │ ├── IController.ts │ └── IMiddleware.ts ├── tsconfig.json └── yarn.lock /.env.example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/.env.example -------------------------------------------------------------------------------- /.env.test: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /*.js 2 | node_modules 3 | dist 4 | coverage -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/.eslintrc.json -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | coverage 4 | 5 | .env 6 | 7 | *.sqlite -------------------------------------------------------------------------------- /.huskyrc.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/.huskyrc.json -------------------------------------------------------------------------------- /.lintstagedrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "*.ts": ["eslint 'src/**/*.ts' --fix", "yarn test:staged"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/.vscode/launch.json -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/README.md -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/babel.config.js -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] }; 2 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/docker-compose.yml -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/jest.config.js -------------------------------------------------------------------------------- /ormconfig.example.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/ormconfig.example.json -------------------------------------------------------------------------------- /ormconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/ormconfig.json -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/package.json -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/prettier.config.js -------------------------------------------------------------------------------- /src/data/protocols/cache/IClearCache.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/cache/IClearCache.ts -------------------------------------------------------------------------------- /src/data/protocols/cache/ILoadCache.ts: -------------------------------------------------------------------------------- 1 | export interface ILoadCache { 2 | load(key: string): Promise; 3 | } 4 | -------------------------------------------------------------------------------- /src/data/protocols/cache/ISaveCache.ts: -------------------------------------------------------------------------------- 1 | export interface ISaveCache { 2 | save(key: string, data: any): Promise; 3 | } 4 | -------------------------------------------------------------------------------- /src/data/protocols/crypto/IDecrypter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/crypto/IDecrypter.ts -------------------------------------------------------------------------------- /src/data/protocols/crypto/IEncrypter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/crypto/IEncrypter.ts -------------------------------------------------------------------------------- /src/data/protocols/crypto/IHashComparer.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/crypto/IHashComparer.ts -------------------------------------------------------------------------------- /src/data/protocols/crypto/IHasher.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/crypto/IHasher.ts -------------------------------------------------------------------------------- /src/data/protocols/database/posts/ICreatePostRepository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/database/posts/ICreatePostRepository.ts -------------------------------------------------------------------------------- /src/data/protocols/database/posts/IFindPostsByUserRepository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/database/posts/IFindPostsByUserRepository.ts -------------------------------------------------------------------------------- /src/data/protocols/database/users/ICreateUserRepository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/database/users/ICreateUserRepository.ts -------------------------------------------------------------------------------- /src/data/protocols/database/users/ILoadUserByEmailRepository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/database/users/ILoadUserByEmailRepository.ts -------------------------------------------------------------------------------- /src/data/protocols/mail/IMail.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/protocols/mail/IMail.ts -------------------------------------------------------------------------------- /src/data/test/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/test/index.ts -------------------------------------------------------------------------------- /src/data/test/mockCache.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/test/mockCache.ts -------------------------------------------------------------------------------- /src/data/test/mockPost.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/test/mockPost.ts -------------------------------------------------------------------------------- /src/data/test/mockUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/test/mockUser.ts -------------------------------------------------------------------------------- /src/data/useCases/posts/create/DbCreatePost.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/posts/create/DbCreatePost.spec.ts -------------------------------------------------------------------------------- /src/data/useCases/posts/create/DbCreatePost.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/posts/create/DbCreatePost.ts -------------------------------------------------------------------------------- /src/data/useCases/posts/findByUser/DbFindPostsByUser.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/posts/findByUser/DbFindPostsByUser.spec.ts -------------------------------------------------------------------------------- /src/data/useCases/posts/findByUser/DbFindPostsByUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/posts/findByUser/DbFindPostsByUser.ts -------------------------------------------------------------------------------- /src/data/useCases/users/auth/DbAuthentication.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/users/auth/DbAuthentication.spec.ts -------------------------------------------------------------------------------- /src/data/useCases/users/auth/DbAuthentication.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/users/auth/DbAuthentication.ts -------------------------------------------------------------------------------- /src/data/useCases/users/create/DbCreateUser.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/users/create/DbCreateUser.spec.ts -------------------------------------------------------------------------------- /src/data/useCases/users/create/DbCreateUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/users/create/DbCreateUser.ts -------------------------------------------------------------------------------- /src/data/useCases/users/crypto/DecryptUserIdByToken.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/users/crypto/DecryptUserIdByToken.spec.ts -------------------------------------------------------------------------------- /src/data/useCases/users/crypto/DecryptUserIdByToken.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/data/useCases/users/crypto/DecryptUserIdByToken.ts -------------------------------------------------------------------------------- /src/domain/models/Post.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/models/Post.ts -------------------------------------------------------------------------------- /src/domain/models/User.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/models/User.ts -------------------------------------------------------------------------------- /src/domain/test/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/test/index.ts -------------------------------------------------------------------------------- /src/domain/test/mockPost.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/test/mockPost.ts -------------------------------------------------------------------------------- /src/domain/test/mockUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/test/mockUser.ts -------------------------------------------------------------------------------- /src/domain/useCases/posts/ICreatePost.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/useCases/posts/ICreatePost.ts -------------------------------------------------------------------------------- /src/domain/useCases/posts/IFindPostsByUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/useCases/posts/IFindPostsByUser.ts -------------------------------------------------------------------------------- /src/domain/useCases/users/IAuthentication.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/useCases/users/IAuthentication.ts -------------------------------------------------------------------------------- /src/domain/useCases/users/ICreateUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/useCases/users/ICreateUser.ts -------------------------------------------------------------------------------- /src/domain/useCases/users/ILoadUserIdByToken.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/domain/useCases/users/ILoadUserIdByToken.ts -------------------------------------------------------------------------------- /src/infra/cache/redisAdapter/RedisAdapter.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/cache/redisAdapter/RedisAdapter.spec.ts -------------------------------------------------------------------------------- /src/infra/cache/redisAdapter/RedisAdapter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/cache/redisAdapter/RedisAdapter.ts -------------------------------------------------------------------------------- /src/infra/crypto/bcryptAdapter/BcryptAdapter.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/crypto/bcryptAdapter/BcryptAdapter.spec.ts -------------------------------------------------------------------------------- /src/infra/crypto/bcryptAdapter/BcryptAdapter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/crypto/bcryptAdapter/BcryptAdapter.ts -------------------------------------------------------------------------------- /src/infra/crypto/jwtAdapter/JwtAdapter.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/crypto/jwtAdapter/JwtAdapter.spec.ts -------------------------------------------------------------------------------- /src/infra/crypto/jwtAdapter/JwtAdapter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/crypto/jwtAdapter/JwtAdapter.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/connection.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/connection.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/entities/Post.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/entities/Post.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/entities/User.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/entities/User.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/migrations/1601689010415-CreateUsers.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/migrations/1601689010415-CreateUsers.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/migrations/1602290961827-CreatePosts.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/migrations/1602290961827-CreatePosts.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/repositories/PostsRepository.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/repositories/PostsRepository.spec.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/repositories/PostsRepository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/repositories/PostsRepository.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/repositories/UsersRepository.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/repositories/UsersRepository.spec.ts -------------------------------------------------------------------------------- /src/infra/database/typeorm/repositories/UsersRepository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/database/typeorm/repositories/UsersRepository.ts -------------------------------------------------------------------------------- /src/infra/mail/NodemailerAdapter.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/mail/NodemailerAdapter.spec.ts -------------------------------------------------------------------------------- /src/infra/mail/NodemailerAdapter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/infra/mail/NodemailerAdapter.ts -------------------------------------------------------------------------------- /src/main/app/adapters/middlewares.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/adapters/middlewares.ts -------------------------------------------------------------------------------- /src/main/app/adapters/routes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/adapters/routes.ts -------------------------------------------------------------------------------- /src/main/app/factories/controllers/posts/createPostController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/controllers/posts/createPostController.ts -------------------------------------------------------------------------------- /src/main/app/factories/controllers/posts/findPostsByUserController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/controllers/posts/findPostsByUserController.ts -------------------------------------------------------------------------------- /src/main/app/factories/controllers/users/createUserController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/controllers/users/createUserController.ts -------------------------------------------------------------------------------- /src/main/app/factories/controllers/users/loginController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/controllers/users/loginController.ts -------------------------------------------------------------------------------- /src/main/app/factories/middlewares/authMiddleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/middlewares/authMiddleware.ts -------------------------------------------------------------------------------- /src/main/app/factories/useCases/posts/dbCreatePost.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/useCases/posts/dbCreatePost.ts -------------------------------------------------------------------------------- /src/main/app/factories/useCases/posts/dbFindPostsByUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/useCases/posts/dbFindPostsByUser.ts -------------------------------------------------------------------------------- /src/main/app/factories/useCases/users/dbAuthentication.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/useCases/users/dbAuthentication.ts -------------------------------------------------------------------------------- /src/main/app/factories/useCases/users/dbCreateUser.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/useCases/users/dbCreateUser.ts -------------------------------------------------------------------------------- /src/main/app/factories/useCases/users/decryptUserIdByToken.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/factories/useCases/users/decryptUserIdByToken.ts -------------------------------------------------------------------------------- /src/main/app/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/index.ts -------------------------------------------------------------------------------- /src/main/app/middlewares/auth.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/middlewares/auth.ts -------------------------------------------------------------------------------- /src/main/app/routes/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/routes/index.ts -------------------------------------------------------------------------------- /src/main/app/routes/login/login.routes.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/routes/login/login.routes.test.ts -------------------------------------------------------------------------------- /src/main/app/routes/login/login.routes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/routes/login/login.routes.ts -------------------------------------------------------------------------------- /src/main/app/routes/posts/posts.routes.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/routes/posts/posts.routes.test.ts -------------------------------------------------------------------------------- /src/main/app/routes/posts/posts.routes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/routes/posts/posts.routes.ts -------------------------------------------------------------------------------- /src/main/app/routes/users/users.routes.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/routes/users/users.routes.test.ts -------------------------------------------------------------------------------- /src/main/app/routes/users/users.routes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/app/routes/users/users.routes.ts -------------------------------------------------------------------------------- /src/main/config/auth.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/config/auth.ts -------------------------------------------------------------------------------- /src/main/config/cache.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/config/cache.ts -------------------------------------------------------------------------------- /src/main/config/custom-modules.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/config/custom-modules.d.ts -------------------------------------------------------------------------------- /src/main/config/env.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/config/env.ts -------------------------------------------------------------------------------- /src/main/config/mail.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/config/mail.ts -------------------------------------------------------------------------------- /src/main/server.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/main/server.ts -------------------------------------------------------------------------------- /src/presentation/controllers/posts/createPost/CreatePostController.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/posts/createPost/CreatePostController.spec.ts -------------------------------------------------------------------------------- /src/presentation/controllers/posts/createPost/CreatePostController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/posts/createPost/CreatePostController.ts -------------------------------------------------------------------------------- /src/presentation/controllers/posts/findPostsByUser/FindPostsByUserController.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/posts/findPostsByUser/FindPostsByUserController.spec.ts -------------------------------------------------------------------------------- /src/presentation/controllers/posts/findPostsByUser/FindPostsByUserController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/posts/findPostsByUser/FindPostsByUserController.ts -------------------------------------------------------------------------------- /src/presentation/controllers/users/createUser/CreateUserController.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/users/createUser/CreateUserController.spec.ts -------------------------------------------------------------------------------- /src/presentation/controllers/users/createUser/CreateUserController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/users/createUser/CreateUserController.ts -------------------------------------------------------------------------------- /src/presentation/controllers/users/login/LoginController.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/users/login/LoginController.spec.ts -------------------------------------------------------------------------------- /src/presentation/controllers/users/login/LoginController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/controllers/users/login/LoginController.ts -------------------------------------------------------------------------------- /src/presentation/errors/AccessDeniedError.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/errors/AccessDeniedError.ts -------------------------------------------------------------------------------- /src/presentation/errors/EmailInUseError.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/errors/EmailInUseError.ts -------------------------------------------------------------------------------- /src/presentation/errors/ServerError.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/errors/ServerError.ts -------------------------------------------------------------------------------- /src/presentation/helpers/http.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/helpers/http.ts -------------------------------------------------------------------------------- /src/presentation/middlewares/AuthMiddleware.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/middlewares/AuthMiddleware.spec.ts -------------------------------------------------------------------------------- /src/presentation/middlewares/AuthMiddleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/middlewares/AuthMiddleware.ts -------------------------------------------------------------------------------- /src/presentation/protocols/Http.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/protocols/Http.ts -------------------------------------------------------------------------------- /src/presentation/protocols/IController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/protocols/IController.ts -------------------------------------------------------------------------------- /src/presentation/protocols/IMiddleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/src/presentation/protocols/IMiddleware.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/tsconfig.json -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcosvcorsi/clean-blog-api/HEAD/yarn.lock --------------------------------------------------------------------------------