If you are using VSCode/VSCodium, install the ESLint and Prettier extensions.
The project is already configured to use ESLint and Prettier,
but feel free to add your own rules if you want.
Right now, the code is formatted on save; you can change this in .vscode/settings.json
by disabling editor.formatOnSave
.
Run npm install
to install dependencies.
To run the server, you need to create a MongoDb Atlas instance. TODO: create account, project and .env file, add
MONGO_SRV=<connection url>
to the .env
file.
Run npm start
to start the server and the testing client.
If you make changes to code, you need to manually restart the server.
Run npm watch
to watch for changes and restart the server automatically.
Note that this is not recommended when actively developing;
use this when testing your code so your small changes get reflected in the server.
There is a testing client under public
directory.
Add more operations to public/util.ts
to test your server code.
Make sure to refresh the page after making changes to the client code.
Add some fancy CSS to make your page look nicer!
Keep in mind that we are using MongoStore
for session management,
so your session will be persisted across server restarts.
- Fork this repo.
- Create a new project on Vercel and link it to your GitHub project.
- Under "Build & Development Settings", change "Output Directory" to
dist/public
. - Add the following environment variables to your Vercel project: Key:
MONGO_SRV
, Value:<your mongo connection string from .env file>
- Deploy!