RedisCacheApp is a full stack application combining with a frontend named 'client' and a backend named 'apiServer'. MongoDb is used for the database and Redis is used for the chache server. When a data is searched from the client end, the apiServer checks the Redis cache. If it finds in cache, then responds with the data. If it does not find in cache, then searches the database and if the data is found, it responds with the data. This time it saves the data in cache.
To install it, follow these steps:
- Install node js
- Run a Redis server. To know more, click here.
- Clone the repository
- Create a database in MongoDb atlas. To know more, click here.
- Configure the redis server to run at the default port (6379).
- Change the variable DB_URL in .env file, with MongoDB connection string. The .env file can be found in 'apiServer' folder.
- To start the apiServer, use the command
cd apiServerand thennpm run dev. It will start running at port 3001 - To start the client, use the command
cd clientand thennpm start. It will start running at port 3000
- Open a browser and go to http://localhost:3000/
- Test creating, searching and deleting notes. Only searching is associated with the cache server.
- To search, enter the id provided by the MongoDB
_id, in the input field.
- To check the api server is working or not, Open a browser and go to http://localhost:3001/
- To run the client app in windows machine, a compile error may come at first. To solve it, open the package.json file in client folder and simply pres
ctrl + s
This project is provided under a free license but is intended for educational and learning purposes only. It is not recommended for use in production environments. The authors of this project do not assume any responsibility for its usage outside of learning and educational contexts.