The project aims to create a web server with API support for user authentication, media file upload, and media content streaming. This project can be used to create a blog with the ability to upload and view videos.
Used to create a high-performance web server with logging support and various HTTP methods.
MongoDB
Database for storing user information, posts, and files.
GridFS
A file system for MongoDB that allows storing large files such as videos.
Dynamic JWT Authentication
Used to protect the API and ensure secure user authentication. Unlike standard JWT, this implementation is dynamic, which means the tokens are updated regularly, enhancing security and reducing the risk of token misuse.
How It Works
User Registration
The user provides a username, email, and password.
Validation of the provided data.
Storing user information in the database with generating a unique authentication token.
Token Update
Updating user authentication tokens using a refresh token.
File Upload
Uploading media files to GridFS.
Media Streaming
Streaming video with byte range support to provide functionality similar to HLS servers. This is my implementation of HLS streams in the media server.
Skills Acquired
Fastify Development
Setting up and configuring a high-performance web server.
Implementing API methods for various CRUD operations.
Working with MongoDB
Using MongoDB to store user data and files.
Working with GridFS to upload and store large files.
Dynamic JWT Authentication
Implementing dynamic JWT authentication to secure the API. This dynamic approach involves regularly updating tokens, enhancing security, and reducing the risk of token misuse.
Validating user data.
Handling Media Content
Creating a streaming media server for video playback.
Implementing HLS streams in the media server to enable streaming functionality.
Working with byte ranges to provide functionality similar to HLS servers.
Conclusion
This project provides practical experience in creating a comprehensive web server with media functionality and ensuring a high level of security.