StoryNest is a full-stack web application that allows users to register, log in, and share personal stories. It features:
- Secure authentication,
- End-to-end CRUD operations for story management and
- Docker container for consistent deployment across environments, enhance portability, and support horizontal scaling.
Node.js and npm installed on your machine.
- Clone this repository
- Open terminal, go to backend folder, run
npm install . - Open terminal, go to frontend folder, run
npm install .
- In one terminal, go to backend directory and run
node server.jsornpm run server - In other terminal, go to frontend directory and run
npm start
Ensure you have Docker installed on your machine.
- Run
docker-compose up --build
Technologies Used
- ExpressJS (NodeJS web application framework)
- Mongoose (ODM library for MongoDB and NodeJS)
Resources are managed by REST API
- User
- Stories
POST http://localhost:5000/api/register
{
"username": "hasnin",
"password": "123456"
}
POST http://localhost:5000/api/login
{
"username": "hasnin",
"password": "123456"
}
API will response with a token(bearer token). Needed for Authorization.
GET http://localhost:5000/api/stories/{story_id}
GET http://localhost:5000/api/stories
For following endpoints
- Set
Authorizationfield toBearer Tokentype and - Fetch token from response of Login endpoint and type it in Bearer Token
POST http://localhost:5000/api/stories
{
"title":"Gym Class Heroes",
"story":"Stereo Hearts"
}
i) Update Title
PUT http://localhost:5000/api/stories/{story_id}
{
"newtitle":"Gym Class Heroes"
}
ii) Update Story
PUT http://localhost:5000/api/stories/{story_id}
{
"newstory":"Stereo Hearts"
}
iii) Update Title and Story
PUT http://localhost:5000/api/stories/{story_id}
{
"newtitle":"Gym Class Heroes",
"newstory":"Stereo Hearts"
}
DELETE http://localhost:5000/api/stories/{story_id}
Technologies Used
-
React (Frontend JS library)
-
Bootstrap (CSS framework)