Important
Requirements for this WEB API:
.NET Core v7.0.14
1Gb free disk space
PostgreSQL
There is a social network for people with their pets, made by Anton Kaplin (@tedecti) and Artyom Karmykov (@AgaspherGames) on C# + ASP.NET Core and Entity Framework Core with PostgreSQL database
Original frontend was made in React Native.
This works was made for Course Work in ASTANA Polytechnic College.
REST.API Docs:
POST: /register
Register user by their:
- Firstname
- Lastname
- Password
- Username
For this endpoint used AuthController and UserRepository with username and email unique check. Return 201 Code
POST: /unique
Takes:
- Username
Checks it for unique values and returns bool: true for unique, false for non-unique
POST: /login
Takes:
- Password
Returns necessary information to frontend developer, including JWT Token and 200 Code
GET: /{id}
Returns data about user by their id:
- Firstname
- Lastname
- Username
- Avatar
- Friends and followers info
- User's pets
- User's posts
Returns 200 Code
GET: /me
Returns data about logged in user (required authorize):
- Firstname
- Lastname
- Username
- Avatar
- Friends and followers info
- User's pets
- User's posts
Returns 200 Code
PUT: /edit
Allows user edit theit firstname or lastname (required authorize)
Returns 200 Code
POST: /upload
Takes:
- Images in .jpg, .jpeg, .png, .webp (required authorize)
Endpoint saves image in local files, returns uuid of the image in response, and set path as profile picture of user
Returns 200 Code
GET: /{id}
Returns data about friends of this user in array:
- Avatar
- Username
- Firstname
- Lastname
Returns 200 Code
GET: /{id}/check
Returns bool value for check, if authorized user and user by id is friends (required authorize)
Return 200 Code
POST: /{id}
Set authorized user and user by id as friends in db table (required authorize)
Return 201 Code
DELETE: /{id}
Unfriend authorized user and user by id and deleting row in db table (required authorize)
Returns 204 Code
POST: /
Accepts data for further uploading information in the form of a post on the network (required authorize):
- Title
- Description
- Images (limit of 10)
Returns 201 Code
GET: /
Returns array of all of the posts by relevance, but if you have friends, their posts will appear firstly (required authorize):
- Title
- Description
- Imgs
- UploadDate
- Sender's info
Returns 200 Code
GET: /{id}
Returns data about post by id:
- Title
- Description
- Imgs
- UploadDate
- Sender's info
Returns 200 Code
POST: /{id}
Set like on post by id and add info about it in db table (required authorize)
Returns 201 Code
DELETE: /{id}
Unlike post by id and delete row in db table (required authorize)
Returns 204 Code
GET: /{id}
Returns all of the commentaries for one post by id:
- Total count of commentaries
- Comments with post info, user info and text
Returns 200 Code
POSt: /{id}
Adds commentary to a post by id (required authorize):
- Text
Returns 201 Code
POST: /
Adds a new pet to the user by entered data (required authorize):
- Name
- Passport number
- Images
Returns 201 Code
GET: /{id}
Returns pet by id:
- Name
- Passport number
- Images
- Array of documents for pet
Returns 200 Code
POST: /{id}
Adds documents for pet by id (required authorize):
- Title
- Description
- Images of documents
Returns 201 Code
GET: /{id}
Returns data about document by document id:
- Title
- Description
- Images
- Upload date
- Info about pet
Returns 200 Code
GET: /Pet/{id}
Returns all documents by id of the pet:
- Title
- Description
- Images
- Upload date
Returns 200 Code
GET: /{uuid}
Returns image by its uuid, images saves in local folder /Images with uuid in name and searched by uuid
Returns 200 Code
GET: ?query={value}
Inside the query parameters, what the user wants to find is written in, a search is carried out by users and posts
Returns 200 Code