The Smart Brain server acts as the backbone of the Smart Brain application, providing the necessary API endpoints to handle requests and responses of the application.
- Handle Requests and Responses, ensuring smooth communication between the Smart Brain application and the server
- Face Detection with Clarifai Model, it enables accurate and reliable identification of faces in images processed by the application.
- Connect to PostgreSQL Database, enabling fluid interaction with the database for storing and retrieving user information. This connection facilitates efficient data management and ensures the integrity and security of user data.
- Manage User Authentication and Registration with the database integration. It securely stores user information, handles user authentication requests, and facilitates user registration processes, ensuring a uninterrupted and secure user experience.
- Clone the repo
git clone https://github.com/huongnguyen1709/smart-brain-server.git
- Install NPM packages
npm install
- Run the Project
npm start
Endpoint | Method | Description | Response Example |
---|---|---|---|
/ |
GET |
Health check endpoint to verify server is running. | { "message": "success connection" } |
/signin |
POST |
Authenticates a user and returns their profile if successful. | { "id": 2, "name": "John Smith", "email": "[email protected]", "entries": 0 } or { "error": "Wrong credentials" } |
/register |
POST |
Registers a new user and returns their profile. | { "id": 2, "name": "Alice", "email": "[email protected]" } |
/profile/:id |
GET |
Retrieves user details based on their unique id . |
{ "id": 2, "name": "John Smith", "email": "[email protected]" } |
/image |
PUT |
Updates the user’s image entry count after a successful image submission. | { "entries": 5 } or { "error": "Unable to update entries" } or { "error": "error getting face detection" } |
Distributed under the MIT License. See LICENSE.txt
for more information.