Skip to content

RESTful social media API developed with Node.js and TypeScript, using PostgreSQL as a database, JWT authentication and Fastify.

License

Notifications You must be signed in to change notification settings

RenanTheFato/Social-Media-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Media API


📋 About The Project

RESTful social media API developed with Node.js and TypeScript, using PostgreSQL as a database, JWT authentication and Fastify.

🚀 Features

  • JWT authentication
  • User CRUD
  • Post System
  • Comments on posts
  • Follow users system

💻 Installation

1. Clone the repository

git clone https://github.com/RenanTheFato/Social-Media-API.git
cd Social-Media-API

2. Install the dependencies

npm install

3. Set the environment variables

.env.example ──> .env

4. Create the database and run

npx prisma migrate dev

5. Scripts available

# Development
npm run dev

# Build
npm run build

# Production
npm run server

📁 Project Structure

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

📚 API Documentation

  # You can access the API documentation via swagger on the route:
  http://localhost:[your-port]/docs

📄 License

This project is under the MIT license. See the LICENSE file for more details.

👥 Contribution

Share the project

📧 Contact

Renan - GitHub

Email - [email protected]

Project Link: https://github.com/RenanTheFato/Social-Media-API

About

RESTful social media API developed with Node.js and TypeScript, using PostgreSQL as a database, JWT authentication and Fastify.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published