This is a Next.js project bootstrapped with create-next-app
.
Install the following:
Frontend production deployment
cd usc-website-hackathon-frontend
npm install
npm run dev
At this stage, if you do not want the hassle of setting up the backend locally or you only intend to focuse on the UI, you can use the shared development backend at https://dev.nusc.club/ for dev purposes. Note that https://dev.nusc.club/ points to https://167.71.198.73/ (a DigitalOcean droplet).
To use shared development backend, you do not need to do anything. The .env file's NEXT_PUBLIC_BACKEND_URL
by default points to https://dev.nusc.club/.
You should run the backend locally if you do not want your changes to the database to be reflected to others.
NEXT_PUBLIC_BACKEND_URL
to the appropriate localhost URL.cd <backend repo> && npm run dev
cd <backend repo> && docker-compose up
Do run the linters before pushing to the remote:
npm run linter-prettier
npm run linter-eslint
npm run linter-next
If you are working on the certain components such as the bookings or the admin pages, you may need to login to test your changes.
NEXT_PUBLIC_BACKEND_JWT_DEV
in the .env
file. Copy your userId from the "Users" table in the DB to NEXT_PUBLIC_BACKEND_TELEGRAM_USER_ID
as well.telegramId
field.mkcert
from https://github.com/FiloSottile/mkcert and generate certs for a domain. I am using frontend.local.dev
. (run the commands in certgen.sh
in the nginx folder)127.0.0.1 frontend.local.dev
app.conf
in the config/To set up Telegram Auth
folder over to /etc/nginx/conf.d
or to a path that you have included in your nginx.conf
(see the sample nginx.conf
's line 17 to see how you can include the conf.d
directory on a Mac machine - Linux should have this by default)sudo nginx -t && sudo systemctl restart nginx
for Linux, sudo nginx -t && sudo nginx -s stop && sudo nginx
for MacOSapache
running, need to deconflict it as pgadmin uses it as well. You can change the port it uses, or change nginx's port. Otherwise, you can just sudo service apache2 stop
and not use pgadmin.The second method should be Docker-ised if possible, view the Archive
folder in /config/To set up Telegram Auth
.
Add your Tele handle to the Users sheet in the Excel file, and your organisations you are a member of to the userOnOrg sheet in the file. Do add yourself to an admin organisation, such as the Management Committee. Otherwise, you can manually add it yourself (steps below)
$ docker-compose up
$ npm install
$ npm run prisma:migrate
$ npm run prisma:seed
$ # update env files
$ git checkout frontend
$ npm install
$ npm run prisma:reset