- Node.js (use the LTS version)
- A PostgreSQL database (optional if you don't need to interact with the database)
- Download Docker
- Download the Docker Extension on VSCode or the equivalent on your favourite text editor
- Clone this repository
git clone https://github.com/CSIE-Camp/website-backend.git
- Change directory to the cloned repository (e.g.
cd website-backend
) - Install dependencies
npm install
- Run the command
docker compose up
Run npm run dev
to start the development server, which will automatically restart when you make changes to the code.
After the server is started, you can access the server at http://localhost:8080/
, you can also change the port by setting the PORT
environment variable.
Notes and Recommendations from @Maxxxxxx-x
We should ensure that our users' data and our server is as safe as possible.
- If you are using npm, run
npm audit
and check for vulnerabilities. - Use the latest available packages if possible.
- Trust no body, not even your parents. All users's input should be validated and sanitized regardless of the user's role.
- We will not be the safest thing on the internet but let's at least be safer than 阿莫's order form. 🤧
- Please remember to serialize all inputs provided by the user.
- Please remember to include the token into the Auth header (eg: bearer <token>)
- SECRET