The Next.js application provide the admin UI to allow giving lotus in form of lixi (red envelope lucky money).
yarn install
Setup https certificate on local machine (Recommend: mkcert)
Setup environment variables
Copy .env.example file to .env and change the variables
Setup nginx reverse proxy (backend and frontend use same server) Change the certificates path accordingly
server {
listen 127.0.0.1:443 ssl http2;
ssl_certificate_key "f:/winnmp/conf/opensslCA/selfsigned/lixilotus.test.key";
ssl_certificate "f:/winnmp/conf/opensslCA/selfsigned/lixilotus.test.crt";
server_name lixilotus.test;
location ^~ /socket.io/ {
proxy_pass http://localhost:4800/socket.io/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /_next/webpack-hmr {
proxy_pass http://localhost:3000/_next/webpack-hmr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ^~ /api/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:4800$request_uri;
}
location ^~ /_api/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:3000$request_uri;
}
}
First, run the development server:
yarn dev
Open https://lixilotus.test with your browser to see the result.
Code released under the MIT license.
Copyright 2020-2022 bcProFoundation.