Kickstart your project with Next.js, Express and MySQL
- in both
backend+frontenddirectories: create.envfile (based on.env.examplefile) and update with your infos - delete
.env.examplefile - create your database using the query suggested in
database.jsfile - change the favicos in
frontend/publicdirectory - replace "TOFIX" in the code base with your infos
Use nvm to easy change the right Node.js version
First time:
- nvm install
- in
backend+frontenddirectories:npm install
Each time:
-
open
backenddirectory -
launch
nvm useandnpm run dev -
open
frontenddirectory -
launch
nvm useandnpm run dev -
go to localhost:3000 to see your welcome page
You can use nginx + pm2
- Use nginx to reverse proxy
localhost:3000(the frontend) to your-domain.frlocalhost:3001(the backend API) to your-domain.fr/api- TODO (add doc here)
- in
backenddirectory - replace
.envinfos - pm2 stop
your-project-back - git pull
- pm2 start
your-project-back
- in
frontenddirectory - replace
.envinfos - pm2 stop
your-project-front - git pull
- cd frontend
- npm run build
- pm2 start
your-project-front