RESTful social media API developed with Node.js and TypeScript, using PostgreSQL as a database, JWT authentication and Fastify.
- JWT authentication
- User CRUD
- Post System
- Comments on posts
- Follow users system
git clone https://github.com/RenanTheFato/Social-Media-API.git
cd Social-Media-API
npm install
.env.example ──> .env
npx prisma migrate dev
# Development
npm run dev
# Build
npm run build
# Production
npm run server
social-media-api/
├── prisma/
│ └── schema.prisma
├── src/
│ ├── controllers/
│ │ ├── comments/
│ │ │ ├── CreateCommentController.ts
│ │ │ └── DeleteCommentController.ts
│ │ ├── posts/
│ │ │ ├── CreatePostController.ts
│ │ │ ├── DeletePostController.ts
│ │ │ └── SearchPostController.ts
│ │ └── users/
│ │ ├── CreateUserController.ts
│ │ ├── DeleteUserController.ts
│ │ ├── GetUserController.ts
│ │ ├── SinginController.ts
│ │ ├── UpdateUserEmailController.ts
│ │ ├── UpdateUsernameController.ts
│ │ └── UpdateUserPasswordController.ts
│ ├── lib/
│ │ ├── prisma.ts
│ ├── middlewares/
│ │ ├── authentication.ts
│ └── services/
│ ├── comments/
│ │ ├── CreateCommentService.ts
│ │ └── DeleteCommentService.ts
│ ├── posts/
│ │ ├── CreatePostService.ts
│ │ ├── DeletePostService.ts
│ │ └── SearchPostService.ts
│ └── users/
│ ├── CreateUserService.ts
│ ├── DeleteUserService.ts
│ ├── GetUserService.ts
│ ├── SinginService.ts
│ ├── UpdateUserEmailService.ts
│ ├── UpdateUsernameService.ts
│ └── UpdateUserPasswordService.ts
├── routes.ts
├── server.ts
├── .env-example
├── .gitignore
├── package-lock.json
├── package.json
├── README.md
└── tsconfig.json
# You can access the API documentation via swagger on the route:
http://localhost:[your-port]/docs
This project is under the MIT license. See the LICENSE file for more details.
Renan - GitHub
Email - [email protected]
Project Link: https://github.com/RenanTheFato/Social-Media-API