Welcome to the Andromeda Node.js Express API! This project serves as the backend for Andromeda, a social media platform. It provides a set of RESTful endpoints to manage users, friendships, posts, likes, comments, tags, notifications, products, product likes, product comments, product tags, chats, and messages. The API uses JWT for authentication and Neo4j and Redis as the databases.
To get a local copy up and running, follow these simple steps.
git clone https://github.com/7irelo/andromeda-express-api.git
cd andromeda-express-api
npm install
.env
:
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=password
REDIS_HOST=localhost
REDIS_PORT=6379
JWT_SECRET=your_jwt_secret
npm run migrate
npm start
After running the application, the API will be available at http://localhost:5000/api
.
You can use tools like Postman or curl to test the endpoints.
To register a new user:
curl -X POST http://localhost:5000/api/users -H "Content-Type: application/json" -d '{
"username": "testuser",
"email": "[email protected]",
"password": "P@ssw0rd"
}'
GET /api/users
: Get all usersGET /api/users/:id
: Get user by IDPOST /api/users
: Create a new userPUT /api/users/:id
: Update an existing userDELETE /api/users/:id
: Delete a userPOST /api/auth/login
: Login and get a JWT tokenGET /api/friendships
: Get all friendshipsGET /api/friendships/:id
: Get friendship by IDPOST /api/friendships
: Create a new friendshipPUT /api/friendships/:id
: Update an existing friendshipDELETE /api/friendships/:id
: Delete a friendshipGET /api/posts
: Get all postsGET /api/posts/:id
: Get post by IDPOST /api/posts
: Create a new postPUT /api/posts/:id
: Update an existing postDELETE /api/posts/:id
: Delete a postGET /api/likes
: Get all likesGET /api/likes/:id
: Get like by IDPOST /api/likes
: Create a new likePUT /api/likes/:id
: Update an existing likeDELETE /api/likes/:id
: Delete a likeGET /api/comments
: Get all commentsGET /api/comments/:id
: Get comment by IDPOST /api/comments
: Create a new commentPUT /api/comments/:id
: Update an existing commentDELETE /api/comments/:id
: Delete a commentGET /api/tags
: Get all tagsGET /api/tags/:name
: Get tag by namePOST /api/tags
: Create a new tagPUT /api/tags/:name
: Update an existing tagDELETE /api/tags/:name
: Delete a tagGET /api/notifications
: Get all notificationsGET /api/notifications/:id
: Get notification by IDPOST /api/notifications
: Create a new notificationPUT /api/notifications/:id
: Update an existing notificationDELETE /api/notifications/:id
: Delete a notificationGET /api/products
: Get all productsGET /api/products/:id
: Get product by IDPOST /api/products
: Create a new productPUT /api/products/:id
: Update an existing productDELETE /api/products/:id
: Delete a productGET /api/productLikes
: Get all product likesGET /api/productLikes/:id
: Get product like by IDPOST /api/productLikes
: Create a new product likePUT /api/productLikes/:id
: Update an existing product likeDELETE /api/productLikes/:id
: Delete a product likeGET /api/productComments
: Get all product commentsGET /api/productComments/:id
: Get product comment by IDPOST /api/productComments
: Create a new product commentPUT /api/productComments/:id
: Update an existing product commentDELETE /api/productComments/:id
: Delete a product commentGET /api/productTags
: Get all product tagsGET /api/productTags/:id
: Get product tag by IDPOST /api/productTags
: Create a new product tagPUT /api/productTags/:id
: Update an existing product tagDELETE /api/productTags/:id
: Delete a product tagGET /api/chats
: Get all chatsGET /api/chats/:id
: Get chat by IDPOST /api/chats
: Create a new chatPUT /api/chats/:id
: Update an existing chatDELETE /api/chats/:id
: Delete a chatGET /api/messages
: Get all messagesGET /api/messages/:id
: Get message by IDPOST /api/messages
: Create a new messagePUT /api/messages/:id
: Update an existing messageDELETE /api/messages/:id
: Delete a messageContributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Thank you for using Andromeda Node.js Express API! If you have any questions or suggestions, please feel free to open an issue or contact the project maintainers. Happy coding!