A simple image server built with Node.js and Next.js
Here's the link to the tutorial: https://www.youtube.com/
This is a simple image server built with Node.js and Next.js. It is a simple project that I built to learn more about Next.js and how to build a server with it. It is a simple image server that allows you to upload images and then view and also delete them.
- Upload images with verified API key
- View images
- Delete images with verified API key
const bcrypt = require('bcryptjs');
// Generate a random 12 byte string
const api_key = bcrypt.hash('random', 12);
// Create an has of the `api_key` and store it in the database
const SECRET_ENCRYPTION_KEY = bcrypt.hash(api_key, 12);
- Go to the backend folder
cd Backend-NodeJS-Express
- Create a .env file in the backend folder
touch .env
- Add the following to the .env file
NODE_ENV=development
PORT=5000
SECRET_API_ENCRYPTION_KEY=SECRET_ENCRYPTION_KEY
- Install NPM packages
npm install
- Run the server
npm run dev
- Go to the frontend folder
cd frontend-nextjs
- create a .env file in the frontend folder
touch .env
- Add the following to the .env file
NEXT_PUBLIC_IMAGE_API_URL=http://localhost:5000
NEXT_PUBLIC_API_KEY=api_key
- Install the packages
yarn
- Run the server
yarn dev
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request